clock
This commit is contained in:
58
index.html
Normal file
58
index.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<!--<meta name="description" content="">
|
||||
<meta name="keywords" content="">-->
|
||||
<meta name="author" content="Victor Giers">
|
||||
<meta name="date" content="2019-06-21" scheme="YYYY-MM-DD">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>deaths</title>
|
||||
<style>
|
||||
body{padding: 0; margin: 0; background-color: #000; position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden;}
|
||||
canvas {display: block; overflow: hidden;}
|
||||
</style>
|
||||
<script src="p5.min.js"></script>
|
||||
<script>
|
||||
var width, height;
|
||||
var tickMS = 1800;
|
||||
var previous = 0;
|
||||
var time = 0;
|
||||
//var jitter = 1.8;
|
||||
function setup() {
|
||||
width = window.innerWidth;
|
||||
height = window.innerHeight;
|
||||
createCanvas(width,height);
|
||||
|
||||
}
|
||||
|
||||
function draw() {
|
||||
var current = millis();
|
||||
var elapsed = current - previous;
|
||||
previous = current;
|
||||
time += elapsed;
|
||||
while (time >= tickMS){
|
||||
time -= tickMS;
|
||||
blink(Math.random(0,width),Math.random(0,height));
|
||||
}
|
||||
clear();
|
||||
}
|
||||
|
||||
function blink(x, y){
|
||||
tickMS = random(100,3500);
|
||||
console.log(tickMS);
|
||||
}
|
||||
|
||||
window.onresize = function() {
|
||||
var w = window.innerWidth;
|
||||
var h = window.innerHeight;
|
||||
width = w;
|
||||
height = h;
|
||||
resizeCanvas(width,height);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user