Created
February 5, 2012 16:00
-
-
Save thingsinjars/1746231 to your computer and use it in GitHub Desktop.
Typing animation with pure CSS
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
/** | |
* Typing animation with pure CSS | |
* Revised. Browser support (as of Feb 2012): Firefox, IE10 | |
*/ | |
@keyframes typing { from { width: 0; } } | |
@keyframes blink-caret { 50% { border-color: transparent; } } | |
h1 { | |
font: bold 200% Consolas, Monaco, monospace; | |
border-right: .1em solid; | |
width: 16.9em; /* fallback */ | |
width: 30ch; /* # of chars */ | |
margin: 2em 1em; | |
white-space: nowrap; | |
overflow: hidden; | |
animation: typing 20s steps(30, end), /* # of steps = # of chars */ | |
blink-caret .5s step-end infinite alternate; | |
} |
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
<h1>Typing animation by Lea Verou.</h1> |
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
{"view":"split","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment