Skip to content

Commit 17441bf

Browse files
committed
feat: ⚡ Add HTML spinner while loading frontend
1 parent 0ddc904 commit 17441bf

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

app/spa-loading-template.html

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<div class="loader-container">
2+
<div class="loader-spinner-container">
3+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
4+
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
5+
stroke-linejoin="round" class="lucide lucide-loader-icon loader-spinner">
6+
<path d="M12 2v4"></path>
7+
<path d="m16.2 7.8 2.9-2.9"></path>
8+
<path d="M18 12h4"></path>
9+
<path d="m16.2 16.2 2.9 2.9"></path>
10+
<path d="M12 18v4"></path>
11+
<path d="m4.9 19.1 2.9-2.9"></path>
12+
<path d="M2 12h4"></path>
13+
<path d="m4.9 4.9 2.9 2.9"></path>
14+
</svg>
15+
</div>
16+
</div>
17+
18+
<style>
19+
.loader-container {
20+
display: flex;
21+
justify-content: center;
22+
align-items: center;
23+
height: 100dvh;
24+
width: 100dvw;
25+
padding: 1.5rem;
26+
}
27+
28+
.loader-spinner-container {
29+
display: flex;
30+
flex-direction: column;
31+
justify-content: center;
32+
align-items: center;
33+
gap: 1rem;
34+
}
35+
36+
@keyframes spin {
37+
to {
38+
transform: rotate(360deg);
39+
}
40+
}
41+
42+
.loader-spinner {
43+
animation: spin 1s linear infinite;
44+
width: 2rem;
45+
height: 2rem;
46+
}
47+
</style>

pages/loader.vue

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<template>
2+
<div class="p-6 flex items-center justify-center h-dvh w-dvw">
3+
<div class="flex flex-col items-center justify-center gap-4">
4+
<Loader class="animate-spin size-8" />
5+
<!-- <p class="text-xl font-semibold tracking-tight">Versia Frontend</p> -->
6+
</div>
7+
</div>
8+
</template>
9+
10+
<script lang="ts" setup>
11+
import { Loader } from "lucide-vue-next";
12+
</script>

0 commit comments

Comments
 (0)