diff --git a/src/components/menu.svelte b/src/components/menu.svelte index f371a2a..47fe004 100644 --- a/src/components/menu.svelte +++ b/src/components/menu.svelte @@ -59,8 +59,12 @@ Förkortningar F12 - - Förinskriven text + { + appState.open = 'statistics'; + }} + > + Statistik F12 diff --git a/src/components/statistics.svelte b/src/components/statistics.svelte new file mode 100644 index 0000000..d1d6f4e --- /dev/null +++ b/src/components/statistics.svelte @@ -0,0 +1,16 @@ + + + + + Statistik + ... + + +
    +
  • Missade förkortningar: 1337
  • +
  • Annan information: 5/7
  • +
+
+
diff --git a/src/lib/hotkey-actions.js b/src/lib/hotkey-actions.js index 75657db..04a78de 100644 --- a/src/lib/hotkey-actions.js +++ b/src/lib/hotkey-actions.js @@ -94,13 +94,24 @@ hotkeys.set("F11", { }) hotkeys.set("F12", { - name: "Öppna import-rutan", + name: "Visa statistik", action: (e) => { e.preventDefault() - console.log("Open import page") + console.log("Open statistics modal") + appState.open = "statistics" + } +}) + +/* +hotkeys.set("F12", { + name: "Visa dialogrutan för import", + action: (e) => { + e.preventDefault() + console.log("Open import") goto("/import") } }) +*/ hotkeys.set("Escape", { name: "Stäng aktiva dialogrutor och fokusera på texten", diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 09cd0de..d575859 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -5,6 +5,7 @@ import ListSelector from '../components/listselector.svelte'; import Dashboard from '../components/dashboard.svelte'; import Hotkeys from '../components/hotkeys.svelte'; + import Statistics from '../components/statistics.svelte'; import { db, deleteShortformList, type Shortform } from '../db/main'; import Menu from '../components/menu.svelte'; import { Button } from '$lib/components/ui/button'; @@ -38,7 +39,7 @@ import { hotkeys } from '$lib/hotkey-actions'; let textarea: HTMLTextAreaElement | undefined = $state(); onMount(() => { - appState.open = 'hotkeys'; + appState.open = 'statistics'; initHotkeys({ scope: 'main', filterInputs: false }); hotkeys.forEach((handler, key) => { @@ -87,6 +88,13 @@ {/if} + {#if appState.open == 'statistics'} +
+ +
+ {/if}