diff options
author | 2020-09-28 02:23:04 +0100 | |
---|---|---|
committer | 2020-09-28 02:23:04 +0100 | |
commit | 01d7fdef889350a25767d5b1999f8698de7ba5a6 (patch) | |
tree | b2b7ef8d957a6cf00b0192c10e89f5f8e2a7682e /src | |
parent | Initialize project using Create React App (diff) |
Initial commit
Diffstat (limited to 'src')
-rw-r--r-- | src/App.css | 38 | ||||
-rw-r--r-- | src/App.tsx | 39 | ||||
-rw-r--r-- | src/colors.ts | 8 | ||||
-rw-r--r-- | src/components/FormListing.tsx | 51 | ||||
-rw-r--r-- | src/components/HeaderBar/header_1.svg | 3 | ||||
-rw-r--r-- | src/components/HeaderBar/header_2.svg | 3 | ||||
-rw-r--r-- | src/components/HeaderBar/index.tsx | 49 | ||||
-rw-r--r-- | src/components/OAuth2Button.tsx | 42 | ||||
-rw-r--r-- | src/index.css | 13 | ||||
-rw-r--r-- | src/index.tsx | 1 | ||||
-rw-r--r-- | src/pages/LandingPage.tsx | 24 |
11 files changed, 200 insertions, 71 deletions
diff --git a/src/App.css b/src/App.css deleted file mode 100644 index 74b5e05..0000000 --- a/src/App.css +++ /dev/null @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/src/App.tsx b/src/App.tsx index a53698a..3505dc1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,26 +1,27 @@ -import React from 'react'; -import logo from './logo.svg'; -import './App.css'; +/** @jsx jsx */ +import { css, jsx, Global } from "@emotion/core"; + +import LandingPage from "./pages/LandingPage"; +import colors from "./colors"; + +const globalStyles = css` +@import url('https://fonts.googleapis.com/css2?family=Hind:wght@700&display=swap'); + +body { + background-color: ${colors.notQuiteBlack}; + color: white; + font-family: "Hind", "Helvetica", "Arial", sans-serif; + margin: 0; +} +`; function App() { return ( - <div className="App"> - <header className="App-header"> - <img src={logo} className="App-logo" alt="logo" /> - <p> - Edit <code>src/App.tsx</code> and save to reload. - </p> - <a - className="App-link" - href="https://reactjs.org" - target="_blank" - rel="noopener noreferrer" - > - Learn React - </a> - </header> + <div> + <Global styles={globalStyles}/> + <LandingPage/> </div> ); -} +}; export default App; diff --git a/src/colors.ts b/src/colors.ts new file mode 100644 index 0000000..2107987 --- /dev/null +++ b/src/colors.ts @@ -0,0 +1,8 @@ +export default { + blurple: '#7289DA', + darkButNotBlack: '#2C2F33', + notQuiteBlack: '#23272A', + greyple: '#99AAB5', + error: '#f04747', + success: '#43b581' +} diff --git a/src/components/FormListing.tsx b/src/components/FormListing.tsx new file mode 100644 index 0000000..9b7eb08 --- /dev/null +++ b/src/components/FormListing.tsx @@ -0,0 +1,51 @@ +/** @jsx jsx */ +import { css, jsx } from "@emotion/core"; + +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faArrowRight } from "@fortawesome/free-solid-svg-icons"; + +import colors from "../colors"; + +interface FormListingProps { + title: string, + description: string, + open: boolean +} + +function FormListing(props: FormListingProps) { + const listingStyle = css` + background-color: ${props.open ? colors.success : colors.darkButNotBlack}; + width: 80%; + padding: 20px; + margin-top: 20px; + margin-bottom: 20px; + border-radius: 20px; + transition: filter 100ms; + + &:hover { + filter: brightness(110%); + } + `; + + let closedTag; + + if (!props.open) { + closedTag = <span css={css` + font-size: 0.75em; + background-color: ${colors.error}; + border-radius: 5px; + margin: 0; + padding-top: 3px; + margin-right: 5px; + padding-left: 5px; + padding-right: 5px; + `}>CLOSED</span>; + }; + + return <div css={listingStyle}> + <h3 css={{fontSize: "1.5em", marginBottom: "0"}}>{closedTag}{props.title} <FontAwesomeIcon icon={faArrowRight} css={{fontSize: "0.75em", paddingBottom: "1px"}}/></h3> + <p css={{marginTop: "5px"}}>{props.description}</p> + </div> +} + +export default FormListing; diff --git a/src/components/HeaderBar/header_1.svg b/src/components/HeaderBar/header_1.svg new file mode 100644 index 0000000..e7db64c --- /dev/null +++ b/src/components/HeaderBar/header_1.svg @@ -0,0 +1,3 @@ +<svg width="1440" height="264" viewBox="0 0 1440 264" fill="none" id="header_1" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M-5.85724 -6.18774V109.725C71.6463 154.832 238.796 275.611 529.296 262.865C819.777 250.113 820.413 92.4954 1447.77 223.42V-6.18451L-5.85724 -6.18774Z" fill="#AFB8F0"/> +</svg> diff --git a/src/components/HeaderBar/header_2.svg b/src/components/HeaderBar/header_2.svg new file mode 100644 index 0000000..692cc7c --- /dev/null +++ b/src/components/HeaderBar/header_2.svg @@ -0,0 +1,3 @@ +<svg width="1440" height="293" viewBox="0 0 1440 293" fill="none" id="header_2" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"> +<path opacity="0.49063" d="M1447.27 -6.18774V132.565C1428.83 231.124 1378.94 292.543 1114.48 292.543C775.159 292.543 477.003 5.74973 -6.39087 232.513V-6.18713L1447.27 -6.18774Z" fill="#687AE3"/> +</svg> diff --git a/src/components/HeaderBar/index.tsx b/src/components/HeaderBar/index.tsx new file mode 100644 index 0000000..200221c --- /dev/null +++ b/src/components/HeaderBar/index.tsx @@ -0,0 +1,49 @@ +/** @jsx jsx */ +import { css, jsx } from "@emotion/core"; +import SVG from "react-inlinesvg"; + +import header1 from "./header_1.svg"; +import header2 from "./header_2.svg"; + +const headerImageStyles = css` +z-index: -1; +top: 0; +position: absolute; +width: 100%; +transition: height 1s; + +@media (max-width: 660px) { + height: 140px; +} +`; + +function HeaderBar() { + return <div> + <div> + <SVG src={header1} css={headerImageStyles}/> + <SVG src={header2} css={headerImageStyles}/> + </div> + <h1 css={css` + font-size: 4em; + margin: 0; + margin-top: 10px; + margin-left: 30px; + margin-bottom: 200px; + transition-property: font-size, margin-bottom; + transition-duration: 1s; + + @media (max-width: 660px) { + margin-bottom: 100px; + font-size: 3em; + } + + @media (max-width: 510px) { + font-size: 2em; + } + `}> + Python Discord Forms + </h1> + </div> +} + +export default HeaderBar; diff --git a/src/components/OAuth2Button.tsx b/src/components/OAuth2Button.tsx new file mode 100644 index 0000000..537496b --- /dev/null +++ b/src/components/OAuth2Button.tsx @@ -0,0 +1,42 @@ +/** @jsx jsx */ +import { css, jsx } from "@emotion/core"; + +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faDiscord } from "@fortawesome/free-brands-svg-icons"; + +import colors from "../colors"; + +const buttonStyling = css` +display: flex; +background-color: ${colors.blurple}; +border: none; +color: white; +font-family: "Hind", "Helvetica", "Arial", sans-serif; +border-radius: 5px; +padding-top: 10px; +padding-bottom: 10px; +padding-right: 20px; +padding-left: 20px; +outline: none; +transition: filter 100ms; +font-size: 1.2em; +align-items: center; + +span { + vertical-align: middle; +} + +&:hover { + filter: brightness(110%); + cursor: pointer; +} +`; + +function OAuth2Button() { + return <button css={buttonStyling}> + <span css={{marginRight: "10px"}}><FontAwesomeIcon icon={faDiscord} css={{fontSize: "2em", marginTop: "3px"}}/></span> + <span>Sign in with Discord</span> + </button>; +} + +export default OAuth2Button; diff --git a/src/index.css b/src/index.css deleted file mode 100644 index ec2585e..0000000 --- a/src/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/src/index.tsx b/src/index.tsx index f5185c1..4146d1d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,5 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import './index.css'; import App from './App'; import * as serviceWorker from './serviceWorker'; diff --git a/src/pages/LandingPage.tsx b/src/pages/LandingPage.tsx new file mode 100644 index 0000000..16d40c4 --- /dev/null +++ b/src/pages/LandingPage.tsx @@ -0,0 +1,24 @@ +/** @jsx jsx */ +import { jsx } from "@emotion/core"; + +import HeaderBar from "../components/HeaderBar"; +import FormListing from "../components/FormListing"; +import OAuth2Button from "../components/OAuth2Button"; + +function LandingPage() { + return <div> + <HeaderBar/> + <div css={{marginLeft: "20px"}}> + <h1>Welcome to Python Discord Forms</h1> + + <OAuth2Button/> + + <h3>Available forms</h3> + + <FormListing title="Ban Appeals" description="Appealing bans from the Discord server" open={true}/> + <FormListing title="Insights 2020" description="Insights about the Python Discord community" open={false}/> + </div> + </div> +} + +export default LandingPage; |