Fixes/august (#12)

* fix button dimensions

* fix footer hover color

* breakout in trace component

* fix padding on button on small screens

* fix title with content on small screens

* sizing adjustment in intro component

* intro component adjustments

* container size adjustments

* meta og images

* fixed gutter size

* trace component fix + breakout fix

* show copy button if touch device

* responsive hero animation
This commit is contained in:
August Skare
2018-10-29 08:15:20 +00:00
committed by GitHub
parent 3d4041ecd3
commit 0e3cd82348
18 changed files with 119 additions and 58 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -11,9 +11,9 @@ const pages = [
'og-title': { property: 'og:title', content: 'sol-compiler' }, 'og-title': { property: 'og:title', content: 'sol-compiler' },
'og-description': { property: 'og:description', content: 'Solidity compilation that just works' }, 'og-description': { property: 'og:description', content: 'Solidity compilation that just works' },
'og-type': { property: 'og:type', content: 'website' }, 'og-type': { property: 'og:type', content: 'website' },
'og-image': { property: 'og:image', content: '' }, 'og-image': { property: 'og:image', content: '/images/og-compiler' },
'twitter:site': '@0xproject', 'twitter:site': '@0xproject',
'twitter:image': '', 'twitter:image': '/images/og-compiler',
}, },
}, },
{ {
@@ -28,9 +28,9 @@ const pages = [
'og-title': { property: 'og:title', content: 'sol-cov' }, 'og-title': { property: 'og:title', content: 'sol-cov' },
'og-description': { property: 'og:description', content: 'Solidity code coverage' }, 'og-description': { property: 'og:description', content: 'Solidity code coverage' },
'og-type': { property: 'og:type', content: 'website' }, 'og-type': { property: 'og:type', content: 'website' },
'og-image': { property: 'og:image', content: '' }, 'og-image': { property: 'og:image', content: '/images/og-cov' },
'twitter:site': '@0xproject', 'twitter:site': '@0xproject',
'twitter:image': '', 'twitter:image': '/images/og-cov',
}, },
}, },
{ {
@@ -45,9 +45,9 @@ const pages = [
'og-title': { property: 'og:title', content: 'sol-profiler' }, 'og-title': { property: 'og:title', content: 'sol-profiler' },
'og-description': { property: 'og:description', content: 'Gas profiling for Solidity' }, 'og-description': { property: 'og:description', content: 'Gas profiling for Solidity' },
'og-type': { property: 'og:type', content: 'website' }, 'og-type': { property: 'og:type', content: 'website' },
'og-image': { property: 'og:image', content: '' }, 'og-image': { property: 'og:image', content: '/images/og-profiler' },
'twitter:site': '@0xproject', 'twitter:site': '@0xproject',
'twitter:image': '', 'twitter:image': '/images/og-profiler',
}, },
}, },
{ {
@@ -62,9 +62,9 @@ const pages = [
'og-title': { property: 'og:title', content: 'sol-trace' }, 'og-title': { property: 'og:title', content: 'sol-trace' },
'og-description': { property: 'og:description', content: 'Human-readable stack traces' }, 'og-description': { property: 'og:description', content: 'Human-readable stack traces' },
'og-type': { property: 'og:type', content: 'website' }, 'og-type': { property: 'og:type', content: 'website' },
'og-image': { property: 'og:image', content: '' }, 'og-image': { property: 'og:image', content: '/images/og-trace' },
'twitter:site': '@0xproject', 'twitter:site': '@0xproject',
'twitter:image': '', 'twitter:image': '/images/og-trace',
}, },
}, },
]; ];

View File

@@ -4,8 +4,8 @@ import { media } from 'ts/variables';
const Breakout = styled.div` const Breakout = styled.div`
${media.small` ${media.small`
margin-left: -30px; margin-left: -2.5rem;
width: calc(100% + 60px); width: calc(100% + 5rem);
`}; `};
`; `;

View File

@@ -13,7 +13,8 @@ const Button =
ButtonProps > ButtonProps >
` `
font-family: inherit; font-family: inherit;
font-size: ${props => (props.large ? '1.125rem' : '.875rem')}; font-size: ${props => (props.large ? '1rem' : '.875rem')};
line-height: 1;
font-weight: 500; font-weight: 500;
white-space: nowrap; white-space: nowrap;
vertical-align: middle; vertical-align: middle;
@@ -21,16 +22,20 @@ const Button =
color: ${colors.black}; color: ${colors.black};
border: 0; border: 0;
border-radius: 5rem; border-radius: 5rem;
padding: ${props => (props.large ? '1.125rem 2.375rem' : '.5625rem 1.25rem')}; height: ${props => (props.large ? '3.25rem' : '2rem')};
display: inline-block; padding: ${props => (props.large ? '0 2.375rem' : '0 1.25rem')};
display: inline-flex;
justify-content: space-between;
align-items: center;
:hover, :focus { :hover, :focus {
background-color: ${props => props.colors.secondary_alt}; background-color: ${props => props.colors.secondary_alt};
} }
${props => ${props =>
props.large && props.large &&
media.small` media.small`
font-size: 1rem; font-size: .875rem;
padding: .875rem 1.5rem; height: 2rem;
padding: 0 1.25rem;
`} `}
`; `;

View File

@@ -1,9 +1,15 @@
import * as React from 'react'; import * as React from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import { colors } from 'ts/variables'; import { colors, media } from 'ts/variables';
import BaseButton from './Button'; import BaseButton from './Button';
const touch = Boolean(
'ontouchstart' in window ||
(window as any).navigator.maxTouchPoints > 0 ||
(window as any).navigator.msMaxTouchPoints > 0,
);
interface CodeProps { interface CodeProps {
children: React.ReactNode; children: React.ReactNode;
language?: string; language?: string;
@@ -19,7 +25,7 @@ interface CodeState {
} }
const Button = styled(BaseButton)` const Button = styled(BaseButton)`
opacity: 0; opacity: ${touch ? '1' : '0'};
position: absolute; position: absolute;
top: 1rem; top: 1rem;
right: 1rem; right: 1rem;
@@ -80,9 +86,10 @@ const StyledCodeDiff = styled(({ gutterLength, children, ...props }: any) => <co
position: relative; position: relative;
padding-right: 1.5rem; padding-right: 1.5rem;
padding-left: calc(2.25rem + ${props => props.gutterLength}ch); padding-left: calc(2.25rem + ${props => props.gutterLength}ch);
::before { ::before {
content: attr(data-test); content: attr(data-test);
font-size: 0.875rem;
width: ${props => props.gutterLength}; width: ${props => props.gutterLength};
padding-left: 0.375rem; padding-left: 0.375rem;
padding-right: 0.375rem; padding-right: 0.375rem;

View File

@@ -1,5 +1,7 @@
import styled from 'styled-components'; import styled from 'styled-components';
import { media } from 'ts/variables';
interface ContainerProps { interface ContainerProps {
wide?: boolean; wide?: boolean;
} }
@@ -10,7 +12,7 @@ const Container =
` `
max-width: 77.5rem; max-width: 77.5rem;
margin: 0 auto; margin: 0 auto;
width: ${props => (props.wide ? '100%' : 'calc(100% - 3.75rem)')}; width: ${props => (props.wide ? '100%' : 'calc(100% - 5rem)')};
`; `;
export default Container; export default Container;

View File

@@ -45,6 +45,11 @@ const Item = styled.div`
const StyledTitle = styled(Alpha)` const StyledTitle = styled(Alpha)`
color: ${props => props.color}; color: ${props => props.color};
${media.small`
& + div {
margin-top: 1.5rem;
}
`};
`; `;
interface ContentBlockProps extends Props { interface ContentBlockProps extends Props {

View File

@@ -6,40 +6,46 @@ import { withContext, Props } from './withContext';
import Button from './Button'; import Button from './Button';
import { Beta } from './Typography'; import { Beta } from './Typography';
const IMAGE_WIDTH = 2560;
const IMAGE_HEIGHT = 800;
function Hero(props: Props) { function Hero(props: Props) {
const { subtitle, tagline, title } = props; const { subtitle, tagline, title } = props;
return ( return (
<React.Fragment> <React.Fragment>
<StyledHero> <StyledHero>
<Subtitle>{subtitle}</Subtitle> <HeroContainer>
<Tagline as="p">{tagline}</Tagline> <Subtitle>{subtitle}</Subtitle>
<Button as="a" href="#" large> <Tagline as="p">{tagline}</Tagline>
Read the Docs <Button as="a" href="#" large>
</Button> Read the Docs
</StyledHero> </Button>
</HeroContainer>
<ImageContainer> <ImageContainer>
<Image src={`/images/${title}@1x.gif`} srcSet={`/images/${title}@1x.gif, /images/${title}@2x.gif 2x`} /> <Image
</ImageContainer> src={`/images/${title}@1x.gif`}
srcSet={`/images/${title}@1x.gif, /images/${title}@2x.gif 2x`}
/>
</ImageContainer>
</StyledHero>
</React.Fragment> </React.Fragment>
); );
} }
const StyledHero = styled.section` const StyledHero = styled.section`
text-align: center; text-align: center;
margin: 0 auto;
padding-top: 9.375rem; padding-top: 9.375rem;
padding-bottom: 2rem; padding-bottom: 2rem;
padding-left: 2.5rem; padding-left: 2.5rem;
padding-right: 2.5rem; padding-right: 2.5rem;
max-width: 590px;
min-height: min-content; min-height: min-content;
max-height: 37.5rem; max-height: 37.5rem;
height: 80vh; height: 80vh;
position: relative;
`;
const HeroContainer = styled.div`
margin: 0 auto;
max-width: 590px;
`; `;
const Subtitle = styled.h2` const Subtitle = styled.h2`
@@ -63,20 +69,37 @@ const Tagline = styled(Beta)`
const ImageContainer = styled.div` const ImageContainer = styled.div`
width: 100%; width: 100%;
height: ${IMAGE_HEIGHT}px; height: 800px;
position: absolute; position: absolute;
top: 6.875rem; top: 100%;
left: 0; left: 0;
overflow: hidden; overflow: hidden;
transform: translateY(-50%);
z-index: -1; z-index: -1;
${media.xlarge`
height: 533.333333334px;
transform: translateY(-60%);
`};
${media.small`
height: 400px;
transform: translateY(-70%);
`};
`; `;
const Image = styled.img` const Image = styled.img`
width: ${IMAGE_WIDTH}px; width: min-content;
height: 100%;
position: absolute; position: absolute;
top: 0; top: 0;
left: 50%; left: 50%;
transform: translate(-50%); transform: translateX(-50%);
object-fit: contain;
${media.small`
height: 100%;
width: auto;
left: 0;
transform: translateX(-15%);
`};
`; `;
export default withContext(Hero); export default withContext(Hero);

View File

@@ -12,8 +12,10 @@ const Main = styled.div`
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
${media.medium` ${media.large`
padding: 2.5rem 1.875rem padding: 2.5rem 1.875rem
`};
${media.medium`
display: block; display: block;
`}; `};
`; `;
@@ -21,17 +23,24 @@ const Main = styled.div`
const Title = styled(Alpha)` const Title = styled(Alpha)`
margin-bottom: 2.5rem; margin-bottom: 2.5rem;
${media.small`margin-bottom: 2.25rem;`}; ${media.medium`margin-bottom: 2.25rem;`};
`; `;
const StyledIntroLead = styled(Lead)` const StyledIntroLead = styled(Lead)`
max-width: 25.9375rem; max-width: 25.9375rem;
${media.small`margin-bottom: 1.5625rem;`}; margin-right: 2rem;
${media.medium`
max-width: 100%;
margin-bottom: 1.5625rem;
`};
`; `;
const StyledIntroAside = styled.div` const StyledIntroAside = styled.div`
max-width: 32.5rem; max-width: 32.5rem;
position: relative; position: relative;
${media.medium`
max-width: 100%;
`};
`; `;
interface IntroProps { interface IntroProps {

View File

@@ -6,6 +6,7 @@ import { withContext, Props } from './withContext';
import { Alpha, Lead, Gamma } from './Typography'; import { Alpha, Lead, Gamma } from './Typography';
import Container from './Container'; import Container from './Container';
import Code from './Code'; import Code from './Code';
import Breakout from './Breakout';
import ExactLocation from 'ts/icons/exact-location.svg'; import ExactLocation from 'ts/icons/exact-location.svg';
import NoLocation from 'ts/icons/no-location.svg'; import NoLocation from 'ts/icons/no-location.svg';
@@ -28,7 +29,9 @@ function Trace(props: Props) {
Every time an Ethereum transaction fails, it's extremely hard to trace down the troublemaking Every time an Ethereum transaction fails, it's extremely hard to trace down the troublemaking
line of code. The only hint you'll get is a generic error. line of code. The only hint you'll get is a generic error.
</MainCopy> </MainCopy>
<Code light>Error: VM Exception while processing transaction: revert</Code> <Breakout>
<Code light>Error: VM Exception while processing transaction: rever</Code>
</Breakout>
<List> <List>
<Item> <Item>
@@ -61,7 +64,8 @@ function Trace(props: Props) {
Sol-trace will give you full stack traces, including contract names, line numbers and code Sol-trace will give you full stack traces, including contract names, line numbers and code
snippets, every time you encounter an error. snippets, every time you encounter an error.
</MainCopy> </MainCopy>
<Code light language="javascript"> <Breakout>
<Code light language="javascript">
{`contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol:51:8 {`contracts/src/2.0.0/protocol/Exchange/MixinSignatureValidator.sol:51:8
require( require(
isValidSignature( isValidSignature(
@@ -71,7 +75,8 @@ function Trace(props: Props) {
), ),
"INVALID_SIGNATURE" "INVALID_SIGNATURE"
)`} )`}
</Code> </Code>
</Breakout>
<List> <List>
<Item> <Item>
@@ -110,7 +115,7 @@ const StyledSection =
margin: 0 auto; margin: 0 auto;
background: linear-gradient(to right, ${colors.black} 50%, ${props => props.background} 50%); background: linear-gradient(to right, ${colors.black} 50%, ${props => props.background} 50%);
${media.small` ${media.large`
background: none background: none
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
@@ -126,7 +131,7 @@ const Wrapper = styled(Container)`
${media.small`padding-bottom: 1.875rem;`}; ${media.small`padding-bottom: 1.875rem;`};
} }
${media.small` ${media.large`
display: block; display: block;
width: 100%; width: 100%;
`}; `};
@@ -149,19 +154,22 @@ const Block =
padding-left: 6.25rem; padding-left: 6.25rem;
} }
${media.small` ${media.xlarge`
width: 100%;
padding-top: 2.5rem;
padding-bottom: 3.4375rem;
:first-of-type { :first-of-type {
padding-left: 1.875rem; padding-right: 2.5rem;
padding-right: 1.875rem;
} }
:last-of-type { :last-of-type {
padding-left: 1.875rem; padding-left: 2.5rem;
padding-right: 1.875rem;
} }
`}
${media.large`
width: 100%;
padding: 2.5rem;
`}
${media.small`
padding-left: 1.875rem;
padding-right: 1.875rem;
`}; `};
`; `;

View File

@@ -12,6 +12,6 @@ export default {
secondary_alt: '#C4F2FC', secondary_alt: '#C4F2FC',
type: '#30C3E3', type: '#30C3E3',
type_alt: '#16A9C9', type_alt: '#16A9C9',
dark: '#00404E', dark: '#4B818D',
}, },
}; };

View File

@@ -12,6 +12,6 @@ export default {
secondary_alt: '#F1D882', secondary_alt: '#F1D882',
type: '#D7AE1B', type: '#D7AE1B',
type_alt: '#BD9406', type_alt: '#BD9406',
dark: '#423300', dark: '#817033',
}, },
}; };

View File

@@ -12,6 +12,6 @@ export default {
secondary_alt: '#FECEBE', secondary_alt: '#FECEBE',
type: '#EB8666', type: '#EB8666',
type_alt: '#D16745', type_alt: '#D16745',
dark: '#5F1700', dark: '#985C49',
}, },
}; };

View File

@@ -12,6 +12,6 @@ export default {
secondary_alt: '#BFCDFF', secondary_alt: '#BFCDFF',
type: '#7090FF', type: '#7090FF',
type_alt: '#355CE5', type_alt: '#355CE5',
dark: '#0127AB', dark: '#2A4ABC',
}, },
}; };

View File

@@ -15,6 +15,8 @@ interface SizesInterface {
} }
const sizes: SizesInterface = { const sizes: SizesInterface = {
xlarge: 1420,
large: 1000,
medium: 900, medium: 900,
small: 650, small: 650,
}; };