1
0
mirror of https://github.com/uetchy/namae.git synced 2025-07-01 22:10:04 +09:00
namae/web/src/components/Welcome.tsx

236 lines
4.8 KiB
TypeScript
Raw Normal View History

2019-09-17 14:30:26 +09:00
import React from 'react';
import styled from 'styled-components';
import {useTranslation} from 'react-i18next';
2020-02-05 19:22:35 +09:00
import {Link} from 'react-router-dom';
2019-08-01 13:21:23 +09:00
2019-08-07 14:16:06 +09:00
import {
FaMapSigns,
FaGithub,
2019-10-16 14:14:02 +09:00
FaGitlab,
2019-08-07 14:16:06 +09:00
FaNpm,
FaPython,
FaGem,
FaLinux,
FaAppStore,
FaTwitter,
FaSlack,
FaAws,
FaJsSquare,
2019-09-01 00:00:24 +09:00
FaBuilding,
2019-09-17 14:30:26 +09:00
} from 'react-icons/fa';
import {IoIosBeer} from 'react-icons/io';
import {DiRust, DiHeroku} from 'react-icons/di';
2019-08-01 13:21:23 +09:00
2020-02-05 19:56:59 +09:00
import {SpectrumIcon, NowIcon, NetlifyIcon, OcamlIcon} from './Icons';
2019-09-17 14:30:26 +09:00
import {mobile} from '../util/css';
2020-03-07 12:24:59 +09:00
import {sendGettingStartedEvent} from '../util/analytics';
2019-08-01 13:21:23 +09:00
2019-12-24 01:57:07 +09:00
const Welcome: React.FC = () => {
2019-09-17 14:30:26 +09:00
const {t} = useTranslation();
2019-08-03 13:36:29 +09:00
2019-08-01 13:21:23 +09:00
return (
<Container>
2019-08-01 14:00:22 +09:00
<Hero>
2020-02-06 13:16:30 +09:00
<HeroTitle>{t('title')}</HeroTitle>
<HeroText>{t('description')}</HeroText>
<ButtonContainer>
2020-02-05 19:22:35 +09:00
<List>
2020-03-06 23:46:19 +09:00
<ListButton>
2020-03-07 12:24:59 +09:00
<Link to="/s/namae" onClick={() => sendGettingStartedEvent()}>
2020-03-06 23:46:19 +09:00
{t('gettingStarted')}
</Link>
</ListButton>
2020-02-05 19:22:35 +09:00
</List>
2020-02-06 13:16:30 +09:00
</ButtonContainer>
2019-08-01 14:00:22 +09:00
</Hero>
2020-02-06 13:16:30 +09:00
<HighlightedList>
2019-08-01 14:00:22 +09:00
<ListItem>
2019-08-03 13:36:29 +09:00
<FaMapSigns /> {t('providers.domains')}
2019-08-01 14:00:22 +09:00
</ListItem>
<ListItem>
2019-08-03 13:36:29 +09:00
<FaGithub /> {t('providers.github')}
2019-08-01 14:00:22 +09:00
</ListItem>
2019-10-16 14:14:02 +09:00
<ListItem>
<FaGitlab /> {t('providers.gitlab')}
</ListItem>
2019-08-01 14:00:22 +09:00
<ListItem>
2019-08-03 13:36:29 +09:00
<FaNpm /> {t('providers.npm')}
2019-08-01 14:00:22 +09:00
</ListItem>
2020-02-05 19:56:59 +09:00
<ListItem>
<DiRust /> {t('providers.rust')}
</ListItem>
2019-08-01 14:00:22 +09:00
<ListItem>
2019-08-03 13:36:29 +09:00
<FaPython /> {t('providers.pypi')}
2019-08-01 14:00:22 +09:00
</ListItem>
<ListItem>
2019-08-03 13:36:29 +09:00
<FaGem /> {t('providers.rubygems')}
2019-08-01 14:00:22 +09:00
</ListItem>
<ListItem>
2020-02-05 19:56:59 +09:00
<OcamlIcon /> {t('providers.ocaml')}
2019-08-01 14:00:22 +09:00
</ListItem>
2019-08-02 17:07:28 +09:00
<ListItem>
2019-08-03 13:36:29 +09:00
<IoIosBeer /> {t('providers.homebrew')}
2019-08-02 17:07:28 +09:00
</ListItem>
2019-08-01 14:00:22 +09:00
<ListItem>
2019-08-06 01:17:29 +09:00
<FaLinux /> {t('providers.linux')}
2019-08-01 14:00:22 +09:00
</ListItem>
<ListItem>
2019-08-03 13:36:29 +09:00
<FaTwitter /> {t('providers.twitter')}
2019-08-01 14:00:22 +09:00
</ListItem>
2019-08-14 15:13:57 +09:00
<ListItem>
<SpectrumIcon /> {t('providers.spectrum')}
</ListItem>
2019-08-01 14:00:22 +09:00
<ListItem>
2019-08-03 13:36:29 +09:00
<FaSlack /> {t('providers.slack')}
2019-08-01 14:00:22 +09:00
</ListItem>
<ListItem>
<DiHeroku /> {t('providers.heroku')}
</ListItem>
<ListItem>
<NowIcon /> {t('providers.now')}
</ListItem>
2019-10-16 14:14:02 +09:00
<ListItem>
<NetlifyIcon /> {t('providers.netlify')}
</ListItem>
2019-08-06 01:17:29 +09:00
<ListItem>
<FaAws /> {t('providers.s3')}
</ListItem>
<ListItem>
<FaJsSquare /> {t('providers.jsorg')}
</ListItem>
2019-08-07 14:16:06 +09:00
<ListItem>
<FaGithub /> {t('providers.githubSearch')}
</ListItem>
<ListItem>
<FaAppStore /> {t('providers.appStore')}
</ListItem>
2019-09-01 00:00:24 +09:00
<ListItem>
<FaBuilding /> {t('providers.nta')}
</ListItem>
2020-02-06 13:16:30 +09:00
</HighlightedList>
2019-08-01 13:21:23 +09:00
</Container>
2019-09-17 14:30:26 +09:00
);
2019-12-24 01:57:07 +09:00
};
export default Welcome;
2019-08-01 13:21:23 +09:00
const Container = styled.div`
2020-02-06 17:21:22 +09:00
margin-top: 30px;
2019-08-01 14:00:22 +09:00
padding-bottom: 40px;
2019-08-01 13:21:23 +09:00
text-align: center;
font-size: 1.5rem;
${mobile} {
2020-02-06 13:16:30 +09:00
margin-top: 0px;
2019-08-01 13:21:23 +09:00
text-align: left;
2019-08-01 14:32:00 +09:00
font-size: 1.2rem;
2019-08-01 13:21:23 +09:00
}
2019-09-17 14:30:26 +09:00
`;
2019-08-01 13:21:23 +09:00
2020-02-06 13:16:30 +09:00
const HeroTitle = styled.h1`
2019-08-01 14:00:22 +09:00
padding-bottom: 30px;
2020-02-06 13:16:30 +09:00
line-height: 1em;
2020-02-06 17:21:22 +09:00
font-size: 5rem;
2020-02-06 13:16:30 +09:00
font-weight: 700;
2019-08-03 13:36:29 +09:00
${mobile} {
2020-02-06 13:16:30 +09:00
font-size: 2.5em;
2019-08-03 13:36:29 +09:00
}
2019-09-17 14:30:26 +09:00
`;
2019-08-01 14:00:22 +09:00
2020-02-06 13:16:30 +09:00
const HeroText = styled.p`
2019-08-01 14:00:22 +09:00
font-size: 1.2em;
2020-03-06 23:46:19 +09:00
font-weight: 400;
2020-02-06 13:27:43 +09:00
line-height: 1.3em;
2019-08-01 14:00:22 +09:00
color: #3c3c3c;
2019-09-17 14:30:26 +09:00
`;
2019-08-01 14:00:22 +09:00
2020-02-06 13:16:30 +09:00
const Hero = styled.div`
margin-right: 20vw;
margin-left: 20vw;
2019-08-01 13:21:23 +09:00
2020-02-06 13:16:30 +09:00
${mobile} {
margin: inherit;
padding-right: 20px;
padding-left: 20px;
}
`;
const ButtonContainer = styled.div`
2020-03-06 23:46:19 +09:00
margin: 10px 0 0 0;
2020-02-05 19:22:35 +09:00
`;
2019-08-01 13:21:23 +09:00
const List = styled.div`
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
2020-02-06 13:16:30 +09:00
2020-02-05 19:22:35 +09:00
font-size: 1rem;
${mobile} {
justify-content: flex-start;
}
`;
2020-02-06 13:16:30 +09:00
const HighlightedList = styled.div`
2020-02-05 20:47:03 +09:00
margin-top: 100px;
2020-02-05 19:22:35 +09:00
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
2019-08-01 13:21:23 +09:00
${mobile} {
flex-direction: column;
2020-02-05 20:47:03 +09:00
margin-top: 50px;
padding: 20px;
2019-08-01 13:21:23 +09:00
}
2020-02-05 19:22:35 +09:00
2020-02-05 20:47:03 +09:00
padding: 50px 20vw 50px 20vw;
2020-02-05 19:22:35 +09:00
color: white;
2020-02-06 13:16:30 +09:00
/* background-image: linear-gradient(180deg, #a57bf3 0%, #4364e1 100%); */
2020-02-06 17:21:22 +09:00
background: #632bec;
2019-09-17 14:30:26 +09:00
`;
2019-08-01 13:21:23 +09:00
const ListItem = styled.div`
2020-02-06 13:16:30 +09:00
margin: 20px 25px;
2019-08-01 13:21:23 +09:00
display: flex;
align-items: center;
2020-02-05 20:47:03 +09:00
font-size: 1.5rem;
2019-08-01 14:00:22 +09:00
line-height: 1em;
2019-08-01 13:21:23 +09:00
${mobile} {
margin: 10px 0;
2020-02-05 20:47:03 +09:00
font-size: 1.2rem;
2019-08-01 13:21:23 +09:00
}
svg {
margin-right: 5px;
}
2019-09-17 14:30:26 +09:00
`;
2020-02-05 19:22:35 +09:00
const ListButton = styled.div`
2020-02-06 13:27:43 +09:00
margin: 10px 5px;
2020-02-05 19:22:35 +09:00
display: flex;
align-items: center;
font-size: 1.2rem;
line-height: 1em;
${mobile} {
margin: 10px 10px 0 0;
}
a {
color: black;
2020-03-06 23:46:19 +09:00
padding: 12px 25px;
2020-02-05 19:22:35 +09:00
border: 1px solid black;
border-radius: 2px;
2020-02-06 13:27:43 +09:00
text-decoration: none;
2020-02-06 03:39:06 +09:00
&:hover {
color: white;
background: black;
}
2020-02-05 19:22:35 +09:00
}
`;