Skip to content

Commit 1732489

Browse files
authored
Merge pull request #1181 from ethereum/what-is-ethereum
New "What is Ethereum" page
2 parents 5160d3a + 2aba5b2 commit 1732489

File tree

16 files changed

+696
-66
lines changed

16 files changed

+696
-66
lines changed

src/components/ActionCard.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import React from "react"
2+
import styled from "styled-components"
3+
import Img from "gatsby-image"
4+
5+
import Link from "./Link"
6+
7+
const Content = styled.div`
8+
padding: 1.5rem;
9+
`
10+
11+
const Description = styled.p`
12+
opacity: 0.8;
13+
`
14+
15+
const ImageWrapper = styled.div`
16+
display: flex;
17+
flex-direction: row;
18+
justify-content: center;
19+
align-items: center;
20+
background: ${(props) => props.theme.colors.cardGradient};
21+
box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.1);
22+
min-height: 260px;
23+
`
24+
25+
const Image = styled(Img)`
26+
width: 100%;
27+
max-width: 372px;
28+
max-height: 257px;
29+
@media (max-width: ${(props) => props.theme.breakpoints.s}) {
30+
max-width: 311px;
31+
}
32+
`
33+
34+
const Card = styled(Link)`
35+
flex: 1 1 372px;
36+
color: ${(props) => props.theme.colors.text};
37+
box-shadow: 0px 14px 66px rgba(0, 0, 0, 0.07),
38+
0px 10px 17px rgba(0, 0, 0, 0.03), 0px 4px 7px rgba(0, 0, 0, 0.05);
39+
margin: 1rem;
40+
41+
&:hover {
42+
border-radius: 4px;
43+
box-shadow: 0px 8px 17px rgba(0, 0, 0, 0.15);
44+
background: ${(props) => props.theme.colors.tableBackgroundHover};
45+
transition: transform 0.1s;
46+
transform: scale(1.02);
47+
}
48+
`
49+
50+
const ActionCard = ({ to, image, title, description, children, className }) => {
51+
return (
52+
<Card to={to} className={className}>
53+
<ImageWrapper>
54+
<Image fixed={image} alt={`${title} image`} />
55+
</ImageWrapper>
56+
<Content>
57+
<h3>{title}</h3>
58+
<Description>{description}</Description>
59+
{children}
60+
</Content>
61+
</Card>
62+
)
63+
}
64+
65+
export default ActionCard

src/components/Callout.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import React from "react"
2+
import styled from "styled-components"
3+
import Img from "gatsby-image"
4+
5+
const StyledCard = styled.div`
6+
display: flex;
7+
flex-direction: column;
8+
background: linear-gradient(
9+
49.21deg,
10+
rgba(127, 127, 213, 0.2) 19.87%,
11+
rgba(134, 168, 231, 0.2) 58.46%,
12+
rgba(145, 234, 228, 0.2) 97.05%
13+
);
14+
padding: 1.5rem;
15+
margin: 1rem;
16+
margin-top: 8rem;
17+
border-radius: 4px;
18+
@media (max-width: ${(props) => props.theme.breakpoints.l}) {
19+
margin-bottom: 4rem;
20+
}
21+
`
22+
23+
const Description = styled.p`
24+
font-size: 20px;
25+
line-height: 140%;
26+
color: ${(props) => props.theme.colors.text200};
27+
`
28+
29+
const Image = styled(Img)`
30+
align-self: center;
31+
width: 100%;
32+
height: 100%;
33+
max-width: ${(props) => props.maxImageWidth};
34+
margin-top: -10rem;
35+
`
36+
37+
const Content = styled.div`
38+
display: flex;
39+
flex-direction: column;
40+
justify-content: space-between;
41+
height: 100%;
42+
margin-top: 2.5rem;
43+
`
44+
45+
const Callout = ({
46+
image,
47+
maxImageWidth,
48+
title,
49+
description,
50+
children,
51+
className,
52+
}) => {
53+
return (
54+
<StyledCard className={className}>
55+
<Image
56+
fluid={image}
57+
alt={`${title} image`}
58+
maxImageWidth={maxImageWidth}
59+
/>
60+
<Content>
61+
<div>
62+
<h3>{title}</h3>
63+
<Description>{description}</Description>
64+
</div>
65+
{children}
66+
</Content>
67+
</StyledCard>
68+
)
69+
}
70+
71+
export default Callout

src/components/Card.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from "react"
2+
import styled from "styled-components"
3+
import { Twemoji } from "react-emoji-render"
4+
5+
const StyledCard = styled.div`
6+
background: ${(props) => props.theme.colors.searchBackground};
7+
border-radius: 4px;
8+
border: 1px solid ${(props) => props.theme.colors.lightBorder};
9+
padding: 1.5rem;
10+
`
11+
12+
const Emoji = styled(Twemoji)`
13+
& > img {
14+
width: 3em !important;
15+
height: 3em !important;
16+
margin-bottom: 1em !important;
17+
}
18+
`
19+
20+
const Description = styled.p`
21+
opacity: 0.8;
22+
`
23+
24+
const Card = ({ emoji, title, description, children, className }) => {
25+
return (
26+
<StyledCard className={className}>
27+
<Emoji svg text={emoji} />
28+
<h3>{title}</h3>
29+
<Description>{description}</Description>
30+
{children}
31+
</StyledCard>
32+
)
33+
}
34+
35+
export default Card

src/components/Footer.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ const StyledFooter = styled.footer`
1616
flex-wrap: wrap;
1717
padding-top: 3rem;
1818
padding-bottom: 4rem;
19-
max-width: ${(props) => props.theme.breakpoints.xl};
20-
padding: 1rem 0;
21-
@media (max-width: ${(props) => props.theme.breakpoints.xl}) {
22-
padding: 1rem 2rem;
23-
}
19+
padding: 1rem 2rem;
2420
`
2521

2622
const FooterTop = styled.div`

src/components/Layout.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const ContentContainer = styled.div`
1818
flex-flow: column;
1919
2020
@media (min-width: ${(props) => props.theme.breakpoints.l}) {
21-
max-width: ${(props) => props.theme.breakpoints.xl};
21+
/* xl breakpoint (1440px) + 72px (2rem padding on each side) */
22+
max-width: 1504px;
2223
}
2324
`
2425

src/components/SharedStyledComponents.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import styled from "styled-components"
22
import { Mixins } from "./Theme"
33

44
export const PageContainer = styled.div`
5-
width: 85vw;
6-
max-width: ${(props) => props.theme.breakpoints.xl};
5+
width: 100%;
76
margin: 0 auto;
87
padding-top: 6rem;
8+
padding-right: 2rem;
9+
padding-left: 2rem;
910
@media (min-width: ${(props) => props.theme.breakpoints.l}) {
1011
padding-top: 10rem;
1112
}

src/components/Sidebar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ const customIdRegEx = /^.+(\s*\{#([A-Za-z0-9\-_]+?)\}\s*)$/
77
const Aside = styled.aside`
88
position: sticky;
99
top: 72px;
10-
padding: 1rem;
10+
padding: 1rem 0 1rem 1rem;
1111
bottom: 0;
1212
right: 0;
13-
width: 18.5rem;
13+
max-width: 25%;
1414
height: calc(100vh - 80px);
1515
overflow-y: auto;
1616
transition: all 0.2s ease-in-out;

src/components/Theme.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ const lightColors = {
4343
homeDivider: "#a4a4f3",
4444
displayDark: "none",
4545
displayLight: "block",
46+
grayBackground: "#fcfcfc",
47+
cardGradient:
48+
"radial-gradient(46.28% 66.31% at 66.95% 58.35%, #e6e6f7 0%, #e7edfa 50%, #e9fbfa 100%)",
4649
}
4750

4851
const darkColors = {
@@ -76,6 +79,9 @@ const darkColors = {
7679
homeDivider: "#ffc7a7",
7780
displayDark: "block",
7881
displayLight: "none",
82+
grayBackground: "#272627",
83+
cardGradient:
84+
"linear-gradient(49.21deg, rgba(127, 127, 213, 0.2) 19.87%, rgba(134, 168, 231, 0.2) 58.46%, rgba(145, 234, 228, 0.2) 97.05% )",
7985
}
8086

8187
const lightThemeColors = Object.assign({}, baseColors, lightColors)

src/content/what-is-ethereum/index.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/images/eth-logo.png

291 KB
Loading

0 commit comments

Comments
 (0)