Skip to content

Commit 1a49024

Browse files
feat(loader): create UILoader component with animated dots
Steps: - Create `UILoader.vue` component to display a loading animation. - Implement animated dots using SCSS keyframes. - Extract `loaderDots` animation into `_animations-loader-dots.scss` for reusability.
1 parent aed1be0 commit 1a49024

File tree

4 files changed

+69
-3
lines changed

4 files changed

+69
-3
lines changed

src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,5 @@
118118
// ANIMATIONS
119119
// ----------------------------------------------------------------------
120120
@use "@/assets/scss/animations/animations-vue-transitions";
121+
@use "@/assets/scss/animations/animations-loader-dots";
121122
</style>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ANIMATIONS
2+
// LOADER-DOTS
3+
// =================================================
4+
5+
@keyframes loaderDots {
6+
0% {
7+
content: "";
8+
}
9+
10+
25% {
11+
content: ".";
12+
}
13+
14+
50% {
15+
content: "..";
16+
}
17+
18+
75% {
19+
content: "...";
20+
}
21+
22+
100% {
23+
content: "";
24+
}
25+
}

src/components/UI/UILoader.vue

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<template>
2+
<div class="loading">
3+
<p>
4+
<span class="loading__text">
5+
Loading
6+
</span>
7+
<span class="loading__dots"></span>
8+
</p>
9+
</div>
10+
</template>
11+
12+
<style lang="scss">
13+
.loading {
14+
display: flex;
15+
position: fixed;
16+
z-index: 999;
17+
top: 0;
18+
right: 0;
19+
align-items: center;
20+
justify-content: center;
21+
width: 100%;
22+
height: 100%;
23+
background-color: rgba($color-brand-2, 0.9);
24+
color: $color-light;
25+
font-family: $font-brand-1;
26+
font-size: 3rem;
27+
28+
&__dots {
29+
display: inline-block;
30+
width: 1.5em;
31+
text-align: left;
32+
33+
&:after {
34+
content: "";
35+
display: inline-block;
36+
animation: loaderDots 2.5s infinite steps(4);
37+
}
38+
}
39+
}
40+
</style>

stylelint.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ module.exports = {
9191
"background-color": [
9292
"/^rgba\\(\\$[a-zA-Z0-9-_]+,\\s*[0-9.]+\\)$/",
9393
],
94-
"box-shadow": [
95-
"/^((inset\\s+)?[0-9.]+(px|rem|em|%)?\\s*){1,4}rgba\\(\\$[a-zA-Z0-9-_]+,\\s*[0-9.]+\\)$/",
96-
],
9794
"border": [
9895
"/^[0-9.]+(px|rem|em|%)\\s+(solid|dashed|dotted)\\s+(\\$[a-zA-Z0-9-_]+|rgba\\(\\$[a-zA-Z0-9-_]+,\\s*[0-9.]+\\))$/",
9996
],
97+
"box-shadow": [
98+
"/^((inset\\s+)?[0-9.]+(px|rem|em|%)?\\s*){1,4}rgba\\(\\$[a-zA-Z0-9-_]+,\\s*[0-9.]+\\)$/",
99+
],
100100
},
101101
},
102102
],

0 commit comments

Comments
 (0)