-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.html
144 lines (131 loc) · 3.98 KB
/
index.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
background: #888;
color: #EEE;
font-family: Avenir, sans-serif;
}
a {
color: #EEE;
}
canvas {
background: #000;
border-radius: 10px;
cursor: none;
}
pre {
background: #EEE;
color: #000;
line-height: 1.5;
display: none;
padding: 10px;
border-radius: 10px;
width: fit-content;
}
body.fullscreen {
background: #000;
}
body.fullscreen > *:not(canvas) {
display: none;
}
body.fullscreen #canvas {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 0;
}
</style>
<script src="St78/Smalltalk78.js"></script>
<title>ThingLab</title>
</head>
<body id="body">
<a href="https://cdglabs.github.io" target="_blank"><img src="cdg-logo.svg" width="75" height="75" align="right"></a>
<h1>ThingLab</h1>
<canvas id="canvas" width="1024" height="768"></canvas>
<p>This is Alan Borning's <a href="https://github.com/cdglabs/thinglab?#ThingLab" target="_blank">ThingLab</a>
(1979) running on the <a href="https://github.com/codefrau/Smalltalk78" target="_blank">Smalltalk-78</a> VM
by Vanessa Freudenberg and Dan Ingalls</p>
<button id="helpbutton">Mouse and Keyboard Help</button>
<button id="fullscreenbutton">Fullscreen</button>
<pre id="help">
<b>Mouse</b>
Left-click: select ("red button")
Right-click: context menu ("yellow button")
Ctrl-click/middle-click: window menu ("blue button")
<b>Keyboard</b>
⌾: @ (make point)
←: _ (assignment)
⇑: ^ (return)
ⓢ: ` (backtick, 's operator)
↑: Ctrl-^ (Ctrl-6) ^^
¬: Ctrl-- (Ctrl-minus, unary minus, ¬1 instead of -1)
◢: Ctrl-] (Doit)
◦: Ctrl-A (<b>A</b>t) ..
⦂: Ctrl-C (open <b>C</b>olon) ::
∢: Ctrl-E (<b>E</b>ye) <)
⇒: Ctrl-F (i<b>F</b>) =>
≥: Ctrl-G (<b>G</b>reater or equal) >=
Ctrl-H (backspace)
Ctrl-I (tab)
≤: Ctrl-L (<b>L</b>ess or equal) <=
≠: Ctrl-N (<b>N</b>ot equal) !=
↪: Ctrl-U (<b>U</b>nique string, symbol) #
ⓢ: Ctrl-S ('s operator, eval in object)
≡: Ctrl-T (<b>T</b>riple equal, identity) ==
➲: Ctrl-V (in<b>V</b>erse arrow)
◻: Ctrl-Q (s<b>Q</b>uare)
▱: Ctrl-X (wiggly line)
#: ## (because # is ↪)
◣: (no keyboard binding)
Cmd-C/Alt-C: copy text
Cmd-V/Alt-V: paste text
Cmd-B/Alt-B: bold
Cmd-I/Alt-I: italic
Cmd-U/Alt-U: underline
Cmd-X/Alt-X: reset emphasis
Cmd-0...9, +/-: change font
Cmd-D doit
Cmd-P printit
Cmd-S compile
Cmd-J again
Cmd-A select all
Cmd-L cancel
Cmd-Z undo
Cmd-. interrupt
Tab/Shift-Tab indent/outdent selection
Ctrl-] do it in eval (Dispframe in the topleft corner)
Ctrl-d done with eval
</pre>
<script>
const params = new URLSearchParams(location.hash.slice(1));
if (params.get("width")) canvas.width = +params.get("width");
if (params.get("height")) canvas.height = +params.get("height");
if (params.has("fullscreen")) body.classList.add("fullscreen");
module("ThingLab").requires("Smalltalk78").toRun(() => {
Smalltalk78.run("thinglab.st78", canvas)
});
let timeout;
helpbutton.onclick = () => {
clearTimeout(timeout);
if (help.style.display) {
canvas.scrollIntoView({ behavior: 'smooth' });
timeout = setTimeout(() => help.style.display = '', 1000);
} else {
help.style.display = 'block';
helpbutton.scrollIntoView({ behavior: 'smooth' });
}
}
fullscreenbutton.onclick = () => {
canvas.requestFullscreen();
}
document.onfullscreenchange = () => {
const isFullscreen = document.fullscreenElement === canvas;
body.classList.toggle("fullscreen", isFullscreen);
}
</script>
</body>
</html>