Skip to content

Commit 18a0755

Browse files
committed
style: fix skeleton animation
1 parent 9ec1ed5 commit 18a0755

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

Diff for: apps/web/src/components/Skeleton/Skeleton.module.css

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.block {
2-
background: var(--bg-element4);
3-
animation: shining 1s ease-in-out infinite;
42
display: inline-block;
3+
background: var(--bg-element4);
54
border-radius: 4px;
65
height: 1em;
76

@@ -14,16 +13,4 @@
1413
&.circle {
1514
border-radius: 50%;
1615
}
17-
18-
@keyframes shining {
19-
0% {
20-
opacity: 0.5;
21-
}
22-
50% {
23-
opacity: 1;
24-
}
25-
100% {
26-
opacity: 0.5;
27-
}
28-
}
2916
}

Diff for: apps/web/src/components/Skeleton/Skeleton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function Skeleton({
2626
}: Props) {
2727
return (
2828
<div
29-
className={cx('block', className, {
29+
className={cx('block', 'shining', className, {
3030
noSpacing: noSpacing || !!marginRight,
3131
circle,
3232
})}

Diff for: apps/web/src/features/home/components/PostCard/PostCard.module.css

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
}
1717
}
1818

19-
&.isRef {
20-
background-color: red;
21-
}
22-
2319
.styleLink {
2420
display: block;
2521
color: inherit;

Diff for: apps/web/src/features/home/components/PostCardGrid/PostCardGrid.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ function PostCardGrid({
7373
}
7474

7575
if (isLoading) return <PostCardSkeletonGrid forHome={forHome} forPost={forPost} />
76-
7776
return (
7877
<ul className={cx('block', 'homeGrid')}>
7978
{posts.map((post, i) => {

Diff for: apps/web/src/lib/styles/keyframes.module.css

+20
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
animation-timing-function: ease-in-out;
2626
}
2727

28+
.shining {
29+
animation-name: shining;
30+
animation-duration: 1s;
31+
animation-fill-mode: forwards;
32+
animation-timing-function: ease-in-out;
33+
animation-iteration-count: infinite;
34+
}
35+
2836
@keyframes fade-in {
2937
0% {
3038
opacity: 0;
@@ -68,3 +76,15 @@
6876
transform: translateY(400px) scale(0.75);
6977
}
7078
}
79+
80+
@keyframes shining {
81+
0% {
82+
opacity: 0.5;
83+
}
84+
50% {
85+
opacity: 1;
86+
}
87+
100% {
88+
opacity: 0.5;
89+
}
90+
}

0 commit comments

Comments
 (0)