Skip to content

Commit 460f00c

Browse files
committed
feat: new homepage
1 parent cda4b80 commit 460f00c

File tree

2 files changed

+83
-5
lines changed

2 files changed

+83
-5
lines changed

src/i18n/index.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ i18n
2121
'practice': 'Practice',
2222
'learning': 'nav.learning'
2323
},
24+
'homepage': {
25+
'intro': {
26+
'ctf': 'Learning through CTF',
27+
'ctf-detail': 'Learning cryptography through Jeopardy-style CTF makes it more interesting.',
28+
'translate': 'Multilingual support',
29+
'translate-detail': 'All content on the platform can be quickly switched to other languages, as long as someone provide translation.',
30+
'resource': 'Integrated resources',
31+
'resource-detail': 'Click on the hyperlinks, and start the learning from the points you\'re interested about.'
32+
}
33+
},
2434
'introduction': 'Look, Study, Practice, all you need for cryptography is here(WIP :)',
2535
'light': 'Light',
2636
'dark': 'Dark',
@@ -35,6 +45,9 @@ i18n
3545
'resource': 'Integrated resources',
3646
'tools': 'Cryptography toolbox prepared for novice (WIP)',
3747
'visualize': 'Visualize cryptographic algorithm(WIP)',
48+
'etc': 'What\'s more?',
49+
'etc-detail': 'more features is waiting for adding into our platform: tutorial, more resouces, learning guide, more labs, cryptographic toolbox, visualization.',
50+
'etc-contact': 'You really can give a help hand at CSUwangj@protonmail.com.'
3851
},
3952
'lab': {
4053
'endpoint': 'Endpoint ',
@@ -55,6 +68,19 @@ i18n
5568
'practice': '实践',
5669
'learning': '学习',
5770
},
71+
'homepage': {
72+
'intro': {
73+
'ctf': '通过解题学密码学',
74+
'ctf-detail': '通过夺旗赛的方式来学习密码学,使知识更有趣。同时实践的过程也会让知识更牢固。',
75+
'translate': '多语言支持',
76+
'translate-detail': '平台的所有内容都可以迅速地切换到其他语言上,只要有人翻译。',
77+
'resource': '资源整合',
78+
'resource-detail': '随处可点的超链接,通过感兴趣的点展开学习的道路吧。',
79+
'etc': '想要更多?',
80+
'etc-detail': '更多的功能正在努力实现中:教程、更多资源、更多实践、学习指南、密码学工具箱、图解密码学。',
81+
'etc-contact': '欢迎提供援助:CSUwangj@protonmail.com。'
82+
}
83+
},
5884
'introduction': '接触、学习、实践,为了密码学你需要的都在这(还未完成 :)',
5985
'light': '日间模式',
6086
'dark': '夜间模式',

src/pages/home/index.tsx

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import logo from 'image/BigLogo.png'
33
import { useTranslation } from 'react-i18next'
44
import styled from '@emotion/styled/macro'
55
import { Div } from 'components/Div'
6-
import { H1, H3, H5, Button, Intent } from '@blueprintjs/core'
6+
import { H1, H3, H5, Button, Intent, Text } from '@blueprintjs/core'
77
import { IconNames } from "@blueprintjs/icons"
88
import { ExternalLink } from 'components/Link'
99
import { useHistory } from 'react-router-dom'
@@ -22,7 +22,7 @@ const Gap = styled.div`
2222
`
2323

2424
const BackContainer = styled.div`
25-
margin-top: -5px;
25+
padding-top: 5px;
2626
background-color: #47555e;
2727
h1, h3, h5 {
2828
color: #EEEEEE;
@@ -33,6 +33,11 @@ const BackContainer = styled.div`
3333
padding-bottom: 5px;
3434
`
3535

36+
const IntroBelowImg = styled(BackContainer)`
37+
margin-top: -5px;
38+
padding-bottom: 10px;
39+
`
40+
3641
const NavButton = styled(Button)`
3742
padding: 15px 25px !important;
3843
min-width: 150px !important;
@@ -59,22 +64,69 @@ const ButtonContainer = styled.div`
5964
align-items:center;
6065
`
6166

67+
const FeaturesContainer = styled(Div)`
68+
display: flex;
69+
max-width: 1260px;
70+
margin-left: auto;
71+
margin-right: auto;
72+
flex-wrap: nowrap;
73+
align-content: center;
74+
justify-content: space-between;
75+
align-items: flex-start;
76+
`
77+
78+
const FeatureContainer = styled(Div)`
79+
flex: 1 1 0;
80+
margin: 40px;
81+
line-height: 25px;
82+
text-align: justify;
83+
`
84+
85+
const FeatureTitle = styled(H3)`
86+
font-size: 24px;
87+
font-weight: 300;
88+
padding-bottom: 20px;
89+
`
90+
91+
const FeatureText = styled(Text)`
92+
font-size: 16px;
93+
font-weight: 400;
94+
`
95+
6296
export const Page: React.FC = () => {
6397
const { t } = useTranslation()
6498
const history = useHistory()
6599

66100
return <Container>
67101
<Img src={logo} alt='Big Logo' />
68-
<BackContainer>
102+
<IntroBelowImg>
69103
<H1>{t('nav.home')}</H1>
70104
<H3>{t('introduction')}</H3>
71105
<Gap />
72106
<ButtonContainer>
73107
<NavButton large intent={Intent.PRIMARY} onClick={() => history.push('/practice')} text={t('getstarted')} />
74108
<TakeButton large outlined={true} rightIcon={IconNames.ARROW_RIGHT} onClick={() => history.push('/tutorial')} text={t('taketutorial')} />
75109
</ButtonContainer>
76-
</BackContainer>
77-
110+
</IntroBelowImg>
111+
<FeaturesContainer>
112+
<FeatureContainer>
113+
<FeatureTitle>{t('homepage.intro.ctf')}</FeatureTitle>
114+
<FeatureText>{t('homepage.intro.ctf-detail')}</FeatureText>
115+
</FeatureContainer>
116+
<FeatureContainer>
117+
<FeatureTitle>{t('homepage.intro.translate')}</FeatureTitle>
118+
<FeatureText>{t('homepage.intro.translate-detail')}</FeatureText>
119+
</FeatureContainer>
120+
<FeatureContainer>
121+
<FeatureTitle>{t('homepage.intro.resource')}</FeatureTitle>
122+
<FeatureText>{t('homepage.intro.resource-detail')}</FeatureText>
123+
</FeatureContainer>
124+
<FeatureContainer>
125+
<FeatureTitle>{t('homepage.intro.etc')}</FeatureTitle>
126+
<FeatureText>{t('homepage.intro.etc-detail')}</FeatureText>
127+
<FeatureText>{t('homepage.intro.etc-contact')}</FeatureText>
128+
</FeatureContainer>
129+
</FeaturesContainer>
78130
<BackContainer>
79131
<Gap />
80132
<H5>Copyright © 2020-2021 <ExternalLink link='https://csuwangj.github.io/'>CSUwangj</ExternalLink></H5>

0 commit comments

Comments
 (0)