-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
298 lines (266 loc) · 9.42 KB
/
Copy pathindex.html
File metadata and controls
298 lines (266 loc) · 9.42 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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explorations</title>
<style>
body {
background-color: #1a1a1a;
/* Dark background */
color: #d4d4d4;
/* Off-white text */
font-family: 'Courier New', Courier, monospace;
padding: 2rem;
font-size: 16px;
}
.container {
max-width: 800px;
margin: 0 auto;
}
/* Title Styling */
h1 {
font-size: 2.5rem;
font-weight: bold;
color: #f0f0f0;
text-transform: uppercase;
margin-bottom: 2rem;
text-align: center;
}
/* Typewriter Text Block Styling */
.typewriter-text {
border-right: 2px solid rgba(255, 255, 255, .75);
/* Blinking cursor */
white-space: pre-wrap;
/* Respects newlines and spaces */
overflow: hidden;
font-family: 'Courier New', Courier, monospace;
/* Standard Courier */
line-height: 1.6;
}
/* Distressed font effect class */
.distressed {
/* A more "worn" courier look */
font-family: 'American Typewriter', 'Courier New', Courier, monospace;
opacity: 0.95;
}
/* Blinking cursor animation */
.blinking-cursor {
animation: blink-caret .75s step-end infinite;
}
/* Table Styling */
table {
width: 100%;
border-collapse: collapse;
margin-top: 3rem;
border: 1px solid #555;
}
th,
td {
border: 1px solid #555;
padding: 12px;
text-align: left;
}
th {
background-color: #333;
color: #f0f0f0;
font-weight: bold;
}
td a {
color: #76c7c0;
/* A nice teal for links */
text-decoration: none;
}
td a:hover {
text-decoration: underline;
}
.thumbnail {
width: 200px;
height: 150px;
height: auto;
display: block;
}
.thumbnail-placeholder {
width: 100px;
height: 75px;
background-color: #444;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.8rem;
color: #888;
}
</style>
</head>
<body>
<div class="container">
<h1>Explorations</h1>
<div id="text-block" class="typewriter-text distressed"></div>
<table id="projects-table">
<tbody>
</tbody>
</table>
</div>
<script>
/**
* Adds a new row to the specified table's tbody.
*
* @param {string} id - The ID of the table element.
* @param {string} url - The relative or absolute URL for the link.
* @param {string} link_text - The text to display for the link.
* @param {string} thumbnail - The relative path to the thumbnail image.
* @param {string} description - The text content for the description cell.
* @param {string} [attribution] - Optional attribution text for the description.
*/
function addRow(id, url, link_text, thumbnail, description, attribution) {
const tableBody = document.getElementById(id)?.querySelector('tbody');
if (!tableBody) {
console.error(`Error: Table with id "${id}" or its tbody not found.`);
return;
}
const newRow = document.createElement('tr');
// Conditionally create the attribution HTML if the parameter is provided
const attributionHTML = attribution
? `<span style="position: absolute; bottom: 8px; right: 12px; font-size: 0.8em; color: #666;">${attribution}</span>`
: '';
// The inner HTML now uses the url and link_text parameters directly
newRow.innerHTML = `
<td><a href="${url}" target="_blank">${link_text}</a></td>
<td style="position: relative; padding-right: 30px;">
${description}
${attributionHTML}
</td>
<td>
<div style="background-image: url('${thumbnail}'); width: 150px; height: 100px; background-size: cover; background-position: center;"></div>
</td>
`;
tableBody.appendChild(newRow);
}
document.addEventListener('DOMContentLoaded', function () {
// add the rows to the links table
addRow(
'projects-table',
'slug.html',
'Standing Lug Sail Designer',
'',
'Interactive designer for standing lug sails with blueprint export.',
'gever + gemini'
);
addRow(
'projects-table',
'predator.html',
'Predator/prey simulator',
'',
'Can you balance an ecosystem?',
'gever + gemini'
);
addRow(
'projects-table',
'dillydalia.html',
'Pareidolia Playground',
'IMG_3024.PNG',
'What makes a face a face?',
'gever + gemini'
);
addRow(
'projects-table',
'vectorizer_playground.html',
'Vectorizer Playground',
'vectorizer_playground_th.png',
'Interpret image as vectors (for plotting); a messy collection of tweaks and algorithms.',
'gever + gemini'
);
addRow(
'projects-table',
'dither_playground.html',
'Dither Playground',
'dither_playground_th.png',
'Exploring the application of different dither patterns.',
'gever + gemini'
);
addRow(
'projects-table',
'bwxBASIC.html',
'bwxBASIC',
'bwxBASIC_th.png',
'The Brightworks flavor of BASIC.',
'gever + gemini'
);
addRow(
'projects-table',
'circle_packing.html',
'Circle Packing',
'circle_packing_th.png',
'Play with how circles relate to polygonal borders.',
'gever + gemini'
);
addRow(
'projects-table',
'particle_cloud.html',
'Particle Cloud',
'particle_cloud_th.png',
'Watch a cloud of particles spontaneously aggregate into planetoids.',
'gever + gemini'
);
addRow(
'projects-table',
'tiling.html',
'Square Tiling Playground',
'tiling_th.png',
'Drop an image in and play with rotations and symmetry.',
'gever + gemini'
);
addRow(
'projects-table',
'gstd/index.html',
'Galactic Space Tortoise Doctor',
'gstd/splash.png',
'Deliver life-saving vaccine to infected planets!',
'gever + gemini'
);
addRow(
'projects-table',
'https://g.co/gemini/share/1e11bb3ffe9b',
'Binary Star Stability',
'binary_star_stability_th.png',
'knowledge summary, basic concepts, types, and some of the physics (errors in the formulae rendering)',
'gemini + gever'
);
addRow(
'projects-table',
'https://gemini.google.com/share/73e1efc4a821',
'Dry Ice',
'dryice_simulation_th.png',
'a simulation of dry ice chips floating on water in a circular dish.',
'aidan krempetz'
);
addRow(
'projects-table',
'binary_playground.html',
'Binary Playground',
'binary_playground_th.png',
'particles, set in circular motion, collide and agglomerate, often producing binary pairs of super-massive "stars".',
'gever + gemini'
);
const textBlockElement = document.getElementById('text-block');
// EDIT THIS TEXT to change the content that gets typed out.
// Use `\n` for new lines.
const textToType = `These are some artifacts that emerged from conversations with myself and friends.`;
let i = 0;
function typeWriter() {
if (i < textToType.length) {
textBlockElement.innerHTML += textToType.charAt(i);
i++;
// Adjust timeout for faster/slower typing speed
setTimeout(typeWriter, 50); // 50ms delay between characters
} else {
// When typing is done, add a persistent blinking cursor
// textBlockElement.classList.add('blinking-cursor');
}
}
// Start the effect
typeWriter();
});
</script>
</body>
</html>