Created
February 12, 2015 04:11
-
-
Save mvargasmoran/a50f9ba47dd8e764072e to your computer and use it in GitHub Desktop.
JS Bin Background-color ramdomizer // source http://jsbin.com/bohore
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Background-color ramdomizer"> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
body{ | |
background-color: coral; | |
transition: all ease 0.5s; | |
} | |
p{ | |
font-size: 30px; | |
font-family: 'Helvetica', sans-serif; | |
text-shadow: 0px 0px 1px black, 0px 0px 6px black; | |
color: white; | |
} | |
</style> | |
</head> | |
<body> | |
<p>My background is changing at random <br>( ゚ ワ ゚)<i>(every 2.5s)</i> | |
</p> | |
<script id="jsbin-javascript"> | |
function changeBackground(color) { | |
document.body.style.background = color; | |
} | |
setInterval(function () { | |
changeBackground('#'+Math.floor(Math.random()*16777215).toString(16)); | |
}, 2500); | |
</script> | |
<script id="jsbin-source-css" type="text/css">body{ | |
background-color: coral; | |
transition: all ease 0.5s; | |
} | |
p{ | |
font-size: 30px; | |
font-family: 'Helvetica', sans-serif; | |
text-shadow: 0px 0px 1px black, 0px 0px 6px black; | |
color: white; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function changeBackground(color) { | |
document.body.style.background = color; | |
} | |
setInterval(function () { | |
changeBackground('#'+Math.floor(Math.random()*16777215).toString(16)); | |
}, 2500);</script></body> | |
</html> |
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
body{ | |
background-color: coral; | |
transition: all ease 0.5s; | |
} | |
p{ | |
font-size: 30px; | |
font-family: 'Helvetica', sans-serif; | |
text-shadow: 0px 0px 1px black, 0px 0px 6px black; | |
color: white; | |
} |
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
function changeBackground(color) { | |
document.body.style.background = color; | |
} | |
setInterval(function () { | |
changeBackground('#'+Math.floor(Math.random()*16777215).toString(16)); | |
}, 2500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment