Skip to content

Commit 8d2128a

Browse files
committed
feat: Add new text Animation Effect "Wave Motion Text"
1 parent 37289cb commit 8d2128a

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

text/wave-motion-text/index.html

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212

1313
<body>
1414
<h1>
15-
<span>YAY</span>
15+
<span>
16+
YAY
17+
<div class="stars">
18+
<div class="star text1"></div>
19+
<div class="star text2"></div>
20+
<div class="star text3"></div>
21+
</div>
22+
</span>
1623
<span>YAY</span>
1724
<span>YAY</span>
1825
<span>YAY</span>
@@ -21,9 +28,6 @@ <h1>
2128
<span>YAY</span>
2229
<span>YAY</span>
2330
</h1>
24-
<div class="star text1"></div>
25-
<div class="star text2"></div>
26-
<div class="star text3"></div>
2731
</body>
2832

2933
</html>

text/wave-motion-text/style.css

+13-9
Original file line numberDiff line numberDiff line change
@@ -102,29 +102,33 @@ h1 span:nth-child(8) {
102102
left: 47.9%;
103103
z-index: 1;
104104
}
105-
105+
.stars {
106+
position: relative;
107+
width: 100%;
108+
z-index: 100;
109+
}
106110
.star {
107-
position: fixed;
111+
position: absolute;
108112
width: 5px;
109113
height: 5px;
110114
border: 1px solid #000;
111-
z-index: 100;
112115
background: #fff;
113116
animation: star 2s ease-in-out infinite;
114117
animation-delay: 1.1s;
115118
transform: rotate(0deg) scale(0);
119+
z-index: 100;
116120
}
117121
.star.text1 {
118-
top: 43.7%;
119-
left: 46.6%;
122+
top: -167px;
123+
left: 10px;
120124
}
121125
.star.text2 {
122-
top: 48%;
123-
left: 52.4%;
126+
top: -115px;
127+
left: 92px;
124128
}
125129
.star.text3 {
126-
top: 53.4%;
127-
left: 57.4%;
130+
top: -57px;
131+
left: 164px;
128132
}
129133

130134
@keyframes star {

0 commit comments

Comments
 (0)