Skip to content

Commit 11787ba

Browse files
committed
Add debug page for testing
1 parent 7039615 commit 11787ba

3 files changed

Lines changed: 113 additions & 15 deletions

File tree

frontend/src/lib/components/Footer.svelte

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@
1717
nextAction, previousAction
1818
}: NavigationState = $derived(app.navigation);
1919
20-
$effect(() => {
21-
// eslint-disable-next-line no-console
22-
console.log({
23-
next,
24-
previous,
25-
nextLabel,
26-
previousLabel,
27-
canGoNext,
28-
canGoPrevious,
29-
nextAction,
30-
previousAction
31-
});
32-
});
33-
3420
3521
const nextDisabled: boolean = $derived.by(() => {
3622
if (!canGoNext) return true;

frontend/src/routes/+layout.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
export const ssr = false;
1+
import {dev} from "$app/environment";
2+
import {goto} from "$app/navigation";
3+
4+
export const ssr = false;
5+
6+
if (dev) {
7+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8+
(window as any).goto = goto;
9+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<script lang="ts">
2+
import Page from "$lib/components/Page.svelte";
3+
import ProgressBar from "$lib/components/ProgressBar.svelte";
4+
import Spinner from "$lib/components/Spinner.svelte";
5+
import {WindowCenter, WindowSetSize} from "@wails/runtime";
6+
import {onMount} from "svelte";
7+
8+
onMount(() => {
9+
WindowSetSize(1100, 700);
10+
setTimeout(() => WindowCenter(), 100);
11+
});
12+
13+
let progress = $state(0);
14+
let status = $state("default");
15+
16+
function getRndInteger(min: number, max: number) {
17+
return Math.floor(Math.random() * (max - min)) + min;
18+
}
19+
20+
function animate() {
21+
setTimeout(() => {progress = 10;}, 200);
22+
setTimeout(() => {progress = 25;}, 500);
23+
setTimeout(() => {progress = 50;}, 1300);
24+
setTimeout(() => {status = "error";}, 2300);
25+
setTimeout(() => {status = "default";}, 3800);
26+
setTimeout(() => {progress = 75;}, 4300);
27+
setTimeout(() => {progress = 100;}, 4800);
28+
setTimeout(() => {status = "success";}, 5000);
29+
}
30+
31+
function animate2() {
32+
const states = ["error", "default", "success"];
33+
setTimeout(() => {progress = getRndInteger(0, 100);}, 200);
34+
setTimeout(() => {progress = getRndInteger(0, 100);}, 500);
35+
setTimeout(() => {progress = getRndInteger(0, 100);}, 1300);
36+
setTimeout(() => {status = states[getRndInteger(0, 2)];}, 2300);
37+
setTimeout(() => {status = states[getRndInteger(0, 2)];}, 3800);
38+
setTimeout(() => {progress = getRndInteger(0, 100);}, 4300);
39+
setTimeout(() => {progress = getRndInteger(0, 100);}, 4400);
40+
setTimeout(() => {status = "";}, 3975);
41+
}
42+
43+
animate();
44+
setTimeout(() => animate2(), 8000);
45+
</script>
46+
47+
48+
<Page title="Progress Bars">
49+
{#snippet icon()}
50+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
51+
<path d="M13 6.25a1 1 0 1 1-2 0a1 1 0 0 1 2 0z" />
52+
<path d="M13.032 2.325a1.75 1.75 0 0 0-2.064 0L3.547 7.74c-.978.713-.473 2.26.736 2.26H4.5v5.8A2.75 2.75 0 0 0 3 18.25v1.5c0 .413.336.75.75.75h16.5a.75.75 0 0 0 .75-.75v-1.5a2.75 2.75 0 0 0-1.5-2.45V10h.217c1.21 0 1.713-1.547.736-2.26l-7.421-5.416zm-1.18 1.211a.25.25 0 0 1 .295 0L18.95 8.5H5.05l6.803-4.964zM18 10v5.5h-2V10h2zm-3.5 0v5.5h-1.75V10h1.75zm-3.25 0v5.5H9.5V10h1.75zm-5.5 7h12.5c.69 0 1.25.56 1.25 1.25V19h-15v-.75c0-.69.56-1.25 1.25-1.25zM6 15.5V10h2v5.5H6z" />
53+
</svg>
54+
{/snippet}
55+
56+
<div class="container">
57+
<ProgressBar class={status} indeterminate={true} />
58+
<br class="gap" />
59+
<ProgressBar class="" indeterminate={true} />
60+
<br class="gap" />
61+
<ProgressBar class="success" indeterminate={true} />
62+
<br class="gap" />
63+
<ProgressBar class="error" indeterminate={true} />
64+
65+
<br class="gap" /><br class="gap" />
66+
<Spinner />
67+
<br class="gap" /><br class="gap" />
68+
69+
<ProgressBar value={progress} class={status} indeterminate={status === ""} />
70+
<br class="gap" />
71+
<ProgressBar value={progress} class="" indeterminate={status === ""} />
72+
<br class="gap" />
73+
<ProgressBar value={progress} class="success" indeterminate={status === ""} />
74+
<br class="gap" />
75+
<ProgressBar value={progress} class="error" indeterminate={status === ""} />
76+
77+
<br class="gap" /><br class="gap" />
78+
<Spinner />
79+
<br class="gap" /><br class="gap" />
80+
81+
<ProgressBar value={100 - progress} class={status} indeterminate={status === ""} />
82+
<br class="gap" />
83+
<ProgressBar value={100 - progress} class="" indeterminate={status === ""} />
84+
<br class="gap" />
85+
<ProgressBar value={100 - progress} class="success" indeterminate={status === ""} />
86+
<br class="gap" />
87+
<ProgressBar value={100 - progress} class="error" indeterminate={status === ""} />
88+
</div>
89+
</Page>
90+
91+
92+
<style>
93+
.gap {
94+
margin-bottom: 50px;
95+
}
96+
97+
.container {
98+
display: flex;
99+
flex-direction: column;
100+
justify-content: center;
101+
align-items: center;
102+
height: 100%;
103+
}
104+
</style>

0 commit comments

Comments
 (0)