Last active
October 10, 2018 06:22
-
-
Save modeverv/375acd2463c5062ced623197a140f658 to your computer and use it in GitHub Desktop.
画面がキラキラするやつ
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
</body> | |
<script> | |
es = document.getElementsByTagName("body"); | |
c = 0x000000; | |
setInterval(() => { | |
es[0].style.backgroundColor = pad6(c); | |
c++; | |
if (c > 0xFFFFFF) { | |
c = 0x000000; | |
} | |
}, 20); | |
var pad6 = function (num) { | |
const a = '#' + ('000000' + num).slice(-6); | |
console.log(a); | |
return a; | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment