Created
July 23, 2019 14:57
-
-
Save rep-movsd/5167f06c42a6ed887742a37c2e3c2276 to your computer and use it in GitHub Desktop.
Dweet test template
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
<html> | |
<head> | |
<style> | |
* { | |
padding:0; | |
margin:0; | |
border:0; | |
outline:0; | |
overflow:hidden | |
} | |
canvas | |
{ | |
width: 100%; | |
background: white; | |
} | |
</style> | |
<script> | |
function main() | |
{ | |
c = document.querySelector("#c"); | |
c.width = 1920; | |
c.height = 1080; | |
S = Math.sin; | |
C = Math.cos; | |
T = Math.tan; | |
R = | |
function(r,g,b,a) | |
{ | |
a = a === undefined ? 1 : a; | |
return "rgba("+(r|0)+","+(g|0)+","+(b|0)+","+a+")"; | |
}; | |
x = c.getContext("2d"); | |
startT = +new Date(); | |
active=false; | |
loop = function() | |
{ | |
if(active) | |
{ | |
requestAnimationFrame(loop); | |
u((new Date() - startT) / 1000); | |
} | |
}; | |
} | |
function activate() | |
{ | |
active=!active; | |
if(active) loop(); | |
} | |
</script> | |
<script src='demo.js'> </script> | |
</head> | |
<body onload="main();"> | |
<canvas id=c onclick="activate();"></canvas> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment