Skip to content

Commit ffd8b3e

Browse files
author
Ryan Chu
committedSep 16, 2016
Basic style update
1 parent 779699b commit ffd8b3e

9 files changed

+169
-39
lines changed
 

‎.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[*]
2+
indent_style = space
3+
end_of_line = lf
4+
indent_size = 2
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
8+
[*.md]
9+
max_line_length = 0
10+
trim_trailing_whitespace = false

‎css/global.css

+93-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,95 @@
1+
@import "../node_modules/normalize.css/normalize.css";
2+
@import "./color.css";
3+
4+
html, body {
5+
height: 100%;
6+
}
7+
18
body {
2-
font-family: Helvetica Neue, Helvetica, sans-serif;
9+
font-family: -apple-system, BlinkMacSystemFont, Microsoft Yahei, STHeiti, Helvetica Neue, Helvetica, sans-serif;
10+
}
11+
12+
#react-mount,
13+
#react-mount > div {
14+
height: 100%;
15+
}
16+
17+
.app-header {
18+
width: 100%;
19+
height: 90px;
20+
background-color: var(--base);
21+
}
22+
23+
.app-header h1 {
24+
float: left;
25+
margin: 32px 0 32px 0;
26+
font-size: 24px;
27+
font-weight: 600;
28+
}
29+
30+
.app-header nav {
31+
float: right;
32+
margin: 36px 0 28px 0;
33+
font-size: 18px;
34+
}
35+
36+
.app-header a {
37+
color: white;
38+
text-decoration: none;
39+
transition: opacity 0.15s linear;
40+
}
41+
42+
.app-header a:hover {
43+
opacity: 0.7;
44+
}
45+
46+
.app-header nav a {
47+
margin-left: 48px;
48+
padding-bottom: 4px;
49+
}
50+
51+
.app-header nav a.active,
52+
.app-header nav a:hover {
53+
border-bottom: 2px solid white;
54+
}
55+
56+
.app-footer {
57+
width: 100%;
58+
height: 140px;
59+
background-color: var(--base);
60+
display: flex;
61+
align-items: center;
62+
}
63+
64+
.app-footer p {
65+
width: 100%;
66+
color: white;
67+
opacity: 0.5;
68+
font-size: 12px;
69+
text-align: center;
70+
}
71+
72+
.home {
73+
margin-top: -90px;
74+
}
75+
76+
.home-hero-section {
77+
width: 100%;
78+
height: 600px;
79+
background: url("/images/index-hero-section.png") center center;
80+
}
81+
82+
.home-hero-section-text {
83+
position: absolute;
84+
top: 340px;
85+
margin: 0 auto;
86+
width: 100%;
87+
font-size: 32px;
88+
color: white;
89+
text-align: center;
90+
opacity: 0.8;
91+
}
92+
93+
.home-content {
94+
height: 600px;
395
}

‎package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
"markdown-it-deflist": "^2.0.1",
1616
"markdown-it-footnote": "^3.0.1",
1717
"markdown-it-sub": "^1.0.0",
18+
"normalize.css": "^4.2.0",
1819
"object-assign": "^4.1.0",
19-
"react-helmet": "^3.1.0",
2020
"react-headroom": "^2.1.2",
21+
"react-helmet": "^3.1.0",
2122
"react-responsive-grid": "^0.3.3",
22-
"toml-js": "0.0.8",
23-
"typography": "^0.13.0",
24-
"typography-plugin-code": "^0.13.0"
23+
"toml-js": "0.0.8"
2524
},
2625
"devDependencies": {
2726
"gh-pages": "^0.11.0"
@@ -36,6 +35,6 @@
3635
"serve": "gatsby serve-build",
3736
"deploy": "gatsby build && gh-pages -b master -d public",
3837
"dev": "gatsby develop",
39-
"test": "echo \"Error: no test specified\" && exit 1"
38+
"test": "echo \"No test specified\" && exit 0"
4039
}
4140
}

‎pages/_template.jsx

+46-22
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Helmet from "react-helmet"
33
import { Container } from "react-responsive-grid"
44
import { Link } from "react-router"
55
import { prefixLink } from "gatsby-helpers"
6-
import Headroom from "react-headroom"
76
import { config } from "config"
87
import "../css/global"
98
import "../css/markdown-styles"
@@ -15,6 +14,9 @@ module.exports = React.createClass({
1514
}
1615
},
1716
render () {
17+
const { location } = this.props;
18+
const { pathname } = location;
19+
console.log(pathname);
1820
return (
1921
<div>
2022
<Helmet
@@ -24,40 +26,62 @@ module.exports = React.createClass({
2426
{"name": "keywords", "content": config.siteKeywords},
2527
]}
2628
/>
27-
<Headroom
28-
wrapperStyle={{
29-
fontSize: 24,
30-
fontWeight: 600,
31-
lineHeight: 4,
32-
marginBottom: 40,
33-
}}
34-
>
29+
<header className="app-header">
3530
<Container
3631
style={{
37-
maxWidth: 1140,
38-
paddingTop: 0,
32+
maxWidth: 1140
3933
}}
4034
>
41-
<Link
42-
to={prefixLink("/")}
43-
style={{
44-
color: "#1A2B34",
45-
opacity: 0.6,
46-
textDecoration: "none",
47-
}}
48-
>
49-
Golang Foundation
50-
</Link>
35+
<h1>
36+
<Link to={prefixLink("/")}>Golang Foundation</Link>
37+
</h1>
38+
<nav>
39+
<Link
40+
className={(pathname === "/") ? "active" : ""}
41+
to={prefixLink("/")}
42+
>
43+
首页
44+
</Link>
45+
<Link
46+
className={(pathname === "/events/") ? "active" : ""}
47+
to={prefixLink("/events/")}
48+
>
49+
活动
50+
</Link>
51+
<Link
52+
className={(pathname === "/opensource/") ? "active" : ""}
53+
to={prefixLink("/opensource/")}
54+
>
55+
开源项目
56+
</Link>
57+
<Link
58+
className={(pathname === "/about/") ? "active" : ""}
59+
to={prefixLink("/about/")}
60+
>
61+
关于
62+
</Link>
63+
</nav>
5164
</Container>
52-
</Headroom>
65+
</header>
66+
{(pathname === "/") && (
67+
<div className="home">
68+
<div className="home-hero-section">
69+
<p className="home-hero-section-text">Todo About Golang Foundation</p>
70+
</div>
71+
</div>
72+
)}
5373
<Container
5474
style={{
5575
maxWidth: 1140,
5676
paddingTop: 0,
77+
minHeight: "100%"
5778
}}
5879
>
5980
{this.props.children}
6081
</Container>
82+
<footer className="app-footer">
83+
<p>@ 2016 All Rights Reserved.</p>
84+
</footer>
6185
</div>
6286
)
6387
},

‎pages/events.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: 活动
3+
---
4+
5+
## Todo
6+
7+
List of recent events.

‎pages/images/index-hero-section.png

647 KB
Loading

‎pages/index.css

-5
This file was deleted.

‎pages/index.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import React from "react"
22
import { Link } from "react-router"
33
import { prefixLink } from "gatsby-helpers"
4-
import "./index.css"
54

65
export default class Index extends React.Component {
76
render () {
87
return (
9-
<div>
10-
<h1>首页</h1>
11-
<h2>Todo</h2>
12-
<p>活动 | 开源项目 | 教育 | 社区</p>
13-
<p><Link to={prefixLink("/about/")}>关于</Link></p>
8+
<div className="home-content">
9+
<p>近期活动 | 开源项目 | 赞助商</p>
1410
</div>
1511
)
1612
}

‎pages/opensource.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: 开源项目
3+
---
4+
5+
## Todo
6+
7+
List of open source projects

0 commit comments

Comments
 (0)
Please sign in to comment.