diff --git a/typescript/loopover-leaderboards/preact.config.js b/typescript/loopover-leaderboards/preact.config.js index 4fcde16..2dcf949 100644 --- a/typescript/loopover-leaderboards/preact.config.js +++ b/typescript/loopover-leaderboards/preact.config.js @@ -10,7 +10,8 @@ export default function(config, env, helpers) { banner: "// This file is automatically generated from your CSS. Any edits will be overwritten.", namedExport: true, - silent: true + silent: true, + modules: true }); }); diff --git a/typescript/loopover-leaderboards/src/global.css b/typescript/loopover-leaderboards/src/global.css index ddb6b2f..2306da0 100644 --- a/typescript/loopover-leaderboards/src/global.css +++ b/typescript/loopover-leaderboards/src/global.css @@ -1,4 +1,4 @@ -@import url("https://fonts.googleapis.com/css?family=Varela+Round&display=swap"); +@import url("https://fonts.googleapis.com/css?family=Roboto|Varela+Round&display=swap"); html, body { @@ -13,7 +13,12 @@ body { height: 100%; } +* { + font-family: var(--font); +} + :root { + --font: "Roboto", sans-serif; --title-font: "Varela Round", sans-serif; --max-width: 800px; --spacing: 2rem; diff --git a/typescript/loopover-leaderboards/src/global.css.d.ts b/typescript/loopover-leaderboards/src/global.css.d.ts new file mode 100644 index 0000000..53d4f03 --- /dev/null +++ b/typescript/loopover-leaderboards/src/global.css.d.ts @@ -0,0 +1,2 @@ +// This file is automatically generated from your CSS. Any edits will be overwritten. +export const app: string; diff --git a/typescript/loopover-leaderboards/src/modules/core/components/App.tsx b/typescript/loopover-leaderboards/src/modules/core/components/App.tsx index 844ccb1..fab9d41 100644 --- a/typescript/loopover-leaderboards/src/modules/core/components/App.tsx +++ b/typescript/loopover-leaderboards/src/modules/core/components/App.tsx @@ -1,7 +1,8 @@ import { h } from "preact"; import { Route, Router } from "preact-router"; - import { Home } from "./Home"; +import { Nav } from "./Nav"; +import { Layer, Stack } from "./Stack"; if ((module as any).hot) { // tslint:disable-next-line:no-var-requires @@ -11,9 +12,17 @@ if ((module as any).hot) { export const App: preact.FunctionalComponent = () => { return (
- - - + + + + + + + + +
); }; diff --git a/typescript/loopover-leaderboards/src/modules/core/components/Nav.css b/typescript/loopover-leaderboards/src/modules/core/components/Nav.css new file mode 100644 index 0000000..cbec52c --- /dev/null +++ b/typescript/loopover-leaderboards/src/modules/core/components/Nav.css @@ -0,0 +1,12 @@ +.link { + text-decoration: none; + color: white; + filter: brightness(0.8); + font-size: 1.6rem; + padding: 1.4rem; + font: "Roboto light"; +} + +.activeLink { + filter: brightness(1); +} diff --git a/typescript/loopover-leaderboards/src/modules/core/components/Nav.css.d.ts b/typescript/loopover-leaderboards/src/modules/core/components/Nav.css.d.ts new file mode 100644 index 0000000..c28f561 --- /dev/null +++ b/typescript/loopover-leaderboards/src/modules/core/components/Nav.css.d.ts @@ -0,0 +1,3 @@ +// This file is automatically generated from your CSS. Any edits will be overwritten. +export const link: string; +export const activeLink: string; diff --git a/typescript/loopover-leaderboards/src/modules/core/components/Nav.tsx b/typescript/loopover-leaderboards/src/modules/core/components/Nav.tsx new file mode 100644 index 0000000..ca95dfe --- /dev/null +++ b/typescript/loopover-leaderboards/src/modules/core/components/Nav.tsx @@ -0,0 +1,42 @@ +import { Block, Row } from "jsxstyle"; +import { h } from "preact"; +import { Link } from "preact-router/match"; +import styles from "./Nav.css"; + +interface Route { + url: string; + name: string; +} + +const routes: Route[] = [ + { + url: "/", + name: "Home" + }, + { + url: "/leaderboards", + name: "Leaderboards" + }, + { + url: "/play", + name: "Play" + } +]; + +export const Nav = () => { + return ( + + {routes.map(route => ( + // We cannot style this directly, so I'm using classes + + {route.name} + + ))} + + ); +};