Created
January 5, 2015 02:41
-
-
Save gggritso/d09899a5fc82184ac5d3 to your computer and use it in GitHub Desktop.
Meatronome
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
( function() { | |
function appendStyleSheet() { | |
var style = document.createElement( 'style' ); | |
style.appendChild( document.createTextNode( '' ) ); // for WebKit | |
document.head.appendChild( style ); | |
style.sheet.insertRule( '#meatronome { height: 10px; position: absolute; top: 0; width: 100%;}', 0 ); | |
style.sheet.insertRule( '@-webkit-keyframes move { from { left: 10%; } to { left: 90%; } }', 0 ); | |
style.sheet.insertRule( '#meatronome .dot { display: block; position: absolute; width: 10px; height: 10px; border-radius: 10px; background-color: rgba( 0, 0, 0, 0.6 ); -webkit-animation: 1s move linear 0s infinite alternate; }', 0 ); | |
} | |
function appendDots() { | |
var meatronome = document.createElement( 'div' ); | |
meatronome.id = 'meatronome'; | |
var dot = document.createElement( 'b' ); | |
dot.className = 'dot'; | |
meatronome.appendChild( dot ); | |
document.querySelector( '#video-preview' ).appendChild( meatronome ); | |
} | |
appendStyleSheet(); | |
appendDots(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment