Skip to content

Instantly share code, notes, and snippets.

@rep-movsd
Created July 23, 2019 14:57
Show Gist options
  • Save rep-movsd/5167f06c42a6ed887742a37c2e3c2276 to your computer and use it in GitHub Desktop.
Save rep-movsd/5167f06c42a6ed887742a37c2e3c2276 to your computer and use it in GitHub Desktop.
Dweet test template
<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