From 7e66e27163452d42c6f52149315ab88ac7a07fba Mon Sep 17 00:00:00 2001 From: a Date: Thu, 20 Aug 2020 22:54:14 +0200 Subject: [PATCH] Initial commit --- .eslintignore | 1 + src/frontend/common.scss | 18 +++++++ src/frontend/options/Flashcard.svelte | 62 ++++++++++++++++++++++++ src/frontend/options/Options.svelte | 70 +++++++++++++++++++++++++++ src/frontend/options/options.ts | 2 + 5 files changed, 153 insertions(+) create mode 100644 src/frontend/common.scss create mode 100644 src/frontend/options/Flashcard.svelte create mode 100644 src/frontend/options/Options.svelte create mode 100644 src/frontend/options/options.ts diff --git a/.eslintignore b/.eslintignore index b20d435..c96173f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ *.svelte +*.scss diff --git a/src/frontend/common.scss b/src/frontend/common.scss new file mode 100644 index 0000000..dfacd70 --- /dev/null +++ b/src/frontend/common.scss @@ -0,0 +1,18 @@ +@mixin button { + cursor: pointer; + color: var(--text-color-3); +} + +@mixin button_green { + background-color: var(--green-1); + &:hover { + background-color: var(--green-2); + } +} + +@mixin button_red { + background-color: var(--red-1); + &:hover { + background-color: var(--red-2); + } +} diff --git a/src/frontend/options/Flashcard.svelte b/src/frontend/options/Flashcard.svelte new file mode 100644 index 0000000..85c89e5 --- /dev/null +++ b/src/frontend/options/Flashcard.svelte @@ -0,0 +1,62 @@ + + +
+ {#await cardPromise then card} + {#if card} +
+

{card.src}

+

{card.result}

+
+
+ + +
+ {/if} + {/await} +
+ + diff --git a/src/frontend/options/Options.svelte b/src/frontend/options/Options.svelte new file mode 100644 index 0000000..989745d --- /dev/null +++ b/src/frontend/options/Options.svelte @@ -0,0 +1,70 @@ + + +
+
+ + + +
+
+ + diff --git a/src/frontend/options/options.ts b/src/frontend/options/options.ts new file mode 100644 index 0000000..bb65944 --- /dev/null +++ b/src/frontend/options/options.ts @@ -0,0 +1,2 @@ +import App from "./Options.svelte"; +new App({ target: document.body });