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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>snonux.foo ✧ COSMOS</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>
<style>
:root { --gold:#ffd166; --purple:#9b5de5; --blue:#4cc9f0; --bg:#020214; }
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Segoe UI',system-ui,sans-serif; background:var(--bg);
color:#d4e8ff; overflow:hidden; height:100vh; }
#three-canvas { position:fixed; top:0; left:0; width:100%; height:100%; z-index:1; }
.overlay { position:relative; z-index:10; height:100vh; display:flex; flex-direction:column; }
header { padding:16px 28px; background:rgba(2,2,20,0.78); backdrop-filter:blur(14px);
border-bottom:1px solid rgba(255,209,102,0.2); display:flex; align-items:center; justify-content:space-between; }
.logo { display:flex; align-items:center; gap:14px; }
.logo-mark { font-size:2rem; font-weight:800;
background:linear-gradient(90deg,var(--gold),var(--purple));
-webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.logo-title h1 { font-size:1.5rem; font-weight:700; color:#d4e8ff; }
.logo-title .subtitle { font-size:0.75rem; color:rgba(212,232,255,0.5); margin-top:2px; }
.logo-title .subtitle a { color:var(--gold); text-decoration:none; }
.logo-title .subtitle a:hover { text-shadow:0 0 8px var(--gold); }
.transmit-btn { border:1px solid var(--gold); color:var(--gold); padding:9px 20px;
border-radius:20px; text-decoration:none; font-size:0.85rem; transition:all 0.2s; }
.transmit-btn:hover { background:var(--gold); color:var(--bg); }
a.header-feed-link { color:var(--blue); }
a.header-feed-link:hover { color:var(--gold); }
.nav-hints { background:rgba(2,2,20,0.6); border-bottom:1px solid rgba(255,209,102,0.12);
color:rgba(212,232,255,0.4); padding:5px 28px; display:flex; gap:18px;
font-size:0.68rem; flex-wrap:wrap; }
.nav-hints kbd { background:rgba(255,209,102,0.1); border:1px solid rgba(255,209,102,0.3);
color:var(--gold); border-radius:3px; padding:0 5px; margin:0 2px; }
.content { flex:1; overflow-y:auto; padding:20px 28px;
scrollbar-width:thin; scrollbar-color:var(--purple) var(--bg); }
.page-nav { display:flex; justify-content:center; margin:14px 0; }
.page-nav a { border:1px solid var(--purple); color:var(--purple); padding:8px 20px;
border-radius:20px; text-decoration:none; font-size:0.82rem; }
.page-nav a:hover { background:var(--purple); color:#fff; }
.page-nav-footer { flex-shrink:0; padding:8px 28px; display:flex; justify-content:center;
background:rgba(2,2,20,0.78); backdrop-filter:blur(14px);
border-top:1px solid rgba(255,209,102,0.2); }
.post { background:rgba(5,5,30,0.72); border:1px solid rgba(155,93,229,0.22); border-radius:10px;
padding:20px; margin-bottom:14px; cursor:pointer;
transition:all 0.25s; backdrop-filter:blur(6px); }
.post:hover { border-color:var(--gold); box-shadow:0 0 22px rgba(255,209,102,0.18); transform:translateY(-2px); }
.post-active { border-color:var(--gold) !important; background:rgba(10,5,35,0.9) !important;
box-shadow:0 0 28px rgba(255,209,102,0.35),inset 3px 0 0 var(--gold) !important; }
.post-header { display:flex; justify-content:space-between; margin-bottom:12px; font-size:0.88rem; }
.post-time { color:var(--blue); font-family:monospace; font-size:0.8rem; }
.post-text { line-height:1.65; font-size:0.95rem; }
.post-text a { color:var(--blue); text-decoration:none; }
.post-text a:hover { text-shadow:0 0 8px var(--blue); }
.post-audio { width:100%; margin-top:10px; }
.post-modal { display:none; position:fixed; inset:0; z-index:100;
overflow-y:auto; padding:40px 20px; }
.post-modal.active { display:block; }
.modal-inner { max-width:760px; margin:0 auto; background:rgba(5,5,30,0.92);
border:1px solid var(--gold); border-radius:12px;
box-shadow:0 0 60px rgba(255,209,102,0.25); padding:40px; backdrop-filter:blur(16px); }
.modal-close { float:right; background:none; border:none; color:var(--gold);
font-size:0.9rem; cursor:pointer; letter-spacing:1px; }
@media(max-width:640px) { .nav-hints{display:none;} header{padding:12px 18px;} .content{padding:14px 18px;} }
.splash-overlay.splash-cosmos { background: radial-gradient(ellipse 100% 80% at 50% 100%, rgba(155,93,229,0.2) 0%, transparent 55%), var(--bg); }
.splash-cosmos .splash-stars {
position:absolute; inset:0; pointer-events:none; opacity:0.5;
background-image: radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.9), transparent),
radial-gradient(1px 1px at 80% 20%, rgba(255,209,102,0.8), transparent),
radial-gradient(1px 1px at 40% 70%, rgba(76,201,240,0.7), transparent),
radial-gradient(1px 1px at 65% 55%, rgba(255,255,255,0.6), transparent);
background-size: 100% 100%;
animation: splashTwinkle 4s ease-in-out infinite alternate;
}
@keyframes splashTwinkle { from { opacity:0.35; } to { opacity:0.65; } }
.splash-cosmos .splash-inner { position:relative; z-index:1; }
.splash-cosmos .splash-orbit {
width:72px; height:72px; margin:0 auto 1rem; border:2px solid rgba(255,209,102,0.5);
border-radius:50%; animation: splashOrbitSpin 12s linear infinite;
box-shadow: 0 0 30px rgba(155,93,229,0.4);
}
@keyframes splashOrbitSpin { to { transform: rotate(360deg); } }
.splash-cosmos .splash-title { font-size:clamp(1.45rem,4.5vw,2rem); color:#d4e8ff; }
.splash-cosmos .splash-tag {
background:linear-gradient(90deg,var(--gold),var(--purple));
-webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.splash-cosmos .splash-hint { color:rgba(212,232,255,0.88); }
.splash-cosmos .splash-stars { z-index:1; }
.splash-cosmos .splash-inner { text-shadow: 0 2px 20px rgba(0,0,0,0.85); }
{{template "navSharedCSSInner"}}
</style>
</head>
<body>
{{template "splashGate"}}
<div id="splash-overlay" class="splash-overlay splash-cosmos" role="dialog" aria-modal="true" aria-label="Open microblog" tabindex="-1">
<canvas class="splash-gl-canvas" id="splash-gl-canvas" aria-hidden="true"></canvas>
<div class="splash-stars" aria-hidden="true"></div>
<div class="splash-inner">
<div class="splash-orbit" aria-hidden="true"></div>
<div class="splash-title">snonux.foo</div>
<div class="splash-tag">Cosmos gate</div>
<div class="splash-hint">Engage — click or Enter</div>
</div>
</div>
<script>
(function(){
if(document.documentElement.classList.contains('sno-splash-skip'))return;
var cv=document.getElementById('splash-gl-canvas');
if(!cv||typeof THREE==='undefined')return;
var raf,ren,sc,ca,g=new THREE.Group(),t0=performance.now();
function cleanup(){window.removeEventListener('resize',sz);if(raf)cancelAnimationFrame(raf);raf=null;if(ren)ren.dispose();ren=null;window._snonuxSplashWebGLCleanup=null;}
window._snonuxSplashWebGLCleanup=cleanup;
function sz(){var w=cv.clientWidth||2,h=cv.clientHeight||2;if(ren)ren.setSize(w,h,false);if(ca){ca.aspect=w/h;ca.updateProjectionMatrix();}}
ren=new THREE.WebGLRenderer({canvas:cv,antialias:true,alpha:true});ren.setClearColor(0,0);ren.setPixelRatio(Math.min(window.devicePixelRatio||1,2));
sc=new THREE.Scene();ca=new THREE.PerspectiveCamera(48,1,0.1,90);ca.position.set(0,0.5,10);
var planet=new THREE.Mesh(new THREE.SphereGeometry(1.35,24,24),new THREE.MeshBasicMaterial({color:0xc8853a,transparent:true,opacity:0.92}));
var ring=new THREE.Mesh(new THREE.TorusGeometry(2.1,0.05,8,64),new THREE.MeshBasicMaterial({color:0xffd166,transparent:true,opacity:0.85}));
ring.rotation.x=Math.PI/2.25;var moon=new THREE.Mesh(new THREE.SphereGeometry(0.35,12,12),new THREE.MeshBasicMaterial({color:0x9b5de5,transparent:true,opacity:0.8}));
moon.position.set(2.8,0.6,0.5);g.add(planet);g.add(ring);g.add(moon);sc.add(g);sz();window.addEventListener('resize',sz);
function loop(now){raf=requestAnimationFrame(loop);var t=(now-t0)*0.001;g.rotation.y=t*0.22;planet.rotation.y=t*0.35;
moon.position.x=2.6*Math.cos(t*0.7);moon.position.z=2.6*Math.sin(t*0.7);ren.render(sc,ca);}
raf=requestAnimationFrame(loop);
})();
</script>
<canvas id="three-canvas"></canvas>
<div class="overlay">
<header>
<div class="logo">
<span class="logo-mark">SN</span>
<div class="logo-title">
<h1>snonux.foo</h1>
<p class="subtitle">microblog — <a href="https://foo.zone">foo.zone</a> is the real blog</p>
<p class="logo-host">Served by NetBSD on a Raspberry Pi 3</p>
</div>
</div>
<div class="nav">
<a href="atom.xml" class="header-feed-link" rel="alternate" title="Atom feed" type="application/atom+xml">Atom feed</a>
<a href="https://foo.zone/about" class="transmit-btn">Transmit</a>
</div>
</header>
{{template "navhints" .}}
<div class="content" id="post-content">
{{range $i, $post := .Posts}}
<div class="post" id="post-{{$post.ID}}" data-index="{{$i}}">
<div class="post-header">
<div><strong>@snonux</strong></div>
<div class="post-time">{{$post.FormattedTime}}</div>
</div>
<div class="post-text">{{$post.ContentHTML}}</div>
</div>
{{end}}
</div>
{{if or .PrevPage .NextPage}}
<footer class="page-nav-footer" aria-label="Pagination">
<div class="page-nav page-nav-dual">
{{if .PrevPage}}<a href="{{.PrevPage}}">← Newer</a>{{end}}
{{if .NextPage}}<a href="{{.NextPage}}">Older →</a>{{end}}
</div>
</footer>
{{end}}
</div>
{{template "navmodal" .}}
<script>
// Cosmos WebGL: ringed planet, swirling nebula blobs, asteroid belt, and stars.
// The planet sits at lower-right and slowly rotates; asteroids orbit it;
// nebula clouds drift with additive blending for a deep-space glow.
(function() {
var _wild = false;
var scene, camera, renderer, clock;
var planet, planetRings = [];
var asteroids = [];
var ASTEROID_COUNT = 300;
var asteroidAngles, asteroidRadii, asteroidSpeeds, asteroidY;
function buildPlanet() {
// Planet body — warm golden tone
planet = new THREE.Mesh(
new THREE.SphereGeometry(14, 48, 48),
new THREE.MeshPhongMaterial({
color: 0xc8853a, emissive: 0x3a1800, emissiveIntensity: 0.4, shininess: 60
})
);
planet.position.set(28, -18, -55);
scene.add(planet);
// Ring system — 5 tilted torus rings in gold/purple
var ringCols = [0xffd166, 0xc07c30, 0xffd166, 0x9b5de5, 0xffd166];
for (var i = 0; i < 5; i++) {
var ring = new THREE.Mesh(
new THREE.TorusGeometry(18 + i * 2.5, 0.5 - i * 0.06, 8, 128),
new THREE.MeshBasicMaterial({ color: ringCols[i], transparent: true, opacity: 0.55 - i * 0.08, side: THREE.DoubleSide })
);
ring.position.copy(planet.position);
ring.rotation.x = Math.PI / 2.4;
ring.rotation.z = 0.2;
scene.add(ring);
planetRings.push(ring);
}
}
function buildNebula() {
// Large translucent additive blobs for the nebula cloud
var nCols = [0x9b5de5, 0x4cc9f0, 0x7b2fff, 0x4cc9f0, 0x9b5de5];
var nPos = [[-30,20,-80],[-10,-10,-90],[20,30,-70],[-20,-25,-95],[10,15,-85]];
nCols.forEach(function(c, i) {
var mesh = new THREE.Mesh(
new THREE.SphereGeometry(22 + i * 4, 16, 16),
new THREE.MeshBasicMaterial({
color: c, transparent: true, opacity: 0.09,
blending: THREE.AdditiveBlending, depthWrite: false
})
);
mesh.position.set(nPos[i][0], nPos[i][1], nPos[i][2]);
scene.add(mesh);
});
}
function buildAsteroids() {
asteroidAngles = new Float32Array(ASTEROID_COUNT);
asteroidRadii = new Float32Array(ASTEROID_COUNT);
asteroidSpeeds = new Float32Array(ASTEROID_COUNT);
asteroidY = new Float32Array(ASTEROID_COUNT);
var geo = new THREE.BufferGeometry();
var pos = new Float32Array(ASTEROID_COUNT * 3);
for (var i = 0; i < ASTEROID_COUNT; i++) {
asteroidAngles[i] = Math.random() * Math.PI * 2;
asteroidRadii[i] = 20 + Math.random() * 12;
asteroidSpeeds[i] = 0.003 + Math.random() * 0.004;
asteroidY[i] = (Math.random() - 0.5) * 3;
pos[i*3] = pos[i*3+1] = pos[i*3+2] = 0;
}
geo.setAttribute('position', new THREE.BufferAttribute(pos, 3));
asteroids = new THREE.Points(geo, new THREE.PointsMaterial({
color: 0xaaaaaa, size: 0.3, transparent: true, opacity: 0.7
}));
// Asteroids orbit the planet — they live in planet-relative coords
planet.add(asteroids);
}
function buildStars() {
var pos = new Float32Array(2500 * 3);
for (var i = 0; i < 2500 * 3; i += 3) {
var r = 100 + Math.random() * 80, t = Math.random() * Math.PI * 2, p = Math.acos(2 * Math.random() - 1);
pos[i] = r * Math.sin(p) * Math.cos(t);
pos[i+1] = r * Math.sin(p) * Math.sin(t);
pos[i+2] = r * Math.cos(p);
}
var geo = new THREE.BufferGeometry();
geo.setAttribute('position', new THREE.BufferAttribute(pos, 3));
scene.add(new THREE.Points(geo, new THREE.PointsMaterial({ color: 0xffffff, size: 0.18, transparent: true, opacity: 0.85 })));
}
function initThree() {
scene = new THREE.Scene();
scene.background = new THREE.Color(0x020214);
scene.fog = new THREE.Fog(0x020214, 80, 200);
camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 0.1, 300);
camera.position.set(0, 6, 38);
camera.lookAt(0, 0, 0);
renderer = new THREE.WebGLRenderer({ canvas: document.getElementById('three-canvas'), antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
clock = new THREE.Clock();
scene.add(new THREE.AmbientLight(0x4cc9f0, 0.4));
var sun = new THREE.PointLight(0xffd166, 3, 300);
sun.position.set(-60, 40, 30);
scene.add(sun);
buildPlanet();
buildNebula();
buildAsteroids();
buildStars();
window.addEventListener('resize', onResize);
animate();
}
function onResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
function animate() {
requestAnimationFrame(animate);
var t = clock.getElapsedTime();
var sm = _wild ? 22 : 1;
planet.rotation.y += 0.0015 * sm;
// Planet rings tilt and counter-spin wildly
for (var ri = 0; ri < planetRings.length; ri++) {
planetRings[ri].rotation.y += 0.002 * sm;
planetRings[ri].rotation.z += 0.001 * sm * (ri % 2 === 0 ? 1 : -1);
}
// Asteroid belt: warp-speed orbit + radial breathing + vertical scatter in wild
var pos = asteroids.geometry.attributes.position;
for (var i = 0; i < ASTEROID_COUNT; i++) {
asteroidAngles[i] += asteroidSpeeds[i] * sm;
var a = asteroidAngles[i];
var r = asteroidRadii[i] + (_wild ? Math.sin(t * 2.1 + i * 0.3) * 9 : 0);
var y = asteroidY[i] + (_wild ? Math.sin(t * 3.0 + i * 0.7) * 2.5 : 0);
pos.setXYZ(i, Math.cos(a) * r, y, Math.sin(a) * r);
}
pos.needsUpdate = true;
// Camera: chaotic deep-space flight in wild, gentle orbit otherwise
if (_wild) {
camera.position.x = Math.sin(t * 0.38) * 20;
camera.position.y = 6 + Math.sin(t * 0.29) * 10;
camera.position.z = 38 + Math.sin(t * 0.21) * 14;
camera.fov = 60 + Math.sin(t * 0.47) * 18;
} else {
camera.position.x = Math.sin(t * 0.06) * 6;
camera.position.y = 6 + Math.sin(t * 0.04) * 2;
camera.position.z = 38;
camera.fov = 60;
}
camera.updateProjectionMatrix();
renderer.render(scene, camera);
}
initThree();
// Cosmos nav/wild effects — shooting star on navigate, warp speed on wild
window.snonuxOpenEffect = function(post) {
// Materialise from deep space — zoom + gold shimmer + orbiting ring
var modal = document.getElementById('post-modal');
if (modal) { modal.classList.add('sno-modal-zoom'); setTimeout(function() { modal.classList.remove('sno-modal-zoom'); }, 400); }
var r = post ? post.getBoundingClientRect() : {left: window.innerWidth/2, top: window.innerHeight/2, width: 0, height: 0};
var ring = document.createElement('div');
ring.style.cssText = 'position:fixed;top:' + (r.top+r.height/2-5) + 'px;left:' + (r.left+r.width/2-5) + 'px;z-index:997;pointer-events:none;width:10px;height:10px;border-radius:50%;border:2px solid rgba(255,209,102,0.85);box-shadow:0 0 12px rgba(155,93,229,0.5);transition:all 0.4s ease,opacity 0.4s';
document.body.appendChild(ring);
setTimeout(function() { ring.style.transform='scale(32)'; ring.style.opacity='0'; setTimeout(function() { ring.remove(); }, 440); }, 15);
};
window.snonuxCloseEffect = function() {
var d = document.createElement('div');
d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:radial-gradient(ellipse at center,rgba(155,93,229,0.12) 0%,transparent 65%);transition:opacity 0.25s';
document.body.appendChild(d);
setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 280); }, 15);
};
window.snonuxScrollEffect = function(dir) {
var isDown = dir === 'down';
var thick = _wild ? '14px' : '5px';
var d = document.createElement('div');
// Cosmos: purple-to-gold stardust streak
d.style.cssText = 'position:fixed;left:0;right:0;height:' + thick + ';z-index:9000;pointer-events:none;' +
'background:linear-gradient(90deg,transparent,rgba(155,93,229,0.9),rgba(255,200,0,0.9),rgba(155,93,229,0.9),transparent);' +
(isDown ? 'top:0;' : 'bottom:0;') +
'transition:transform 0.3s ease,opacity 0.3s ease;';
document.body.appendChild(d);
setTimeout(function() { d.style.transform = isDown ? 'translateY(100vh)' : 'translateY(-100vh)'; d.style.opacity='0'; }, 16);
setTimeout(function() { d.remove(); }, 380);
};
window.snonuxWildToggle = function() {
_wild = !_wild;
var b = document.getElementById('sno-wild-badge');
if (b) b.classList.toggle('sno-wild-on', _wild);
};
window.snonuxNavEffect = function() {
// Shooting star CSS line flashes across screen
var d = document.createElement('div');
var angle = 30 + Math.random() * 30;
d.style.cssText = 'position:fixed;top:' + (10+Math.random()*40) + '%;left:-10%;z-index:998;pointer-events:none;width:35%;height:2px;background:linear-gradient(90deg,transparent,rgba(255,209,102,0.9),transparent);transform:rotate(-' + angle + 'deg);transition:left 0.28s ease,opacity 0.28s';
document.body.appendChild(d);
setTimeout(function() { d.style.left='110%'; d.style.opacity='0'; setTimeout(function() { d.remove(); }, 320); }, 20);
};
window.snonuxPageEffect = function() {
// Warp flash — stars streak white
var d = document.createElement('div');
d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:radial-gradient(ellipse at center,rgba(255,255,255,0.25) 0%,transparent 70%);transition:opacity 0.2s';
document.body.appendChild(d);
setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 230); }, 20);
};
})();
</script>
{{template "navscript" .}}
</body>
</html>
|