-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
749e3a9
commit 858dfac
Showing
2 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="style.css" /> | ||
<title>text animation</title> | ||
</head> | ||
<body> | ||
<div class="hello"> | ||
<div class="typewriter"> | ||
<h1>Hello, World🌍</h1> | ||
</div> | ||
<div class="wave"><span>👋</span></div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
body { | ||
font-family: sans-serif; | ||
background: #06283D; | ||
overflow: hidden; | ||
} | ||
.typewriter { | ||
width: fit-content; | ||
margin: 0 auto; | ||
display: flex; | ||
} | ||
|
||
h1 { | ||
font-family: monospace; | ||
font-size: 30px; | ||
color: #DFF6FF; | ||
margin-top: 4rem; | ||
text-align: center; | ||
position: relative; | ||
} | ||
|
||
h1::before, | ||
h1::after { | ||
content: ""; | ||
position: absolute; | ||
inset: 0; | ||
} | ||
|
||
h1::before { | ||
background: #06283D; | ||
animation: typewriter 4s steps(13) forwards 1s; | ||
} | ||
|
||
h1::after { | ||
width: 5px; | ||
background: #DFF6FF; | ||
animation: blink 600ms steps(13) forwards infinite, | ||
typewriter 4s steps(13) forwards 1s; | ||
} | ||
|
||
@keyframes typewriter { | ||
to { | ||
left: 100%; | ||
} | ||
} | ||
|
||
@keyframes blink { | ||
to { | ||
background: transparent; | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
h1 { | ||
text-align: center; | ||
font-family: 'Pacifico', cursive; | ||
font-size: 80px; | ||
font-weight: 400; | ||
color: #DFF6FF; | ||
} | ||
|
||
.wave { | ||
font-size: 120px; | ||
position: relative; | ||
} | ||
|
||
span { | ||
transform: translate(-50%, 0) rotate(-10deg); | ||
transform-origin: 100% 100%; | ||
left: 50%; | ||
display: block; | ||
position: absolute; | ||
animation: wave 350ms ease-in-out alternate; | ||
} | ||
|
||
@keyframes wave { | ||
0% { | ||
transform: translate(-50%, 0) rotate(15deg); | ||
} | ||
100% { | ||
transform: translate(-50%, 0) rotate(-10deg); | ||
} | ||
} | ||
span { | ||
transform: translate(-50%, 0) rotate(-10deg); | ||
transform-origin: 100% 100%; | ||
left: 50%; | ||
display: block; | ||
position: absolute; | ||
animation: wave 350ms ease-in-out alternate infinite; | ||
} | ||
|
||
@keyframes wave { | ||
0% { | ||
transform: translate(-50%, 0) rotate(15deg); | ||
} | ||
100% { | ||
transform: translate(-50%, 0) rotate(-10deg); | ||
} | ||
} |