-
Notifications
You must be signed in to change notification settings - Fork 1
/
og.html
100 lines (90 loc) · 2.52 KB
/
og.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
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Toastcat</title>
<meta
name="description"
content="toast cat toast cat toast cat toast cat toast cat"
/>
<link rel="shortcut icon" type="image/jpg" href="" />
<script src="/script.js" defer></script>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Germania+One&family=Spectral&display=swap"
rel="stylesheet"
/>
</head>
<body>
<aside></aside>
<main>
<h1>Toastcat</h1>
<h2>Limited Liability Company</h2>
</main>
<style>
aside > * {
position: fixed;
}
aside {
max-width: 0;
height: 0;
}
html {
height: 100%;
}
body {
justify-content: center;
align-items: center;
}
h1,
h2 {
margin-block: 0;
}
main {
padding: 20px 0;
}
</style>
<script defer>
// https://www.desmos.com/calculator/2c7y4wlcpw
// https://colab.research.google.com/drive/1kPcORA7FRurWAaLzW0V_x5MKhPOGyKJQ#scrollTo=EzycJLKrZ5hM
addEventListener("load", () => {
let arr = [
0, 0.50490728, 1.13414182, 2.00745084, 2.63668538, 3.14159265,
3.64649993, 4.27573447, 5.14904349, 5.77827803,
];
let main = document.querySelector("main");
console.log(main);
if (main) {
console.log("a");
let a = main.clientWidth / Math.sqrt(2);
let b = main.clientHeight / Math.sqrt(2);
let imgs = document.querySelectorAll("img");
console.log(imgs);
imgs.forEach((img, i) => {
console.log(img);
img.style.setProperty(
"left",
a * Math.sin(arr[i]) +
main.getBoundingClientRect().left +
main.offsetWidth / 2 -
img.offsetWidth / 2 +
"px"
);
img.style.setProperty(
"top",
b * Math.cos(arr[i]) +
main.getBoundingClientRect().top +
main.offsetHeight / 2 -
img.offsetHeight / 2 +
15 +
"px"
);
});
}
});
</script>
</body>
</html>