Skip to content

Commit 47e5bb7

Browse files
committed
Fixed error y haciendo el spinner global
1 parent 908e9cc commit 47e5bb7

File tree

3 files changed

+56
-44
lines changed

3 files changed

+56
-44
lines changed

astro.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import vercel from '@astrojs/vercel/serverless'
1111
export default defineConfig({
1212
integrations: [tailwind(), react()],
1313
output: 'server',
14-
adapter: vercel(),
14+
adapter: vercel({}),
1515
})

src/components/general/Spinner.astro

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<span class="loader"></span>
2+
3+
<style>
4+
.loader {
5+
width: 48px;
6+
height: 48px;
7+
border-radius: 50%;
8+
position: relative;
9+
animation: rotate 1s linear infinite;
10+
}
11+
.loader::before {
12+
content: '';
13+
box-sizing: border-box;
14+
position: absolute;
15+
inset: 0px;
16+
border-radius: 50%;
17+
border: 5px solid #fff;
18+
animation: prixClipFix 2s linear infinite;
19+
}
20+
21+
@keyframes rotate {
22+
100% {
23+
transform: rotate(360deg);
24+
}
25+
}
26+
27+
@keyframes prixClipFix {
28+
0% {
29+
clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0);
30+
}
31+
25% {
32+
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0);
33+
}
34+
50% {
35+
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%);
36+
}
37+
75% {
38+
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%);
39+
}
40+
100% {
41+
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0);
42+
}
43+
}
44+
</style>
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1+
---
2+
import Spinner from '@components/general/Spinner.astro'
3+
---
4+
15
<div class="container-compare">
26
<div
37
class="relative bg-gray-400 w-full h-full aspect-video overflow-hidden grid place-content-center"
48
>
5-
<span class="loader"></span>
9+
<Spinner />
10+
</div>
11+
<div
12+
class="relative bg-gray-400 w-full h-full aspect-video overflow-hidden grid place-content-center"
13+
>
14+
<Spinner />
615
</div>
716
<div
817
class="relative bg-gray-400 w-full h-full aspect-video overflow-hidden grid place-content-center"
918
>
10-
<span class="loader"></span>
19+
<Spinner />
1120
</div>
1221
</div>
1322

@@ -18,45 +27,4 @@
1827
gap: 1rem;
1928
min-height: 400px;
2029
}
21-
22-
.loader {
23-
width: 48px;
24-
height: 48px;
25-
border-radius: 50%;
26-
position: relative;
27-
animation: rotate 1s linear infinite;
28-
}
29-
.loader::before {
30-
content: '';
31-
box-sizing: border-box;
32-
position: absolute;
33-
inset: 0px;
34-
border-radius: 50%;
35-
border: 5px solid #fff;
36-
animation: prixClipFix 2s linear infinite;
37-
}
38-
39-
@keyframes rotate {
40-
100% {
41-
transform: rotate(360deg);
42-
}
43-
}
44-
45-
@keyframes prixClipFix {
46-
0% {
47-
clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0);
48-
}
49-
25% {
50-
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0);
51-
}
52-
50% {
53-
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%);
54-
}
55-
75% {
56-
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%);
57-
}
58-
100% {
59-
clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0);
60-
}
61-
}
6230
</style>

0 commit comments

Comments
 (0)