-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
47 lines (44 loc) · 998 Bytes
/
test.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
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background: #ddd;
}
#container {
position: relative;
width: 200px;
height: 100px;
}
#button {
font-size: 36px;
padding: 20px;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="container">
<button id="button">Snap!</button>
</div>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/jadenguitarman/thanosjs@1.2.0/thanos.min.js"></script>
<script>
let button = document.getElementById("button");
let thanos = new Thanos({
victim: document.getElementById("button"),
move_to: { x: 200, y: -200 },
container: document.getElementById("container"),
pixel_size: 8
});
button.addEventListener("click", thanos.snap);
</script>
</body>
</html>