diff --git a/client/src/App.tsx b/client/src/App.tsx index 467cdec..d6d63ad 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -7,9 +7,8 @@ import '@fontsource/roboto/400.css'; import '@fontsource/roboto/500.css'; import '@fontsource/roboto/700.css'; -import { AppBar, CssBaseline, Toolbar, Typography } from '@mui/material'; - -import { useAppSelector } from './hooks'; +import './reset.css'; +import './app.css'; type SetTitleType = {setTitle: (string) => void, setSubtitle: (string) => void} export const SetTitleContext = React.createContext({setTitle: () => {}, setSubtitle: () => {}}) @@ -19,18 +18,15 @@ function App() { const [subtitle, setSubtitle] = useState("") return ( -
- - theme.zIndex.drawer + 1 }}> - - +
+
+
{title} - - +
+
{subtitle} - - - +
+
diff --git a/client/src/app.css b/client/src/app.css new file mode 100644 index 0000000..45395ba --- /dev/null +++ b/client/src/app.css @@ -0,0 +1,61 @@ +/* variables */ + +:root { + --clr-primary: #1976d2; + --clr-code: rgba(0, 32, 90, 0.87); +} + + +/* General styling */ + +body { + font-family: Roboto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: Roboto Mono; + color: var(--clr-code); +} + + +/* Hide monaco editor notifications */ +.monaco-workbench > .notifications-toasts.visible { + display: none !important; +} + +.loading { + margin: auto; + vertical-align: middle; +} + + +/* App Bar */ + +.app { + display: flex; + flex-direction: column; +} + +.app-bar { + z-index: 1500; + flex: 0; + background: var(--clr-primary); + display: flex; + flex-direction: row; + justify-content: space-between; + padding: 1.1em; + filter: drop-shadow(0 0 5px rgba(0,0,0,0.5)) +} + +.app-bar-title, .app-bar-subtitle { + color: white; + font-weight: 500; + font-size: 1.3rem; +} + +.app-content { + flex: 1; + min-height: 1fr; +} diff --git a/client/src/components/Level.tsx b/client/src/components/Level.tsx index 42c1b38..468acd0 100644 --- a/client/src/components/Level.tsx +++ b/client/src/components/Level.tsx @@ -152,8 +152,8 @@ function Level() { }, [levelId, level?.data?.title]) return <> - - +
+
@@ -193,7 +193,7 @@ function Level() { {/* */} - +
} diff --git a/client/src/components/Welcome.tsx b/client/src/components/Welcome.tsx index 3406d95..981aae4 100644 --- a/client/src/components/Welcome.tsx +++ b/client/src/components/Welcome.tsx @@ -12,7 +12,7 @@ import { useSelector } from 'react-redux'; cytoscape.use( klay ); -import { Box, Typography, Button, CircularProgress, Grid, selectClasses } from '@mui/material'; +import { Box, Typography, CircularProgress } from '@mui/material'; import { useGetGameInfoQuery } from '../state/api'; import { Link } from 'react-router-dom'; import Markdown from './Markdown'; @@ -81,7 +81,7 @@ function Welcome() { { gameInfo.isLoading? : -
+
{gameInfo.data?.introduction} diff --git a/client/src/index.css b/client/src/index.css deleted file mode 100644 index f30339b..0000000 --- a/client/src/index.css +++ /dev/null @@ -1,31 +0,0 @@ -body { - margin: 0; - font-family: Roboto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: Roboto Mono; - color: rgba(0, 32, 90, 0.87); -} - -.App { - height: 100vh; - display: flex; - flex-direction: column; -} - -.AppBar { - flex: 0; -} - -/* Hide monaco editor notifications */ -.monaco-workbench > .notifications-toasts.visible { - display: none !important; -} - -/* TODO: Do this the correct way. */ -.MuiButtonBase-root { - margin : 0 !important; -} diff --git a/client/src/index.tsx b/client/src/index.tsx index 9013eb6..d13b276 100644 --- a/client/src/index.tsx +++ b/client/src/index.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { createRoot } from 'react-dom/client'; -import './index.css'; import App from './App'; import { ConnectionContext, connection } from './connection' import { store } from './state/store'; diff --git a/client/src/reset.css b/client/src/reset.css new file mode 100644 index 0000000..cbaa69c --- /dev/null +++ b/client/src/reset.css @@ -0,0 +1,59 @@ + +/* Reset, roughly following https://piccalil.li/blog/a-modern-css-reset/ */ + +/* Box sizing rules */ +*, +*::before, +*::after { + box-sizing: border-box; +} + +/* Remove default margin */ +* { + margin: 0; + padding: 0; + font: inherit; +} + +/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */ +ul[role='list'], +ol[role='list'] { + list-style: none; +} + +/* Set core body defaults */ +body { + min-height: 100vh; + text-rendering: optimizeSpeed; + line-height: 1.5; +} + +/* A elements that don't have a class get default styles */ +a:not([class]) { + text-decoration-skip-ink: auto; + text-decoration-style: dotted; + color: var(--clr-primary); +} + +/* Make images easier to work with */ +img, +picture { + max-width: 100%; + display: block; +} + +/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */ +@media (prefers-reduced-motion: reduce) { + html:focus-within { + scroll-behavior: auto; + } + + *, + *::before, + *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + scroll-behavior: auto !important; + } +}