Skip to content

Commit

Permalink
new: added text animation (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamtushar11 authored Oct 15, 2022
1 parent 749e3a9 commit 858dfac
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Text-animate/index.html
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>
101 changes: 101 additions & 0 deletions Text-animate/style.css
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);
}
}

0 comments on commit 858dfac

Please sign in to comment.