Created
June 9, 2022 03:27
-
-
Save djsubstance/6d862a8b7843eb6dc68c0ee41e0fc010 to your computer and use it in GitHub Desktop.
CSS Typing Effect
This file contains hidden or 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
<div class="wrapper"> | |
<div class="typing-demo"> | |
This is a typing demo. | |
</div> | |
</div> |
This file contains hidden or 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
<script src="https://codepen.io/denic/pen/YzyPzKG"></script> |
This file contains hidden or 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
.wrapper { | |
height: 100vh; | |
/*This part is important for centering*/ | |
display: grid; | |
place-items: center; | |
} | |
.typing-demo { | |
width: 22ch; | |
animation: typing 2s steps(22), blink .5s step-end infinite alternate; | |
white-space: nowrap; | |
overflow: hidden; | |
border-right: 3px solid; | |
font-family: monospace; | |
font-size: 2em; | |
} | |
@keyframes typing { | |
from { | |
width: 0 | |
} | |
} | |
@keyframes blink { | |
50% { | |
border-color: transparent | |
} | |
} |
This file contains hidden or 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
<link href="https://codepen.io/denic/pen/YzyPzKG" rel="stylesheet" /> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment