This repository has been archived by the owner on Sep 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
web_canvas.html
96 lines (84 loc) · 2.55 KB
/
web_canvas.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<html>
<head></head>
<body></body>
</html>
<style type="text/css">
body{
overflow-x: hidden;
overflow-y: hidden;
padding: 0;
border: 0;
margin: 0;
background-color: black;
}
canvas {
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
position: absolute;
}
.img-2233 {
position: absolute;
width: 10%;
z-index: 2;
transition: all 0.95s ease-in-out, scale 0.35s ease-out, filter 0.35s ease-in-out;
top: 50%;
left: 75%;
}
.img-2233:hover {
scale: 1.35;
filter: drop-shadow(0 0 0.1em #ffffffee) hue-rotate(-360deg) saturate(1.5);
}
</style>
<script type="text/javascript">
root_ele = document.getRootNode();
html_ele = root_ele.children[0];
body_ele = html_ele.children[1];
canvas_ele = document.createElement("canvas");
dialog_canvas_ele = document.createElement("canvas");
body_ele.appendChild(canvas_ele);
ctx = canvas_ele.getContext("2d", {alpha: false});
JavaScript_WaitToExecute_CodeArray = new Array();
resize_task = false;
font_loaded = false;
loaded2233 = false;
function resizeCanvas() {
canvas_ele.width = window.innerWidth * window.devicePixelRatio;
canvas_ele.height = window.innerHeight * window.devicePixelRatio;
ctx.reset();
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
}
function process_jswteca() {
for(var i=0;i<JavaScript_WaitToExecute_CodeArray.length;i++){
eval(JavaScript_WaitToExecute_CodeArray[i]);
}
JavaScript_WaitToExecute_CodeArray = new Array();
}
function loadFont(family, url) {
var font = new FontFace(family, `url(${url})`);
font.load().then((rfont) => {
document.fonts.add(rfont);
font_loaded = true;
})
}
function update2233() {
img2233.style.top = `${Math.random() * 90}%`;
img2233.style.left = `${Math.random() * 40 + 50}%`;
img2233.style.rotate = `${Math.random() * 360 * 4}deg`;
}
function load2233(url) {
img2233 = new Image();
img2233.src = url;
img2233.loading = "eager";
img2233.onload = () => {
img2233.className = "img-2233";
document.body.appendChild(img2233);
img2233.addEventListener("mousedown", update2233);
loaded2233 = true;
}
}
resizeCanvas();
window.addEventListener("resize", resizeCanvas);
</script>