Skip to content

Commit e60b4a4

Browse files
committed
Added spinner for delayed.
1 parent 7208e66 commit e60b4a4

File tree

1 file changed

+62
-5
lines changed

1 file changed

+62
-5
lines changed

src/routes/tests/redirect-same-route/+page.svelte

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77
88
let shouldCancel = false;
99
10-
const { form, errors, tainted, message, enhance, submitting } = superForm(
11-
data.form,
12-
{
10+
const { form, errors, tainted, message, enhance, submitting, delayed } =
11+
superForm(data.form, {
1312
onSubmit({ cancel }) {
1413
if (shouldCancel) cancel();
1514
}
16-
}
17-
);
15+
});
1816
</script>
1917

2018
<SuperDebug data={{ $form, $errors, $tainted }} />
@@ -53,6 +51,65 @@
5351
/></svg
5452
>
5553
{/if}
54+
{#if $delayed}
55+
<svg
56+
width="24"
57+
height="24"
58+
viewBox="0 0 24 24"
59+
xmlns="http://www.w3.org/2000/svg"
60+
><style>
61+
.spinner_nOfF {
62+
animation: spinner_qtyZ 2s cubic-bezier(0.36, 0.6, 0.31, 1)
63+
infinite;
64+
}
65+
.spinner_fVhf {
66+
animation-delay: -0.5s;
67+
}
68+
.spinner_piVe {
69+
animation-delay: -1s;
70+
}
71+
.spinner_MSNs {
72+
animation-delay: -1.5s;
73+
}
74+
@keyframes spinner_qtyZ {
75+
0% {
76+
r: 0;
77+
}
78+
25% {
79+
r: 3px;
80+
cx: 4px;
81+
}
82+
50% {
83+
r: 3px;
84+
cx: 12px;
85+
}
86+
75% {
87+
r: 3px;
88+
cx: 20px;
89+
}
90+
100% {
91+
r: 0;
92+
cx: 20px;
93+
}
94+
}
95+
</style><circle class="spinner_nOfF" cx="4" cy="12" r="3" /><circle
96+
class="spinner_nOfF spinner_fVhf"
97+
cx="4"
98+
cy="12"
99+
r="3"
100+
/><circle
101+
class="spinner_nOfF spinner_piVe"
102+
cx="4"
103+
cy="12"
104+
r="3"
105+
/><circle
106+
class="spinner_nOfF spinner_MSNs"
107+
cx="4"
108+
cy="12"
109+
r="3"
110+
/></svg
111+
>
112+
{/if}
56113
</div>
57114
<input type="checkbox" bind:checked={shouldCancel} /> Cancel submit
58115
</form>

0 commit comments

Comments
 (0)