diff --git a/src/components/Graphs.svelte b/src/components/Graphs.svelte new file mode 100644 index 0000000..f78b551 --- /dev/null +++ b/src/components/Graphs.svelte @@ -0,0 +1,66 @@ + + +
+ {#await graphsPromise} + +

Fetching profiles...

+
+ {:then graphs} + {#each graphs as graph} + +

{graph.data.name} #{graph.graph}

+

+ Value: + {#each graph.data.value as key} + {key} + {/each} +

+
+ {/each} + + + {:catch error} + +

{error.message}

+
+ {/await} +
+ + diff --git a/src/components/Navbar.svelte b/src/components/Navbar.svelte new file mode 100644 index 0000000..30543e0 --- /dev/null +++ b/src/components/Navbar.svelte @@ -0,0 +1,79 @@ + + + + + diff --git a/src/components/stores.ts b/src/components/stores.ts new file mode 100644 index 0000000..f7b619c --- /dev/null +++ b/src/components/stores.ts @@ -0,0 +1,29 @@ +import { writable } from "svelte/store"; + +function createLogin() { + const { subscribe, set, update } = writable< + | { + username: string; + token: string; + } + | undefined + | null + >(undefined); + + return { + subscribe, + set, + update, + getValue: () => + new Promise(resolve => { + const unsubscribe = subscribe(value => { + if (value !== undefined) { + unsubscribe(); + resolve(value); + } + }); + }) + }; +} + +export const login = createLogin(); diff --git a/src/styles/Form.scss b/src/styles/Form.scss new file mode 100644 index 0000000..1ff3e43 --- /dev/null +++ b/src/styles/Form.scss @@ -0,0 +1,32 @@ +form { + padding: 1em; + background-color: hsl(236, 10%, 20%); + p#status { + color: red; + } +} +input { + width: calc(100% - 1.5em); + background: none; + padding: 0.75em; + margin-bottom: 1em; + font-size: 1.17em; + color: hsl(30, 20%, 90%); + border: 2px solid black; + border-right: 2px solid transparent; + border-left: 2px solid transparent; + &:focus, + &:focus-visible { + outline: none; + border-color: black; + } +} +input[type="submit"] { + margin: 0; + width: 100%; + border-color: black; + &:hover { + cursor: pointer; + background-color: hsl(236, 5%, 25%); + } +} diff --git a/src/styles/GridList.scss b/src/styles/GridList.scss new file mode 100644 index 0000000..c0c385c --- /dev/null +++ b/src/styles/GridList.scss @@ -0,0 +1,41 @@ +div#list { + display: grid; + width: 100%; + grid-template-columns: repeat(auto-fit, minmax(24em, 1fr)); + grid-auto-rows: 1fr; + grid-auto-flow: dense; + gap: 0.75em; +} +.item { + padding: 1em; + background-color: hsl(236, 10%, 20%); + overflow-y: auto; + &:hover { + transform: scale(98%); + z-index: inherit; + } + :nth-child(1) { + margin-top: 0; + } + :nth-last-child(1) { + margin-bottom: 0; + } +} +.add { + position: relative; + display: block; + &::before, + &::after { + content: ""; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: min(12em, 30%); + height: 0.3em; + background-color: hsl(30, 20%, 90%); + } + &::before { + transform: translate(-50%, -50%) rotateZ(90deg); + } +}