Skip to content

Instantly share code, notes, and snippets.

@vladyn
Forked from LeaVerou/dabblet.css
Created July 29, 2013 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladyn/6102890 to your computer and use it in GitHub Desktop.
Save vladyn/6102890 to your computer and use it in GitHub Desktop.
Loading animation like the one seen on http://www.freeger.com/projects/contextad/ with CSS
/**
* Loading animation like the one seen on http://www.freeger.com/projects/contextad/ with CSS
* Caveat: Not DRY. The content needs to be repeated in a data- attribute (or directly in the CSS).
*/
body {
background: #ccc51c;
min-height: 100%;
}
h1 {
position: absolute;
left: 50%;
margin-left: -1.9em;
color: hsla(0,0%,100%,.3);
font: 900 800% Baskerville, 'Palatino Linotype', Palatino, serif;
}
@keyframes loading {
from { max-width: 0; }
}
h1:before {
content: attr(data-content);
position: absolute;
overflow: hidden;
max-width: 4em;
color: white;
animation: loading 10s linear;
}
<h1 data-content="Contad">Contad</h1>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment