Skip to content

Commit 1b6c6c7

Browse files
committed
Add Water Wave Text Animation using CSS
1 parent ae3697a commit 1b6c6c7

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>Water Wave Text Animation</title>
7+
<link rel="stylesheet" href="./style.css">
8+
9+
</head>
10+
11+
<body>
12+
<div class="content">
13+
<h2>WeBeginners</h2>
14+
<h2>WeBeginners</h2>
15+
</div>
16+
17+
</body>
18+
19+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
2+
* {
3+
margin: 0;
4+
padding: 0;
5+
box-sizing: border-box;
6+
font-family: "Poppins", sans-serif;
7+
}
8+
9+
body {
10+
display: flex;
11+
justify-content: center;
12+
align-items: center;
13+
min-height: 100vh;
14+
background: #000;
15+
}
16+
17+
.content {
18+
position: relative;
19+
}
20+
21+
.content h2 {
22+
position: absolute;
23+
transform: translate(-50%, -50%);
24+
font-size: 8em;
25+
}
26+
27+
.content h2:nth-child(1) {
28+
color: transparent;
29+
-webkit-text-stroke: 2px #03a9f4;
30+
}
31+
32+
.content h2:nth-child(2) {
33+
color: #03a9f4;
34+
animation: animate 4s ease-in-out infinite;
35+
}
36+
37+
@keyframes animate {
38+
0%,
39+
100% {
40+
clip-path: polygon(0% 45%, 15% 44%, 32% 50%, 54% 60%, 70% 61%, 84% 59%, 100% 52%, 100% 100%, 0% 100%);
41+
}
42+
50% {
43+
clip-path: polygon(0% 60%, 16% 65%, 34% 66%, 51% 62%, 67% 50%, 84% 45%, 100% 46%, 100% 100%, 0% 100%);
44+
}
45+
}
46+
47+
@media(max-width: 768px) {
48+
.content h2 {
49+
font-size: 3em;
50+
}
51+
}

0 commit comments

Comments
 (0)