-
Notifications
You must be signed in to change notification settings - Fork 0
/
unicodeViewerArchive.html
94 lines (71 loc) · 1.56 KB
/
unicodeViewerArchive.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
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: #000;
color: #fff;
padding: 0;
margin: 0;
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
font-size: 0;
}
body::-webkit-scrollbar {
display: none;
}
p, h1, h2, h3 {
color: inherit;
}
.char-container {
background-color: #222;
width: 6.25vw;
height: 6.25vw;
margin: 0;
display: inline-block;
}
.char {
font-size: 5vw;
margin: 0;
text-align: center;
line-height: 6.25vw;
}
</style>
<script>
offset = -5;
prevoffset = -5;
function customModulo(a, b) {
return ((a % b) + b) % b;
}
function isDisallowed(char) {
const isControlOrWhitespace = /\p{General_Category=Control}|\s/u.test(char);
return isControlOrWhitespace;
}
function update(time) {
const boxHeight = window.innerWidth / 16;
console.log(offset);
// window.scrollTo(0, 5 * boxHeight + customModulo(window.scrollY, boxHeight));
// window.requestAnimationFrame(update);
}
document.addEventListener("DOMContentLoaded", (event) => {
for (i=0; i<784; i++) {
let box = document.createElement('div');
box.classList.add("char-container");
let character = document.createElement('p');
character.classList.add("char");
charString = String.fromCharCode(i);
if (isDisallowed(charString)) {
character.innerHTML = "__";
} else {
character.innerHTML = charString;
}
box.appendChild(character);
document.body.appendChild(box);
}
window.requestAnimationFrame(update);
});
</script>
</head>
<body>
</body>
</html>