-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (51 loc) · 1.38 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Wave</title>
<link rel="stylesheet" href="./index.css">
</head>
<body>
<div class="slogan">
<br>
</div>
<div class="main">
<input type="text" value="🍻" />
<canvas text="🍻" size=128></canvas>
</div>
<div class="src">
Made by Yan . Inspired by Aslanon .
</div>
<script src="./index.js"></script>
<script>
let ctx = document.querySelector('canvas').getContext('2d');
let canvas = ctx.canvas;
let text = canvas.getAttribute('text');
let fontSize = canvas.getAttribute('size');
canvas.width = canvas.getBoundingClientRect().width;
canvas.height = canvas.getBoundingClientRect().height;
let pixels = [];
let animation = {
radius: 4,
move: 0.25,
pull: 0.15,
dampen: 0.95,
density: 5
};
let mouse = new Mouse(canvas);
let draw = new Draw(ctx);
init();
frame();
let carbon = document.querySelector('input');
let ver = document.querySelector('canvas');
carbon.addEventListener('change', (e) => {
ver.setAttribute('text', e.target.value);
ctx.clearRect(0,0,canvas.width,canvas.height);
text = e.target.value;
init();
});
</script>
</body>
</html>