summaryrefslogtreecommitdiffstats
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/*.tsx8
-rw-r--r--src/pages/index.module.css14
-rw-r--r--src/pages/index.tsx33
3 files changed, 55 insertions, 0 deletions
diff --git a/src/pages/*.tsx b/src/pages/*.tsx
new file mode 100644
index 0000000..a7021c6
--- /dev/null
+++ b/src/pages/*.tsx
@@ -0,0 +1,8 @@
+export default function NotFound() {
+ return (
+ <section>
+ <h1>404: Not Found</h1>
+ <p>It's gone 😞</p>
+ </section>
+ );
+}
diff --git a/src/pages/index.module.css b/src/pages/index.module.css
new file mode 100644
index 0000000..9d6167d
--- /dev/null
+++ b/src/pages/index.module.css
@@ -0,0 +1,14 @@
+.btns-cont {
+ --btn-gap: 0.3rem;
+ /* padding: var(--btn-gap); */
+ display: grid;
+ justify-items: center;
+ align-items: center;
+ gap: var(--btn-gap);
+ grid-template-columns: repeat(2, 1fr);
+}
+.timers-cont {
+ hr {
+ margin-top: 2em;
+ }
+}
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
new file mode 100644
index 0000000..d64f9e1
--- /dev/null
+++ b/src/pages/index.tsx
@@ -0,0 +1,33 @@
+import { For } from "solid-js";
+import { createAsync } from "@solidjs/router";
+
+import Button from "@/components/Button";
+import Timer from "@/components/Timer";
+import { getButtons, getTimers } from "@/helpers/api";
+import styles from "./index.module.css";
+
+export default function Home() {
+ const btns = createAsync(getButtons);
+ const timers = createAsync(getTimers);
+
+ return (
+ <>
+ <div
+ class={styles.btnsCont}
+ style={{ "--rows-count": Math.floor(btns()?.length / 2) }}
+ >
+ <For each={btns()}>{(btn) => <Button {...btn} />}</For>
+ </div>
+ <div class={styles.timersCont}>
+ <For each={timers()}>
+ {(timer) => (
+ <>
+ <hr />
+ <Timer {...timer} />
+ </>
+ )}
+ </For>
+ </div>
+ </>
+ );
+}