summaryrefslogtreecommitdiff
path: root/internal/generator/templates/themes/matrix
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-25 22:13:32 +0300
committerPaul Buetow <paul@buetow.org>2026-04-25 22:13:32 +0300
commita5cb9f7ad4b2bcb7ac367854147f661ab83c5ec1 (patch)
tree96db490ed72dec49c4bc2aba8539fd57f3246f47 /internal/generator/templates/themes/matrix
parentcc9c69ce748416ad1d9b28592ec463434023d63c (diff)
can swap themes dynamicallyv0.12.0
Diffstat (limited to 'internal/generator/templates/themes/matrix')
-rw-r--r--internal/generator/templates/themes/matrix/meta.json7
-rw-r--r--internal/generator/templates/themes/matrix/theme.css76
-rw-r--r--internal/generator/templates/themes/matrix/theme.js172
3 files changed, 255 insertions, 0 deletions
diff --git a/internal/generator/templates/themes/matrix/meta.json b/internal/generator/templates/themes/matrix/meta.json
new file mode 100644
index 0000000..ac07e29
--- /dev/null
+++ b/internal/generator/templates/themes/matrix/meta.json
@@ -0,0 +1,7 @@
+{
+ "title": "snonux.foo // MATRIX",
+ "header_html": "\u003cdiv class=\"logo\"\u003e\n \u003cspan class=\"logo-mark\"\u003eSN\u003c/span\u003e\n \u003cdiv class=\"logo-title\"\u003e\n \u003ch1\u003eSNONUX.FOO\u003c/h1\u003e\n \u003cp class=\"subtitle\"\u003eMICROBLOG / \u003ca href=\"https://foo.zone\"\u003eFOO.ZONE\u003c/a\u003e IS THE REAL BLOG\u003c/p\u003e\n \u003cp class=\"logo-host\"\u003eServed by NetBSD on a Raspberry Pi 3\u003c/p\u003e\n \u003c/div\u003e\n \u003c/div\u003e\n \u003cdiv class=\"nav\"\u003e\n \u003ca href=\"atom.xml\" class=\"header-feed-link\" rel=\"alternate\" title=\"Atom feed\" type=\"application/atom+xml\"\u003eatom.xml\u003c/a\u003e\n \u003ca href=\"https://foo.zone/about\" class=\"transmit-btn\"\u003eTRANSMIT\u003c/a\u003e\n \u003c/div\u003e",
+ "splash_inner_html": "\u003ccanvas class=\"splash-gl-canvas\" id=\"splash-gl-canvas\" aria-hidden=\"true\"\u003e\u003c/canvas\u003e\n \u003cdiv class=\"splash-rain\" aria-hidden=\"true\"\u003e01001110 01000101 01001111\n10101010 11001100 00110011\n01110011 01101110 01101111\n11001010 10100101 01011010\u003c/div\u003e\n \u003cdiv class=\"splash-inner\"\u003e\n \u003cdiv class=\"splash-title\"\u003eSNONUX.FOO\u003c/div\u003e\n \u003cdiv class=\"splash-tag\"\u003eFollow the signal\u003c/div\u003e\n \u003cdiv class=\"splash-hint\"\u003ewake up — click or enter\u003c/div\u003e\n \u003c/div\u003e",
+ "prev_page_text": "\u0026lt;-- NEWER",
+ "next_page_text": "OLDER --\u0026gt;"
+}
diff --git a/internal/generator/templates/themes/matrix/theme.css b/internal/generator/templates/themes/matrix/theme.css
new file mode 100644
index 0000000..8254d45
--- /dev/null
+++ b/internal/generator/templates/themes/matrix/theme.css
@@ -0,0 +1,76 @@
+ :root { --g:#00ff41; --g2:#008f11; --g3:#003b00; --bg:#000; }
+ * { margin:0; padding:0; box-sizing:border-box; }
+ body { font-family:'Courier New',Courier,monospace; background:var(--bg); color:var(--g);
+ overflow:hidden; height:100vh; }
+ /* scanline overlay sits above WebGL */
+ body::before { content:''; position:fixed; inset:0; z-index:999; pointer-events:none;
+ background:repeating-linear-gradient(0deg,transparent,transparent 3px,
+ rgba(0,0,0,0.08) 3px,rgba(0,0,0,0.08) 4px); }
+ @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
+ /* WebGL background canvas */
+ #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:12px 24px; background:#000; border-bottom:1px solid var(--g2);
+ display:flex; align-items:center; justify-content:space-between; }
+ .logo { display:flex; align-items:center; gap:14px; }
+ .logo-mark { font-size:1.8rem; color:var(--g); text-shadow:0 0 18px var(--g); letter-spacing:3px; }
+ /* blinking cursor after logo mark */
+ .logo-mark::after { content:'_'; animation:blink 1.2s step-start infinite; }
+ .logo-title h1 { font-size:1.2rem; color:var(--g); text-shadow:0 0 10px var(--g);
+ letter-spacing:4px; font-weight:normal; }
+ .logo-title .subtitle { font-size:0.72rem; color:var(--g2); margin-top:2px; letter-spacing:1px; }
+ .logo-title .subtitle a { color:var(--g); text-decoration:none; }
+ .logo-title .subtitle a:hover { text-shadow:0 0 6px var(--g); }
+ .transmit-btn { border:1px solid var(--g2); color:var(--g); padding:8px 18px;
+ text-decoration:none; font-size:0.82rem; letter-spacing:2px;
+ transition:all 0.1s; }
+ .transmit-btn:hover { background:var(--g); color:var(--bg); }
+ a.header-feed-link { color:var(--g2); }
+ a.header-feed-link:hover { color:var(--g); text-shadow:0 0 8px var(--g); }
+ .nav-hints { background:#000; border-bottom:1px solid var(--g3); color:var(--g2);
+ padding:4px 24px; display:flex; gap:18px; font-size:0.68rem; flex-wrap:wrap; }
+ .nav-hints kbd { background:transparent; border:1px solid var(--g3); color:var(--g);
+ padding:0 5px; font-size:0.68rem; margin:0 2px; }
+ .content { flex:1; overflow-y:auto; padding:14px 24px;
+ scrollbar-width:thin; scrollbar-color:var(--g2) var(--bg); }
+ .page-nav { display:flex; justify-content:center; margin:12px 0; }
+ .page-nav a { border:1px solid var(--g2); color:var(--g); padding:7px 20px;
+ text-decoration:none; font-size:0.82rem; letter-spacing:2px; }
+ .page-nav a:hover { background:var(--g); color:var(--bg); }
+ .page-nav-footer { flex-shrink:0; padding:6px 24px; display:flex; justify-content:center;
+ background:#000; border-top:1px solid var(--g2); }
+ .post { background:#000; border:1px solid var(--g3); padding:16px 18px;
+ margin-bottom:10px; cursor:pointer; transition:border-color 0.15s; }
+ .post:hover { border-color:var(--g2); box-shadow:0 0 8px rgba(0,255,65,0.2); }
+ .post-active { border-color:var(--g) !important; background:rgba(0,255,65,0.03) !important;
+ box-shadow:0 0 14px rgba(0,255,65,0.3),inset 3px 0 0 var(--g) !important; }
+ .post-header { display:flex; justify-content:space-between; margin-bottom:10px; font-size:0.85rem; }
+ .post-time { color:var(--g2); font-size:0.78rem; }
+ .post-text { line-height:1.6; font-size:0.88rem; }
+ .post-text a { color:var(--g); text-decoration:underline; }
+ .post-image { max-width:100%; margin-top:10px; border:1px solid var(--g3); }
+ .post-audio { width:100%; margin-top:10px; }
+ .post-modal { display:none; position:fixed; inset:0; z-index:100;
+ background:rgba(0,0,0,0.98); overflow-y:auto; padding:40px 20px; }
+ .post-modal.active { display:block; }
+ .modal-inner { max-width:740px; margin:0 auto; background:#000;
+ border:1px solid var(--g); padding:36px;
+ box-shadow:0 0 40px rgba(0,255,65,0.25); }
+ .modal-close { float:right; background:none; border:none; color:var(--g2);
+ font-family:monospace; font-size:0.9rem; cursor:pointer; letter-spacing:2px; }
+ @media(max-width:640px) { .nav-hints{display:none;} header{padding:10px 16px;} .content{padding:10px 16px;} }
+ [data-sno-theme="matrix"] .splash-overlay { background: #000; font-family:'Courier New',monospace; }
+ [data-sno-theme="matrix"] .splash-rain {
+ position:absolute; inset:0; overflow:hidden; pointer-events:none; opacity:0.35; z-index:1;
+ font-size:11px; line-height:14px; color:var(--g2); text-align:left; padding:8px;
+ white-space:pre; animation: splashMatrixScroll 16s linear infinite;
+ }
+ @keyframes splashMatrixScroll { to { transform: translateY(-24px); } }
+ [data-sno-theme="matrix"] .splash-title {
+ position:relative; z-index:1; font-size:clamp(1.1rem,3.5vw,1.5rem); color:var(--g);
+ text-shadow:0 0 20px var(--g); letter-spacing:0.35em;
+ animation: splashMatrixGlow 1.8s ease-in-out infinite alternate;
+ }
+ @keyframes splashMatrixGlow { from { opacity:0.85; } to { opacity:1; text-shadow:0 0 28px var(--g); } }
+ [data-sno-theme="matrix"] .splash-tag { position:relative; z-index:1; color:rgba(0,255,65,0.88); }
+ [data-sno-theme="matrix"] .splash-hint { position:relative; z-index:1; color:rgba(0,255,65,0.82); }
diff --git a/internal/generator/templates/themes/matrix/theme.js b/internal/generator/templates/themes/matrix/theme.js
new file mode 100644
index 0000000..7ca694f
--- /dev/null
+++ b/internal/generator/templates/themes/matrix/theme.js
@@ -0,0 +1,172 @@
+
+ (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,pts,pos,t0=performance.now(),N=28,i,arr;
+ 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(55,1,0.1,80);ca.position.set(0,0.5,10);
+ arr=new Float32Array(N*3*20);for(i=0;i<arr.length;i+=3){arr[i]=(Math.random()-0.5)*16;arr[i+1]=Math.random()*22;arr[i+2]=(Math.random()-0.5)*8;}
+ var geo=new THREE.BufferGeometry();geo.setAttribute('position',new THREE.BufferAttribute(arr,3));
+ pts=new THREE.Points(geo,new THREE.PointsMaterial({color:0x00ff41,size:0.14,transparent:true,opacity:0.85,blending:THREE.AdditiveBlending,depthWrite:false,sizeAttenuation:true}));
+ sc.add(pts);pos=geo.attributes.position;sz();window.addEventListener('resize',sz);
+ function loop(now){raf=requestAnimationFrame(loop);var t=(now-t0)*0.001,j,p;
+ for(j=0;j<pos.count;j++){p=j*3;pos.array[p+1]-=0.045+Math.sin(t+j*0.1)*0.012;if(pos.array[p+1]<-2)pos.array[p+1]=20;}
+ pos.needsUpdate=true;pts.rotation.y=t*0.15;ren.render(sc,ca);}
+ raf=requestAnimationFrame(loop);
+ })();
+
+
+ // Matrix WebGL scene: 80 columns of falling particles with per-vertex colour.
+ // Each column has a "head" that falls at a random speed; particles near the head
+ // are bright green and fade to near-black further behind, simulating digital rain.
+ (function() {
+ var _wild = false;
+ var NUM_COLS = 80; // number of rain columns
+ var COL_LEN = 25; // particles per column
+ var SPACING = 2.2; // vertical gap between particles in a column
+ var Y_TOP = 30; // world-space top of the rain field
+ var Y_BOTTOM = -30; // world-space bottom
+
+ var scene, camera, renderer;
+ var points;
+ var posArr, colArr;
+ // Per-column state: x position, head y, and fall speed
+ var colX = [], headY = [], speed = [];
+
+ function initThree() {
+ scene = new THREE.Scene();
+ scene.background = new THREE.Color(0x000000);
+
+ camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 200);
+ camera.position.set(0, 0, 50);
+
+ renderer = new THREE.WebGLRenderer({ canvas: document.getElementById('three-canvas'), antialias: false });
+ renderer.setSize(window.innerWidth, window.innerHeight);
+ renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
+
+ var totalPts = NUM_COLS * COL_LEN;
+ posArr = new Float32Array(totalPts * 3);
+ colArr = new Float32Array(totalPts * 3);
+
+ // Spread columns across x: -50..50; initialise heads at random y positions
+ for (var c = 0; c < NUM_COLS; c++) {
+ colX[c] = -50 + (c / (NUM_COLS - 1)) * 100;
+ headY[c] = Y_TOP - Math.random() * (Y_TOP - Y_BOTTOM);
+ speed[c] = 0.08 + Math.random() * 0.07; // 0.08–0.15 units per frame
+ }
+
+ var geo = new THREE.BufferGeometry();
+ geo.setAttribute('position', new THREE.BufferAttribute(posArr, 3));
+ geo.setAttribute('color', new THREE.BufferAttribute(colArr, 3));
+
+ var mat = new THREE.PointsMaterial({ size: 0.35, vertexColors: true });
+ points = new THREE.Points(geo, mat);
+ scene.add(points);
+
+ 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);
+
+ for (var c = 0; c < NUM_COLS; c++) {
+ // Advance the head downward each frame; wild mode accelerates rain 10x
+ headY[c] -= speed[c] * (_wild ? 10 : 1);
+ // When the head exits the bottom, reset to a random point above the top
+ if (headY[c] < Y_BOTTOM - COL_LEN * SPACING) {
+ headY[c] = Y_TOP + Math.random() * 20;
+ }
+
+ var base = c * COL_LEN;
+ for (var p = 0; p < COL_LEN; p++) {
+ var i = base + p;
+ var y = headY[c] + p * SPACING; // particles trail upward from head
+ posArr[i * 3] = colX[c];
+ posArr[i * 3 + 1] = y;
+ posArr[i * 3 + 2] = 0;
+
+ // Brightness falls off with distance behind the head:
+ // p=0 is the head (bright), p=COL_LEN-1 is the tail (dim)
+ var bright = Math.max(0, 1 - p / (COL_LEN * 0.7));
+ // Head particle: #00ff41, tail: #003b00
+ colArr[i * 3] = 0;
+ colArr[i * 3 + 1] = bright * (p === 0 ? 1.0 : 0.88);
+ colArr[i * 3 + 2] = bright * (p === 0 ? 0.255 : 0.04);
+ }
+ }
+
+ points.geometry.attributes.position.needsUpdate = true;
+ points.geometry.attributes.color.needsUpdate = true;
+ // Wild: camera plunges into the rain like riding a digital waterfall
+ if (_wild) {
+ var wt = Date.now() * 0.001;
+ camera.position.z = 50 + Math.sin(wt * 0.38) * 20;
+ camera.position.x = Math.sin(wt * 0.31) * 14;
+ camera.fov = 60 + Math.sin(wt * 0.51) * 18;
+ camera.updateProjectionMatrix();
+ } else {
+ camera.position.z = 50;
+ camera.position.x = 0;
+ if (camera.fov !== 60) { camera.fov = 60; camera.updateProjectionMatrix(); }
+ }
+ renderer.render(scene, camera);
+ }
+
+ initThree();
+
+ // Matrix nav/wild effects — shake + green flash on navigate, rain storm on wild
+ window.snonuxOpenEffect = function() {
+ // Slide in from left like terminal output decoding
+ var modal = document.getElementById('post-modal');
+ if (modal) { modal.classList.add('sno-modal-slide'); setTimeout(function() { modal.classList.remove('sno-modal-slide'); }, 380); }
+ var d = document.createElement('div');
+ d.style.cssText = 'position:fixed;inset:0;z-index:997;pointer-events:none;background:rgba(0,255,65,0.1);transition:opacity 0.2s';
+ document.body.appendChild(d);
+ setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 230); }, 15);
+ };
+ window.snonuxCloseEffect = function() {
+ var ov = document.querySelector('.overlay');
+ if (ov) { ov.classList.add('sno-fx-glitch'); setTimeout(function() { ov.classList.remove('sno-fx-glitch'); }, 280); }
+ };
+ window.snonuxScrollEffect = function(dir) {
+ var isDown = dir === 'down';
+ var thick = _wild ? '14px' : '5px';
+ var d = document.createElement('div');
+ d.style.cssText = 'position:fixed;left:0;right:0;height:' + thick + ';z-index:9000;pointer-events:none;' +
+ 'background:linear-gradient(90deg,transparent,rgba(0,255,70,0.88),rgba(0,200,50,0.88),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() {
+ var ov = document.querySelector('.overlay');
+ if (ov) { ov.classList.add('sno-fx-shake'); setTimeout(function() { ov.classList.remove('sno-fx-shake'); }, 380); }
+ var d = document.createElement('div');
+ d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:rgba(0,255,65,0.15);transition:opacity 0.2s';
+ document.body.appendChild(d);
+ setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 220); }, 30);
+ };
+ window.snonuxPageEffect = function() {
+ // Glitch bars — horizontal displacement flicker
+ var ov = document.querySelector('.overlay');
+ if (ov) { ov.classList.add('sno-fx-glitch'); setTimeout(function() { ov.classList.remove('sno-fx-glitch'); }, 320); }
+ };
+ })();