Skip to content

Commit 56e28e0

Browse files
committed
add styles for the skeleton and shimmer components
1 parent 86f42fe commit 56e28e0

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

frontend/src/styles/skeleton.css

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
.skeleton {
2+
display: flex;
3+
flex-flow: column nowrap;
4+
background: #ddd;
5+
margin: 10px 0;
6+
overflow: hidden;
7+
}
8+
9+
.skeleton-product-wrapper {
10+
position: relative;
11+
margin-top: 1em;
12+
background: #c0c0c0;
13+
border-radius: 10px;
14+
padding: 0.5em;
15+
overflow: hidden;
16+
}
17+
18+
.skeleton.box {
19+
height: 25ch;
20+
width: 100%;
21+
}
22+
23+
.skeleton-product-wrapper .skeleton.box {
24+
margin-top: 0;
25+
margin-bottom: 10%;
26+
border-radius: 10px 10px 0 0;
27+
}
28+
29+
.skeleton.title {
30+
height: 3ch;
31+
}
32+
33+
.skeleton.text {
34+
width: 100%;
35+
height: 2ch;
36+
margin: 1em 0;
37+
}
38+
39+
/* for the animations */
40+
41+
.shimmer-wrapper {
42+
position: absolute;
43+
top: 0;
44+
bottom: 0;
45+
width: 100%;
46+
height: 100%;
47+
animation: loading 2s infinite;
48+
}
49+
50+
.shimmer {
51+
width: 50%;
52+
height: 100%;
53+
background: rgba(255, 255, 255, 0.3);
54+
transform: skewX(-20deg);
55+
box-shadow: 0 0 30px 10px rgba(255, 255, 255, 0.05);
56+
}
57+
58+
@keyframes loading {
59+
0% {
60+
transform: translateX(-150%);
61+
}
62+
63+
50% {
64+
transform: translateX(50%);
65+
}
66+
67+
100% {
68+
transform: translateX(150%);
69+
}
70+
}

0 commit comments

Comments
 (0)