-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
39 lines (34 loc) · 968 Bytes
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Yay!</title>
<link rel="stylesheet" href="styles/main.css" />
</head>
<body>
<canvas class="confetti"></canvas>
<script src="scripts/main.js"></script>
<script>
ConfettiCannon.initializeCanvas();
// Valentine's Day Cannon
const cannon = new ConfettiCannon({
maxScale: 3.5,
width: 25,
height: 25,
weight: 100,
colors: ['powderblue', 'lightblue', 'navy', 'darkblue', 'stateblue'],
});
cannon.createSprites(500);
window.cannon = cannon;
let lastFrame = Date.now();
function update() {
const dt = (Date.now() - lastFrame) * 0.001;
cannon.update(dt);
lastFrame = Date.now();
window.requestAnimationFrame(update);
}
update();
</script>
</body>
</html>