-
Notifications
You must be signed in to change notification settings - Fork 0
/
dots-on-mouse.html
53 lines (46 loc) · 1.04 KB
/
dots-on-mouse.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<script defer src="https://let-pr.com/wp-content/uploads/2019/09/p5.min.js"></script>
<script defer src="https://let-pr.com/wp-content/uploads/2019/09/p5.dom.min.js"></script>
<meta charset="utf-8">
</head>
<body>
<script defer>
function setup() {
createCanvas(windowWidth,windowHeight);
background(255);
frameRate(60);
}
function draw() {
let a = random(0,20);
/*if(second()%1000==3){
background(255);
}*/
a = a +1;
if(a>30){
a=0;}
let b = random(0,255);
let c = random(0,255);
let d = random(0,255);
let my= random(mouseY - 25, mouseY+25);
let mx = random(mouseX - 25,mouseX + 25);
if(mx < 50){
mx=50;
}
if (my < 50){
my=50;
}
if(my>height - 50){
my=height - 50;
}
if(mx>width - 50){
mx=width - 50;
}
noStroke();
fill(b,c,d);
ellipse(mx,my,a,a);
ellipse(mx,my,a,a);
}
</script>
</body></html>