From b33439e75d4b22a0c68b5cb56851b518a5ea7db7 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 17 Apr 2021 10:30:24 +0200 Subject: started moving to css files --- pages/index.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'pages/index.tsx') diff --git a/pages/index.tsx b/pages/index.tsx index 354efc5..c1b912d 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -16,6 +16,8 @@ import VideogameAssetIcon from '@material-ui/icons/VideogameAsset'; import { mdiRobotExcited } from '@mdi/js'; import Icon from '@mdi/react'; +import styles from '../styles/index.module.css'; + var GameModeIconStyle: CSSProperties = { fontSize: 64, width: 64, @@ -43,13 +45,6 @@ var SquareSize: CSSProperties = { height: 90, }; -var LoginOrRegisterBoxStyle: CSSProperties = { - verticalAlign: 'top', - height: `calc(${SquareSize.height}px + 24px * 2)`, - width: '100%', - maxWidth: `calc(100% - ${SquareSize.width}px - 12px * 2 - 24px * 2)`, -}; - var InnerLoginOrRegisterBoxStyle: CSSProperties = { position: 'relative', width: '100%', @@ -198,7 +193,7 @@ export default function HomePage() { Tegen computer
} - + {loggedIn ? : } -- cgit v1.2.3 From dd77d6bb276f6a70b36f69d11cde7f5c8995f5e1 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 17 Apr 2021 17:24:59 +0200 Subject: home page without inline react styles :tada: --- components/recentGames.tsx | 20 +++---- components/ui.tsx | 21 +------ pages/_app.tsx | 2 + pages/index.tsx | 144 +++++++++------------------------------------ styles/global.css | 13 ++-- styles/index.css | 72 +++++++++++++++++++++++ styles/index.module.css | 7 --- styles/ui.css | 12 ++++ styles/utility.css | 27 ++++++++- 9 files changed, 161 insertions(+), 157 deletions(-) create mode 100644 styles/index.css delete mode 100644 styles/index.module.css (limited to 'pages/index.tsx') diff --git a/components/recentGames.tsx b/components/recentGames.tsx index 988126f..65c819a 100644 --- a/components/recentGames.tsx +++ b/components/recentGames.tsx @@ -28,18 +28,14 @@ function GameOutcome(props: { game: gameInfo; }) { }, }[props.game.status](); })(); - var outcome = props.game.outcome; - return - {gameStatus} + return + + {gameStatus} + ; } diff --git a/components/ui.tsx b/components/ui.tsx index 99479a8..db858a4 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -30,6 +30,7 @@ export function Button(props: { children?: ReactNode; style?: CSSProperties; href?: string; + className?: string; onclick?: (() => void); id?: string; }) { @@ -37,26 +38,10 @@ export function Button(props: { onClick={props.onclick} href={props.href} id={props.id} - style={{ - padding: props.text ? 8 : 16, - textAlign: props.text ? 'center' : 'left', - borderRadius: 8, - backgroundColor: 'var(--disk-a)', - cursor: 'pointer', - position: 'relative', - textDecoration: 'none', - display: 'block', - userSelect: 'none', - ...props.style, - }} + className={"button pad-s round-t " + props.className} > {props.text - ? + ? {props.text} : undefined} diff --git a/pages/_app.tsx b/pages/_app.tsx index bf9a280..46aa8d0 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -11,6 +11,8 @@ import '../styles/utility.css'; import '../styles/ui.css'; import '../styles/navbar.css'; +import '../styles/index.css'; + export default function VierOpEenRijWebsite({ Component, pageProps }) { return
diff --git a/pages/index.tsx b/pages/index.tsx index c1b912d..c3fe955 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,5 +1,5 @@ import axios from 'axios'; -import { CSSProperties, useContext, useEffect, useState } from 'react'; +import { useContext, useEffect, useState } from 'react'; import { userGames, userGameTotals, userInfo } from '../api/api'; import { Footer } from '../components/footer'; import { SocketContext } from '../components/socketContext'; @@ -16,72 +16,14 @@ import VideogameAssetIcon from '@material-ui/icons/VideogameAsset'; import { mdiRobotExcited } from '@mdi/js'; import Icon from '@mdi/react'; -import styles from '../styles/index.module.css'; - -var GameModeIconStyle: CSSProperties = { - fontSize: 64, - width: 64, - height: 64, - display: 'inline-block', - position: 'absolute', - top: 24, - left: '50%', - transform: 'translateX(-50%)', -}; - -var GameModeTextStyle: CSSProperties = { - whiteSpace: 'nowrap', - display: 'inline-block', - position: 'absolute', - bottom: 24, - left: '50%', - transform: 'translateX(-50%)', - userSelect: 'none', - fontWeight: 500, -}; - -var SquareSize: CSSProperties = { - width: 90, - height: 90, -}; - -var InnerLoginOrRegisterBoxStyle: CSSProperties = { - position: 'relative', - width: '100%', - height: '100%', -}; - function LoginOrRegisterBox() { - return
- - Log in of maak een account aan om je scores op te slaan en toegang te krijgen tot meer functies + return
+ + Log in of maak een account aan om toegang tot meer functies te krijgen -
-
; } @@ -90,44 +32,19 @@ function AccountBox(props: { info: userInfo; sumGameInfo: userGameTotals; }) { - return
-
+ return
+
-
-

- {props.info?.username} -

-

Score: {props.info?.rating}

-

- {props.sumGameInfo?.win} W - / - {props.sumGameInfo?.lose} V - / - {props.sumGameInfo?.draw} G +

+

{props.info?.username}

+

Score: {props.info?.rating}

+

+ {props.sumGameInfo?.win} W + / + {props.sumGameInfo?.lose} V + / + {props.sumGameInfo?.draw} G

; @@ -175,25 +92,22 @@ export default function HomePage() { 4 op een rij -
- - - Nieuw spel -
+
+ + + Nieuw spel {false - && - - Puzzels -
+ && + + Puzzels } {false - && - - Tegen computer -
+ && + + Tegen computer } - + {loggedIn ? : } diff --git a/styles/global.css b/styles/global.css index 350a2a7..3c28cfc 100644 --- a/styles/global.css +++ b/styles/global.css @@ -1,5 +1,5 @@ :root { - --background: #E3E6EE; + --background: var(--gray-900); --foreground: var(--gray-100); --accent: #7E3AA6; @@ -14,9 +14,10 @@ --gray-100: #141619; --gray-200: #1F242D; --gray-300: #293140; - --gray-700: #757D92; - --gray-800: #A9AFC0; - --gray-900: #CED2DC; + --gray-600: #757D92; + --gray-700: #A9AFC0; + --gray-800: #CED2DC; + --gray-900: #E3E6EE; /* box-shadow */ --drop-level-2: 0px 8px 32px 0px rgba(0, 0, 0, 0.3); @@ -150,3 +151,7 @@ input.light::placeholder { color: var(--text-alt); } border-width: 2px; } +.outcome.win { color: var(--disk-a-alt); } +.outcome.lose { color: var(--disk-b-alt); } +.outcome.draw { color: var(--gray-600); } + diff --git a/styles/index.css b/styles/index.css new file mode 100644 index 0000000..8ba12a6 --- /dev/null +++ b/styles/index.css @@ -0,0 +1,72 @@ +.topbar * { + --squareSize: 90px; +} + +.loginOrRegisterBox { + vertical-align: top; + height: calc(var(--squareSize) + 2 * var(--spacing-large)); + width: 100%; + max-width: calc(100% - var(--squareSize) - var(--spacing-medium) * 2 - var(--spacing-large) * 2); +} + +.loginOrRegisterBox .inner { + position: relative; + width: 100%; + height: 100%; +} + +.loginOrRegisterBox .inner .registerMessage { + user-select: none; + display: inline-block; + margin: 0 auto; + min-width: 240px; + max-width: 350px; + text-align: center; +} + +.loginOrRegisterBox .inner .button.register { + background-color: var(--gray-700); + color: var(--foreground); +} + +.gamemode .icon { + font-size: 64px; + font-size: 64px; + height: 64px; + display: inline-block; + position: absolute; + top: var(--spacing-large); + left: 50%; + transform: translateX(-50%); +} + +.gamemode .text { + white-space: nowrap; + display: inline-block; + position: absolute; + bottom: var(--spacing-large); + left: 50%; + transform: translateX(-50%); + user-select: none; + font-weight: 500; +} + +.topbar .gamemode { + --size: calc(var(--squareSize) + 2 * var(--spacing-large)); + width: var(--size); + height: var(--size); +} + +.topbar .profile .info { + left: calc(90px + 12px); + width: calc(100% - 90px - 12px); + height: 100%; +} + +.topbar .profile .info .username { max-width: 178px; } +.topbar .profile .info .score { margin-top: var(--spacing-small); } + +.topbar .profile .info .games .divider { + margin: 0 3px; +} + diff --git a/styles/index.module.css b/styles/index.module.css deleted file mode 100644 index 9b518ea..0000000 --- a/styles/index.module.css +++ /dev/null @@ -1,7 +0,0 @@ -.loginOrRegisterBox { - --squareSize: 90px; - vertical-align: top; - height: calc(var(--squareSize) + 2 * var(--spacing-large)); - width: 100%; - max-width: calc(100% - var(--squareSize) - var(--spacing-medium) * 2 - var(--spacing-large) * 2); -} diff --git a/styles/ui.css b/styles/ui.css index d665044..f1d65e2 100644 --- a/styles/ui.css +++ b/styles/ui.css @@ -7,3 +7,15 @@ .fullwidth { width: calc(100% - var(--spacing-medium)); } +.button { + background-color: var(--accent); + color: var(--gray-900); + text-align: center; + cursor: pointer; + position: relative; + text-decoration: none; + display: block; + user-select: none; + font-weight: 600; +} + diff --git a/styles/utility.css b/styles/utility.css index 753b88d..4331d3a 100644 --- a/styles/utility.css +++ b/styles/utility.css @@ -15,13 +15,38 @@ .bg-800 { background-color: var(--gray-800); } .bg-900 { background-color: var(--gray-900); } +.posabs { position: absolute; } +.posrel { position: relative; } + +.t0 { top: 0; } +.b0 { bottom: 0; } +.r0 { right: 0; } +.l0 { left: 0; } + +.h0 { left: 0; right: 0; } +.v0 { top: 0; bottom: 0; } + +.a0 { top: 0; bottom: 0; left: 0; right: 0; } + .subtile { color: var(--gray-300); font-style: italic; } -/* no-select */ .nosel { user-select: none; font-weight: 600; } + +.sidebyside { + display: grid; + grid-gap: var(--spacing-medium); + grid-auto-flow: column; +} + +.truncate { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + -- cgit v1.2.3 From 59459df904674bc3eaa95f4203113793c7c7fc9a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 17 Apr 2021 17:25:11 +0200 Subject: dprint fmt --- components/logo.tsx | 1 - components/navbar.tsx | 22 +++++++++---------- components/recentGames.tsx | 12 ++++++----- components/ui.tsx | 6 ++++-- pages/_app.tsx | 4 ++-- pages/index.tsx | 54 +++++++++++++++++++++++----------------------- 6 files changed, 51 insertions(+), 48 deletions(-) (limited to 'pages/index.tsx') diff --git a/components/logo.tsx b/components/logo.tsx index 9faf43f..df35370 100644 --- a/components/logo.tsx +++ b/components/logo.tsx @@ -11,4 +11,3 @@ export default function Logo() {
); } - diff --git a/components/navbar.tsx b/components/navbar.tsx index 932669d..7f6e694 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -55,7 +55,7 @@ export function NavBar() { }, []); return
-
+
- + - + - {false && + {false && } - + -
+
{loggedIn && diff --git a/components/recentGames.tsx b/components/recentGames.tsx index 65c819a..d619eeb 100644 --- a/components/recentGames.tsx +++ b/components/recentGames.tsx @@ -29,11 +29,13 @@ function GameOutcome(props: { game: gameInfo; }) { }[props.game.status](); })(); return - + {gameStatus} ; diff --git a/components/ui.tsx b/components/ui.tsx index db858a4..e2d19ad 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -17,7 +17,9 @@ export function Vierkant(props: { }) { return @@ -38,7 +40,7 @@ export function Button(props: { onClick={props.onclick} href={props.href} id={props.id} - className={"button pad-s round-t " + props.className} + className={'button pad-s round-t ' + props.className} > {props.text ? diff --git a/pages/_app.tsx b/pages/_app.tsx index 46aa8d0..290e687 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -7,9 +7,9 @@ import '../styles/dark.css'; import '../styles/disk.css'; import '../styles/footer.css'; import '../styles/global.css'; -import '../styles/utility.css'; -import '../styles/ui.css'; import '../styles/navbar.css'; +import '../styles/ui.css'; +import '../styles/utility.css'; import '../styles/index.css'; diff --git a/pages/index.tsx b/pages/index.tsx index c3fe955..3d9da21 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -17,13 +17,13 @@ import { mdiRobotExcited } from '@mdi/js'; import Icon from '@mdi/react'; function LoginOrRegisterBox() { - return
- + return
+ Log in of maak een account aan om toegang tot meer functies te krijgen -
-
; } @@ -32,19 +32,19 @@ function AccountBox(props: { info: userInfo; sumGameInfo: userGameTotals; }) { - return
-
+ return
+
-
-

{props.info?.username}

-

Score: {props.info?.rating}

-

- {props.sumGameInfo?.win} W - / - {props.sumGameInfo?.lose} V - / - {props.sumGameInfo?.draw} G +

+

{props.info?.username}

+

Score: {props.info?.rating}

+

+ {props.sumGameInfo?.win} W + / + {props.sumGameInfo?.lose} V + / + {props.sumGameInfo?.draw} G

; @@ -92,22 +92,22 @@ export default function HomePage() { 4 op een rij -
- - - Nieuw spel +
+ + + Nieuw spel {false - && - - Puzzels + && + + Puzzels } {false - && - - Tegen computer + && + + Tegen computer } - + {loggedIn ? : } -- cgit v1.2.3 From 18652c6ff5e10208298bea67ffce6b4ed327c97d Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 18 Apr 2021 11:30:10 +0200 Subject: search page without inline css --- components/ui.tsx | 19 +++--------------- pages/_app.tsx | 1 + pages/index.tsx | 6 +++--- pages/search.tsx | 56 +++++++++++------------------------------------------- styles/global.css | 18 ++++++++++-------- styles/search.css | 12 ++++++++++++ styles/utility.css | 11 ++++++++++- 7 files changed, 50 insertions(+), 73 deletions(-) create mode 100644 styles/search.css (limited to 'pages/index.tsx') diff --git a/components/ui.tsx b/components/ui.tsx index e2d19ad..60b80f4 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -12,14 +12,11 @@ export function Vierkant(props: { children?: ReactNode; className?: string; id?: string; - fullwidth?: boolean; onclick?: () => void; }) { return @@ -98,6 +95,7 @@ export function Input(props: { dark?: boolean; autocomplete?: string; autofocus?: boolean; + className?: string; }) { return ; } diff --git a/pages/_app.tsx b/pages/_app.tsx index 290e687..3f66711 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -12,6 +12,7 @@ import '../styles/ui.css'; import '../styles/utility.css'; import '../styles/index.css'; +import '../styles/search.css'; export default function VierOpEenRijWebsite({ Component, pageProps }) { return
diff --git a/pages/index.tsx b/pages/index.tsx index 3d9da21..b5f4b50 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -107,17 +107,17 @@ export default function HomePage() { Tegen computer } - + {loggedIn ? : }
{loggedIn - && + && } - +

Nieuws ofzo

Chess.com heeft heel veel troep waar niemand naar kijkt

diff --git a/pages/search.tsx b/pages/search.tsx index 2b8668a..90f1f67 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -24,32 +24,21 @@ function search(callback: (results: Array) => void) { } function SearchResults(props: { userList: Array; }) { - return
+ return
{props.userList?.map(user => )}
; } function SearchResult(props: { user: userInfo; }) { return -
+
-
- {props.user.username} -

{props.user.status}

+
+ {props.user.username} +

{props.user.status}

; @@ -58,40 +47,22 @@ function SearchResult(props: { user: userInfo; }) { function SearchBar(props: { searchFunction: (event?: FormEvent) => void; }) { - return + return
- +
; } @@ -112,12 +83,7 @@ export default function HomePage() { {searched && results.length == 0 &&

Geen zoekresultaten gevonden

} diff --git a/styles/global.css b/styles/global.css index 3c28cfc..b6ed028 100644 --- a/styles/global.css +++ b/styles/global.css @@ -116,14 +116,20 @@ h1, h2, h3, p, b, i, span, td, th { table { table-layout: fixed; } /* table styles */ -td, th { - padding: 4px; - font-size: 15px; +td, th { padding: 4px; } + +input { + color: var(--foreground); + background-color: transparent; + font-family: inherit; + border: 0; + font-size: 1rem; /* why? */ } input::placeholder { font-style: italic; - opacity: .8; + opacity: 1; + color: var(--gray-600); } /* remove chrome's ugly :focus outline */ @@ -135,10 +141,6 @@ input::placeholder { /* material-ui default state */ svg.MuiSvgIcon-root { transition: none !important; } -input::placeholder { opacity: .75; } -input.dark::placeholder { color: var(--text); } -input.light::placeholder { color: var(--text-alt); } - /* editable field status */ *[contenteditable] { border-color: var(--background-alt); } *[contenteditable="true"]:focus { border-color: var(--disk-a); } diff --git a/styles/search.css b/styles/search.css new file mode 100644 index 0000000..06a3918 --- /dev/null +++ b/styles/search.css @@ -0,0 +1,12 @@ +.searchBar input { + width: calc(100% - 2 * var(--spacing-medium) - 48px); + margin: 2px 0; +} + +.results .result .inner .userInfo { + left: calc(48px + var(--spacing-medium)); +} + +h1.noresults { + margin: 24px 32px; +} diff --git a/styles/utility.css b/styles/utility.css index 4331d3a..783b168 100644 --- a/styles/utility.css +++ b/styles/utility.css @@ -28,8 +28,17 @@ .a0 { top: 0; bottom: 0; left: 0; right: 0; } +.dispnone { display: none; } +.dispinbl { display: inline-block; } +.dispbl { display: block; } + +.valigntop { vertical-align: top; } +.valignsup { vertical-align: super; } + +.center { text-align: center; } + .subtile { - color: var(--gray-300); + color: var(--gray-600); font-style: italic; } -- cgit v1.2.3 From 5d964348d6b7af2b17d9838b1fe8b78d76a68cbc Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 18 Apr 2021 11:30:28 +0200 Subject: dprint fmt --- components/ui.tsx | 2 +- pages/index.tsx | 4 ++-- pages/search.tsx | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'pages/index.tsx') diff --git a/components/ui.tsx b/components/ui.tsx index 60b80f4..89e8ffe 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -105,7 +105,7 @@ export function Input(props: { placeholder={props.label} spellCheck={false} defaultValue={props.value ? String(props.value) : ''} - className={"input" + " " + (props.dark ? 'dark' : 'light') + " " + props.className} + className={'input' + ' ' + (props.dark ? 'dark' : 'light') + ' ' + props.className} autoComplete={props.autocomplete} autoFocus={props.autofocus} />; diff --git a/pages/index.tsx b/pages/index.tsx index b5f4b50..9f63229 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -114,10 +114,10 @@ export default function HomePage() {
{loggedIn - && + && } - +

Nieuws ofzo

Chess.com heeft heel veel troep waar niemand naar kijkt

diff --git a/pages/search.tsx b/pages/search.tsx index 90f1f67..6e52865 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -24,21 +24,21 @@ function search(callback: (results: Array) => void) { } function SearchResults(props: { userList: Array; }) { - return
+ return
{props.userList?.map(user => )}
; } function SearchResult(props: { user: userInfo; }) { return -
+
-
- {props.user.username} -

{props.user.status}

+
+ {props.user.username} +

{props.user.status}

; @@ -47,22 +47,22 @@ function SearchResult(props: { user: userInfo; }) { function SearchBar(props: { searchFunction: (event?: FormEvent) => void; }) { - return + return
- +
; } @@ -83,7 +83,7 @@ export default function HomePage() { {searched && results.length == 0 &&

Geen zoekresultaten gevonden

} -- cgit v1.2.3 From 2527a6a2e0a9e679cb5a19abb56ad6a363cf980d Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 18 Apr 2021 13:42:44 +0200 Subject: settings page / balloon+tuitje without inline css done --- components/ui.tsx | 131 ++++++++++------------------------------------------ pages/_app.tsx | 1 + pages/index.tsx | 2 +- pages/settings.tsx | 63 +++++++++---------------- styles/index.css | 1 - styles/settings.css | 8 ++++ styles/ui.css | 46 ++++++++++++++++++ styles/utility.css | 2 + 8 files changed, 105 insertions(+), 149 deletions(-) create mode 100644 styles/settings.css (limited to 'pages/index.tsx') diff --git a/components/ui.tsx b/components/ui.tsx index 89e8ffe..f939456 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -27,10 +27,9 @@ export function Vierkant(props: { export function Button(props: { text?: string; children?: ReactNode; - style?: CSSProperties; href?: string; className?: string; - onclick?: (() => void); + onclick?: () => void; id?: string; }) { return
void; - style?: CSSProperties; href?: string; + className?: string; }) { return ; @@ -186,110 +170,43 @@ export function CheckBox(props: {
; } -export class ColorPicker extends Component<{ - style?: CSSProperties; -}> { - state: { - color: string; - dark: boolean; - } = { - color: '#012345', - dark: true, - }; +export function ColorPicker() { + var [ dark, setDark ] = useState(false); + var [ color, setColor ] = useState("#012345"); - render() { - return ; - } +
+ ; } -export function Tuitje(props: { - style?: CSSProperties; - rotation?: number; -}) { +export function Tuitje() { return ; } export function Bubble(props: { children?: ReactNode; - style?: CSSProperties; - tuitjeStyle?: CSSProperties; }) { - return + return {props.children} - + ; } diff --git a/pages/_app.tsx b/pages/_app.tsx index 3f66711..bbdbae8 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -13,6 +13,7 @@ import '../styles/utility.css'; import '../styles/index.css'; import '../styles/search.css'; +import '../styles/settings.css'; export default function VierOpEenRijWebsite({ Component, pageProps }) { return
diff --git a/pages/index.tsx b/pages/index.tsx index 9f63229..31aee57 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -107,7 +107,7 @@ export default function HomePage() { Tegen computer } - + {loggedIn ? : } diff --git a/pages/settings.tsx b/pages/settings.tsx index 0f40a90..e9fc5fa 100644 --- a/pages/settings.tsx +++ b/pages/settings.tsx @@ -1,7 +1,6 @@ import axios from 'axios'; import reduce from 'image-blob-reduce'; -import { CSSProperties, useContext } from 'react'; -import * as cookies from 'react-cookies'; +import { useContext } from 'react'; import { AccountAvatar } from '../components/account'; import { Footer } from '../components/footer'; @@ -16,11 +15,6 @@ import ExitToAppOutlinedIcon from '@material-ui/icons/ExitToAppOutlined'; import PublishOutlinedIcon from '@material-ui/icons/PublishOutlined'; import VisibilityOutlinedIcon from '@material-ui/icons/VisibilityOutlined'; -var SettingsSubsectionStyle: CSSProperties = { - marginTop: 24, - minHeight: 40, -}; - async function uploadNewProfileImage() { if (!this.result) return; @@ -54,9 +48,9 @@ export default function SettingsPage() { Instellingen - +

Account

-
+
-
+
} /> -
+

Gebruikersnaam

Hier staat hij dan

-
+
} /> } /> -
+

Email

******@example.com

-
+
} /> -
+

Wachtwoord

- +

Kleuren

-
+
-
+

Schijfjes

-
+
-
+

Achtergrond

-
-
+
+
updatePreference({ 'darkMode': state })} @@ -123,31 +117,20 @@ export default function SettingsPage() {

Donkere modus

- +

Standaard spelregels

-
+
- +

Uitloggen

-
+
} text='Uitloggen' - style={{ - float: 'none', - marginLeft: 0, - }} - onclick={() => { - cookies.remove('token'); - window.location.pathname = '/'; - }} + href="/logout" />
diff --git a/styles/index.css b/styles/index.css index 8ba12a6..fcda8e0 100644 --- a/styles/index.css +++ b/styles/index.css @@ -3,7 +3,6 @@ } .loginOrRegisterBox { - vertical-align: top; height: calc(var(--squareSize) + 2 * var(--spacing-large)); width: 100%; max-width: calc(100% - var(--squareSize) - var(--spacing-medium) * 2 - var(--spacing-large) * 2); diff --git a/styles/settings.css b/styles/settings.css new file mode 100644 index 0000000..bcce5b5 --- /dev/null +++ b/styles/settings.css @@ -0,0 +1,8 @@ +.section.logout .button { + float: unset; +} + +.subsection { + margin-top: var(--spacing-large); + min-height: 40px; +} diff --git a/styles/ui.css b/styles/ui.css index f1d65e2..b8cd44c 100644 --- a/styles/ui.css +++ b/styles/ui.css @@ -19,3 +19,49 @@ font-weight: 600; } +.button.iconlabel, +.button.colorpicker { + margin-left: var(--spacing-medium); +} + +.button.colorpicker { + --color: var(--gray-100); + --background: #ff00ff; + + background-color: var(--background); + color: var(--color); + border-width: 2px; + border-style: solid; + border-color: var(--color); +} + +.button.iconlabel .label { + margin: 3px; + margin-left: 8px; +} + +.button.colorpicker .labelwrapper { + width: 150px; + height: 24px; +} + +.button.colorpicker .labelwrapper .label { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-feature-settings: "tnum", "ss01"; +} + +.bubble { + margin: 0; + overflow: visible; + left: 50%; + top: -24px; + transform: translateY(-100%) translateX(-50%); +} + +.bubble .tuitje { + bottom: -12px; + transform: translate(-50%, 0%) rotate(0deg); +} diff --git a/styles/utility.css b/styles/utility.css index 783b168..f8954cd 100644 --- a/styles/utility.css +++ b/styles/utility.css @@ -37,6 +37,8 @@ .center { text-align: center; } +.floatr { float: right; } + .subtile { color: var(--gray-600); font-style: italic; -- cgit v1.2.3 From 08ba9024f532554fe2135d2596f1169828b01e5f Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 19 Apr 2021 09:51:38 +0200 Subject: login/register pages done + fullwidth css class edited --- components/ui.tsx | 2 +- pages/_app.tsx | 1 + pages/index.tsx | 2 +- pages/login.tsx | 44 ++++++++++++++++---------------------------- pages/register.tsx | 38 +++++++++++++++++++------------------- pages/search.tsx | 4 ++-- pages/settings.tsx | 8 ++++---- styles/loginregister.css | 13 +++++++++++++ styles/ui.css | 2 -- styles/utility.css | 10 ++++++++++ 10 files changed, 67 insertions(+), 57 deletions(-) create mode 100644 styles/loginregister.css (limited to 'pages/index.tsx') diff --git a/components/ui.tsx b/components/ui.tsx index 6555813..9aa48cc 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -1,4 +1,4 @@ -import { Component, CSSProperties, ReactNode, useEffect, useState } from 'react'; +import { CSSProperties, ReactNode, useEffect, useState } from 'react'; import CheckBoxIcon from '@material-ui/icons/CheckBox'; import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank'; diff --git a/pages/_app.tsx b/pages/_app.tsx index 9521d58..7cdb8e3 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -13,6 +13,7 @@ import '../styles/utility.css'; import '../styles/gameSettings.css'; import '../styles/index.css'; +import '../styles/loginregister.css'; import '../styles/search.css'; import '../styles/settings.css'; diff --git a/pages/index.tsx b/pages/index.tsx index 31aee57..873cf8b 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -117,7 +117,7 @@ export default function HomePage() { && } - +

Nieuws ofzo

Chess.com heeft heel veel troep waar niemand naar kijkt

diff --git a/pages/login.tsx b/pages/login.tsx index 1e14573..9e26b50 100644 --- a/pages/login.tsx +++ b/pages/login.tsx @@ -49,44 +49,32 @@ export default function LoginPage() {
-
- +
+
submitLogin(e, toast)}> - - - -
+ className='pad-m fullwidth bg-900 round-t' + /> + +
- + className='register bg-700 fg-100' + /> +
- +
diff --git a/pages/register.tsx b/pages/register.tsx index f78d092..90dab3e 100644 --- a/pages/register.tsx +++ b/pages/register.tsx @@ -89,34 +89,34 @@ export default function RegisterPage() {
-
- +
+
submitRegister(e, toast)}> - - - + className='pad-m fullwidth bg-900 round-t' + /> + + - + /> +
diff --git a/pages/search.tsx b/pages/search.tsx index 6e52865..e874775 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -24,7 +24,7 @@ function search(callback: (results: Array) => void) { } function SearchResults(props: { userList: Array; }) { - return
+ return
{props.userList?.map(user => )}
; } @@ -47,7 +47,7 @@ function SearchResult(props: { user: userInfo; }) { function SearchBar(props: { searchFunction: (event?: FormEvent) => void; }) { - return + return
Instellingen - +

Account

@@ -92,7 +92,7 @@ export default function SettingsPage() {
- +

Kleuren

@@ -117,13 +117,13 @@ export default function SettingsPage() {

Donkere modus

- +

Standaard spelregels

- +

Uitloggen

Date: Tue, 20 Apr 2021 16:14:04 +0200 Subject: site not longer broken (i think) still some inline css remains.... --- components/dialogBox.tsx | 2 +- components/gameBar.tsx | 41 +++++++-------------------------------- components/ui.tsx | 2 +- components/voerBord.tsx | 50 +++++------------------------------------------- pages/game.tsx | 2 +- pages/index.tsx | 12 ++++++------ pages/login.tsx | 2 +- pages/register.tsx | 2 +- pages/search.tsx | 2 +- pages/settings.tsx | 8 ++++---- pages/user.tsx | 8 ++++---- styles/disk.css | 4 ++-- styles/game.css | 36 ++++++++++++++++++++++++++++++++++ styles/utility.css | 3 +++ 14 files changed, 73 insertions(+), 101 deletions(-) (limited to 'pages/index.tsx') diff --git a/components/dialogBox.tsx b/components/dialogBox.tsx index 4ead7c5..a5b02fa 100644 --- a/components/dialogBox.tsx +++ b/components/dialogBox.tsx @@ -12,7 +12,7 @@ export function DialogBox(props: { className?: string; }) { return

{props.title}

diff --git a/components/gameBar.tsx b/components/gameBar.tsx index 0d7d4d9..a3479d5 100644 --- a/components/gameBar.tsx +++ b/components/gameBar.tsx @@ -11,14 +11,7 @@ function GameBarModule(props: { onclick?: () => void; }) { return {props.children} @@ -37,33 +30,13 @@ export function GameBar(props: { active: boolean; resignFunction: () => void; }) { - return -
+ return +
-
-

+ {props.active &&
} +

{!props.active ? 'Wachten op tegenstander...' : props.turn == props.player1 diff --git a/components/ui.tsx b/components/ui.tsx index 80bfba1..11914c8 100644 --- a/components/ui.tsx +++ b/components/ui.tsx @@ -16,7 +16,7 @@ export function Vierkant(props: { }) { return diff --git a/components/voerBord.tsx b/components/voerBord.tsx index 93e350c..ffb291b 100644 --- a/components/voerBord.tsx +++ b/components/voerBord.tsx @@ -1,62 +1,22 @@ -function Disc() { - return
; -} - export function VoerBord(props: { width: number; height: number; onMove: (move: number) => void; active: boolean; }) { - return + return
{[...Array(props.height).keys()].map((row) => ( {[...Array(props.width).keys()].map((column) => (
+
+
- -
{ props.onMove(Number((event.target as HTMLElement).id.split('-')[1])); diff --git a/pages/game.tsx b/pages/game.tsx index d6d7fb0..9e702ed 100644 --- a/pages/game.tsx +++ b/pages/game.tsx @@ -1,7 +1,7 @@ import Icon from '@mdi/react'; import axios from 'axios'; import copy from 'copy-to-clipboard'; -import { CSSProperties, useContext, useEffect, useState } from 'react'; +import { useContext, useEffect, useState } from 'react'; import * as cookies from 'react-cookies'; import { Socket } from 'socket.io-client'; import { SocketContext } from '../components/socketContext'; diff --git a/pages/index.tsx b/pages/index.tsx index 873cf8b..c4b4baf 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -93,31 +93,31 @@ export default function HomePage() { 4 op een rij
- + Nieuw spel {false - && + && Puzzels } {false - && + && Tegen computer } - + {loggedIn ? : }
{loggedIn - && + && } - +

Nieuws ofzo

Chess.com heeft heel veel troep waar niemand naar kijkt

diff --git a/pages/login.tsx b/pages/login.tsx index 9e26b50..73fbb52 100644 --- a/pages/login.tsx +++ b/pages/login.tsx @@ -50,7 +50,7 @@ export default function LoginPage() {
- + submitLogin(e, toast)}>
- + submitRegister(e, toast)}> ) => void; }) { - return + return Instellingen - +

Account

@@ -92,7 +92,7 @@ export default function SettingsPage() {
- +

Kleuren

@@ -117,13 +117,13 @@ export default function SettingsPage() {

Donkere modus

- +

Standaard spelregels

- +

Uitloggen

Profiel - +
@@ -280,7 +280,7 @@ export default function AccountPage() {
- +
} @@ -312,7 +312,7 @@ export default function AccountPage() { } label='Nederland' />
- +
} @@ -340,7 +340,7 @@ export default function AccountPage() { />
- +
diff --git a/styles/disk.css b/styles/disk.css index d858335..2646fed 100644 --- a/styles/disk.css +++ b/styles/disk.css @@ -1,3 +1,3 @@ .voerBord .disk.state-0 { background-color: var(--page-background); } -.voerBord .disk.state-1 { background-color: var(--disk-a); } -.voerBord .disk.state-2 { background-color: var(--disk-b); } +.voerBord .disk.state-1 { background-color: var(--confirm); } +.voerBord .disk.state-2 { background-color: var(--error); } diff --git a/styles/game.css b/styles/game.css index ae8c3ff..de00b1c 100644 --- a/styles/game.css +++ b/styles/game.css @@ -32,3 +32,39 @@ margin-top: var(--spacing-large); } +.voerBord { + border-spacing: var(--spacing-small); +} + +.voerBord .cell.inner { + border: 2px solid var(--gray-800); +} + +.voerBord .square { + margin-top: 100%; +} + +.voerBord.active .cell.inner { + cursor: pointer; +} + +.voerBord .disk { + border-radius: 999999999px; + margin: 3px; +} + +.gameBar .gameBarButton { + margin: 0; +} + +.gameBar .move { + width: 32px; + height: 32px; + border-radius: 16px; + + margin: 8px; +} + +.gameBar .move.move-a { background-color: var(--error); } +.gameBar .move.move-b { background-color: var(--confirm); } + diff --git a/styles/utility.css b/styles/utility.css index d3c5897..0ff6b10 100644 --- a/styles/utility.css +++ b/styles/utility.css @@ -43,6 +43,9 @@ .valigntop { vertical-align: top; } .valignsup { vertical-align: super; } +.cpointer { cursor: pointer; } +.cdefault { cursor: default; } + .center { text-align: center; } .floatr { float: right; } -- cgit v1.2.3