-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcccbd2.html
More file actions
49 lines (42 loc) · 1.44 KB
/
cccbd2.html
File metadata and controls
49 lines (42 loc) · 1.44 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script type="module">
import { run, pick, red, white, normalize } from "./js/play/frontend.mjs"
import * as sort from "./js/play/sort.mjs"
const result = run({
program: {
boot(context, buffer, data) {
data.charset = sort.sort(
"○◌◍◎●◐◑◒◓◔◕◖◗◘◙◚◛◜◝◞◟◠◡◴◵◶◷◯◦",
context.metrics.fontFamily,
/*ascending=*/ true
);
},
main(coord, context, cursor, buffer, data) {
const { x, y } = coord;
const { t, i, ...n } = normalize({ coord, context });
const value = (1 / 32) * Math.tan((t / 64) * x * Math.tan(i - x));
const char = pick({ value, from: data.charset });
return value > 0 ? red(char) : white(char);
}
},
settings: {
fps: 60,
once: false,
rows: 16,
fontSize: "16px",
backgroundColor: "black"
}
})
document.getElementById("cccbd-preview").appendChild(result);
</script>
<div id="cccbd-preview" >
</div>
</body>
</html>