diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-25 22:13:32 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-25 22:13:32 +0300 |
| commit | a5cb9f7ad4b2bcb7ac367854147f661ab83c5ec1 (patch) | |
| tree | 96db490ed72dec49c4bc2aba8539fd57f3246f47 /internal/generator/templates/themes/synthwave | |
| parent | cc9c69ce748416ad1d9b28592ec463434023d63c (diff) | |
can swap themes dynamicallyv0.12.0
Diffstat (limited to 'internal/generator/templates/themes/synthwave')
3 files changed, 266 insertions, 0 deletions
diff --git a/internal/generator/templates/themes/synthwave/meta.json b/internal/generator/templates/themes/synthwave/meta.json new file mode 100644 index 0000000..f92f49f --- /dev/null +++ b/internal/generator/templates/themes/synthwave/meta.json @@ -0,0 +1,7 @@ +{ + "title": "snonux.foo ⊕ SYNTHWAVE", + "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 \u0026mdash; \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 feed\u003c/a\u003e\n \u003ca href=\"https://foo.zone/about\" class=\"transmit-btn\"\u003eTRANSMIT TO NEXUS\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-grid\" aria-hidden=\"true\"\u003e\u003c/div\u003e\n \u003cdiv class=\"splash-inner\"\u003e\n \u003cdiv class=\"splash-sun\" aria-hidden=\"true\"\u003e\u003c/div\u003e\n \u003cdiv class=\"splash-title\"\u003esnonux.foo\u003c/div\u003e\n \u003cdiv class=\"splash-tag\"\u003eSynthwave uplink\u003c/div\u003e\n \u003cdiv class=\"splash-hint\"\u003eClick or Enter to ride the grid\u003c/div\u003e\n \u003c/div\u003e", + "prev_page_text": "\u0026larr; NEWER", + "next_page_text": "OLDER \u0026rarr;" +} diff --git a/internal/generator/templates/themes/synthwave/theme.css b/internal/generator/templates/themes/synthwave/theme.css new file mode 100644 index 0000000..0195e5f --- /dev/null +++ b/internal/generator/templates/themes/synthwave/theme.css @@ -0,0 +1,85 @@ + :root { --pink:#ff2d78; --purple:#bf3fff; --orange:#ff6b2b; --bg:#0d0221; } + * { margin:0; padding:0; box-sizing:border-box; } + body { font-family:'Russo One','Arial Black',sans-serif; background:var(--bg); + color:#fff; 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(13,2,33,0.82); backdrop-filter:blur(10px); + border-bottom:2px solid var(--pink); display:flex; align-items:center; justify-content:space-between; } + .logo { display:flex; align-items:center; gap:14px; } + .logo-mark { font-size:1.8rem; background:linear-gradient(90deg,var(--pink),var(--purple)); + -webkit-background-clip:text; -webkit-text-fill-color:transparent; } + .logo-title h1 { font-size:1.7rem; background:linear-gradient(90deg,var(--pink),var(--orange)); + -webkit-background-clip:text; -webkit-text-fill-color:transparent; letter-spacing:2px; } + .logo-title .subtitle { font-size:0.7rem; color:rgba(255,255,255,0.55); margin-top:2px; + font-family:'Share Tech Mono',monospace; } + .logo-title .subtitle a { color:var(--pink); text-decoration:none; } + .logo-title .subtitle a:hover { text-shadow:0 0 8px var(--pink); } + .transmit-btn { border:2px solid var(--orange); color:var(--orange); padding:10px 22px; + border-radius:4px; text-decoration:none; letter-spacing:1px; + font-size:0.88rem; transition:all 0.2s; } + .transmit-btn:hover { background:var(--orange); color:var(--bg); } + a.header-feed-link { color:var(--pink); font-family:'Share Tech Mono',monospace; } + .nav-hints { background:rgba(13,2,33,0.75); border-bottom:1px solid rgba(255,45,120,0.3); + color:rgba(255,255,255,0.45); padding:5px 20px; display:flex; gap:18px; + font-size:0.68rem; font-family:'Share Tech Mono',monospace; flex-wrap:wrap; } + .nav-hints kbd { background:rgba(255,45,120,0.15); border:1px solid rgba(255,45,120,0.4); + color:var(--pink); border-radius:3px; padding:0 5px; margin:0 2px; font-size:0.7rem; } + .content { flex:1; overflow-y:auto; padding:22px 28px; + scrollbar-width:thin; scrollbar-color:var(--pink) var(--bg); } + .page-nav { display:flex; justify-content:center; margin:14px 0; } + .page-nav a { border:2px solid var(--purple); color:var(--purple); padding:8px 22px; + border-radius:4px; text-decoration:none; letter-spacing:2px; 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(13,2,33,0.82); backdrop-filter:blur(10px); + border-top:2px solid var(--pink); } + .post { background:rgba(20,5,50,0.85); border:1px solid var(--purple); border-radius:6px; + padding:22px; margin-bottom:18px; cursor:pointer; transition:all 0.25s; } + .post:hover { border-color:var(--pink); box-shadow:0 0 22px rgba(255,45,120,0.35); transform:translateY(-3px); } + .post-active { border-color:var(--orange) !important; background:rgba(30,8,60,0.96) !important; + box-shadow:0 0 22px rgba(255,107,43,0.45),inset 3px 0 0 var(--orange) !important; } + .post-header { display:flex; justify-content:space-between; margin-bottom:14px; } + .post-time { color:var(--orange); font-family:'Share Tech Mono',monospace; font-size:0.85rem; } + .post-text { line-height:1.6; font-size:0.95rem; font-family:'Share Tech Mono',monospace; } + .post-text a { color:var(--pink); text-decoration:none; } + .post-audio { width:100%; margin-top:10px; } + .post-modal { display:none; position:fixed; inset:0; z-index:100; + background:rgba(13,2,33,0.96); overflow-y:auto; padding:40px 20px; } + .post-modal.active { display:block; } + .modal-inner { max-width:780px; margin:0 auto; background:rgba(20,5,50,0.98); + border:2px solid var(--pink); border-radius:6px; + box-shadow:0 0 60px rgba(255,45,120,0.35); padding:38px; } + .modal-close { float:right; background:none; border:none; color:var(--orange); + font-family:'Russo One',sans-serif; font-size:0.9rem; cursor:pointer; letter-spacing:2px; } + @media(max-width:640px) { .nav-hints{display:none;} header{padding:12px 18px;} } + [data-sno-theme="synthwave"] .splash-overlay { + background: linear-gradient(180deg, #2a0a3e 0%, var(--bg) 38%, #1a0630 100%); + } + [data-sno-theme="synthwave"] .splash-grid { + position:absolute; inset:0; opacity:0.35; pointer-events:none; z-index:1; + background: linear-gradient(90deg, rgba(255,45,120,0.08) 1px, transparent 1px) 0 0 / 48px 48px, + linear-gradient(rgba(191,63,255,0.06) 1px, transparent 1px) 0 0 / 48px 48px; + transform: perspective(280px) rotateX(68deg) scale(2.2); + transform-origin: 50% 85%; + animation: splashGridDrift 10s linear infinite; + } + @keyframes splashGridDrift { to { background-position: 48px 48px, 0 96px; } } + [data-sno-theme="synthwave"] .splash-sun { + width:min(140px,35vw); height:min(140px,35vw); margin:0 auto 1rem; border-radius:50%; + background: radial-gradient(circle, var(--orange) 0%, var(--pink) 45%, transparent 70%); + box-shadow: 0 0 60px var(--pink), 0 0 100px var(--orange); + animation: splashSunPulse 2.5s ease-in-out infinite alternate; + } + @keyframes splashSunPulse { + from { transform: scale(0.95); opacity: 0.85; } + to { transform: scale(1.05); opacity: 1; } + } + [data-sno-theme="synthwave"] .splash-title { + font-family:'Russo One',sans-serif; font-size:clamp(1.5rem,5vw,2.2rem); + background: linear-gradient(90deg,var(--pink),var(--orange)); + -webkit-background-clip:text; -webkit-text-fill-color:transparent; + } + [data-sno-theme="synthwave"] .splash-tag { font-family:'Share Tech Mono',monospace; color:var(--purple); } + [data-sno-theme="synthwave"] .splash-hint { font-family:'Share Tech Mono',monospace; color:rgba(255,255,255,0.88); } + [data-sno-theme="synthwave"] .splash-inner { text-shadow: 0 2px 20px rgba(13,2,33,0.95); } diff --git a/internal/generator/templates/themes/synthwave/theme.js b/internal/generator/templates/themes/synthwave/theme.js new file mode 100644 index 0000000..7be585e --- /dev/null +++ b/internal/generator/templates/themes/synthwave/theme.js @@ -0,0 +1,174 @@ + + (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(58,1,0.1,120);ca.position.set(0,1.2,7); + var sun=new THREE.Mesh(new THREE.SphereGeometry(1.35,28,28),new THREE.MeshBasicMaterial({color:0xff6b2b,transparent:true,opacity:0.95})); + sun.position.y=2.1;g.add(sun); + var gr=new THREE.Mesh(new THREE.PlaneGeometry(28,28,20,20),new THREE.MeshBasicMaterial({color:0xbf3fff,wireframe:true,transparent:true,opacity:0.4})); + gr.rotation.x=-Math.PI/2.15;gr.position.y=-2.4;g.add(gr); + sc.add(g);sz();window.addEventListener('resize',sz); + function loop(now){raf=requestAnimationFrame(loop);var t=(now-t0)*0.001;g.rotation.y=Math.sin(t*0.35)*0.08;sun.position.y=2.1+Math.sin(t*1.2)*0.08;sun.scale.setScalar(1+Math.sin(t*2)*0.04);ren.render(sc,ca);} + raf=requestAnimationFrame(loop); + })(); + + + // Synthwave WebGL: glowing sunset sphere with horizontal scan-line rings, + // a receding grid floor, and pink star particles. Replaces CSS sky/grid. + (function() { + var _wild = false, _snoTOffset = 0, _snoLastT = 0; + var scene, camera, renderer, clock; + var sun, sunRings = []; + + function initThree() { + scene = new THREE.Scene(); + scene.background = new THREE.Color(0x0d0221); + scene.fog = new THREE.Fog(0x0d0221, 60, 180); + + camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 0.1, 300); + camera.position.set(0, 10, 45); + camera.lookAt(0, -5, -10); + + 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(); + + // Glowing orange sunset sphere + sun = new THREE.Mesh( + new THREE.SphereGeometry(12, 32, 16), + new THREE.MeshBasicMaterial({ color: 0xff6b2b }) + ); + sun.position.set(0, -8, -55); + scene.add(sun); + + // Horizontal scan-line rings — alternating pink/purple, stacked on the sun + var ringColors = [0xff2d78, 0xbf3fff, 0xff2d78, 0xbf3fff, 0xff2d78, 0xbf3fff, 0xff2d78, 0xbf3fff]; + for (var i = 0; i < 8; i++) { + var ring = new THREE.Mesh( + new THREE.TorusGeometry(13 + i * 1.2, 0.09, 8, 64), + new THREE.MeshBasicMaterial({ color: ringColors[i] }) + ); + ring.position.copy(sun.position); + ring.position.y += -4 + i * 1.1; + scene.add(ring); + sunRings.push(ring); + } + + // Receding grid floor + var grid = new THREE.GridHelper(200, 40, 0xff2d78, 0x4a0060); + grid.position.set(0, -18, -30); + scene.add(grid); + + // 1200 star particles scattered in a sphere shell + var starPos = new Float32Array(1200 * 3); + for (var j = 0; j < 1200 * 3; j += 3) { + var r = 80 + Math.random() * 40; + var theta = Math.random() * Math.PI * 2; + var phi = Math.acos(2 * Math.random() - 1); + starPos[j] = r * Math.sin(phi) * Math.cos(theta); + starPos[j+1] = r * Math.sin(phi) * Math.sin(theta); + starPos[j+2] = r * Math.cos(phi); + } + var starGeo = new THREE.BufferGeometry(); + starGeo.setAttribute('position', new THREE.BufferAttribute(starPos, 3)); + scene.add(new THREE.Points(starGeo, new THREE.PointsMaterial({ + color: 0xff88aa, size: 0.2, transparent: true, opacity: 0.7 + }))); + + 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 realT = clock.getElapsedTime(); + _snoTOffset += (realT - _snoLastT) * (_wild ? 9 : 0); + _snoLastT = realT; + var t = realT + _snoTOffset; + // Sun pulses subtly; wild mode makes it throb dramatically + var pulse = _wild ? 1 + 0.12 * Math.sin(t * 8) : 1 + 0.015 * Math.sin(t * 1.5); + sun.scale.setScalar(pulse); + sunRings.forEach(function(r) { r.scale.setScalar(pulse); }); + // Camera: warp-drive rush in wild, gentle sway otherwise + if (_wild) { + camera.position.x = Math.sin(realT * 0.35) * 16; + camera.position.y = 10 + Math.sin(realT * 0.28) * 9; + camera.position.z = 45 + Math.sin(realT * 0.23) * 18; + camera.fov = 60 + Math.sin(realT * 0.46) * 16; + camera.updateProjectionMatrix(); + } else { + camera.position.x = Math.sin(t * 0.08) * 4; + camera.position.y = 10; + camera.position.z = 45; + if (camera.fov !== 60) { camera.fov = 60; camera.updateProjectionMatrix(); } + } + renderer.render(scene, camera); + } + + initThree(); + + // Synthwave nav/wild effects — grid zoom on navigate, turbo drive on wild + window.snonuxOpenEffect = function() { + // Fly up from the grid floor + neon scan line + var modal = document.getElementById('post-modal'); + if (modal) { modal.classList.add('sno-modal-fly'); setTimeout(function() { modal.classList.remove('sno-modal-fly'); }, 390); } + // Pink scan line rises from bottom + var line = document.createElement('div'); + line.style.cssText = 'position:fixed;bottom:0;left:0;right:0;height:3px;z-index:997;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(255,45,120,0.9),rgba(191,63,255,0.9),transparent);box-shadow:0 0 12px rgba(255,45,120,0.6);transition:bottom 0.32s ease,opacity 0.12s 0.32s'; + document.body.appendChild(line); + setTimeout(function() { line.style.bottom='100vh'; setTimeout(function() { line.style.opacity='0'; setTimeout(function() { line.remove(); }, 140); }, 320); }, 15); + }; + window.snonuxCloseEffect = function() { + var d = document.createElement('div'); + d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:linear-gradient(180deg,transparent 50%,rgba(255,45,120,0.12) 100%);transition:opacity 0.2s'; + document.body.appendChild(d); + setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 230); }, 15); + }; + window.snonuxScrollEffect = function(dir) { + var isDown = dir === 'down'; + var thick = _wild ? '14px' : '5px'; + var d = document.createElement('div'); + // Synthwave: hot pink retrowave beam + d.style.cssText = 'position:fixed;left:0;right:0;height:' + thick + ';z-index:9000;pointer-events:none;' + + 'background:linear-gradient(90deg,transparent,rgba(255,0,128,0.95),rgba(255,0,200,0.95),rgba(255,0,128,0.95),transparent);' + + (isDown ? 'top:0;' : 'bottom:0;') + + 'transition:transform 0.28s ease,opacity 0.28s ease;'; + document.body.appendChild(d); + setTimeout(function() { d.style.transform = isDown ? 'translateY(100vh)' : 'translateY(-100vh)'; d.style.opacity='0'; }, 16); + setTimeout(function() { d.remove(); }, 360); + }; + window.snonuxWildToggle = function() { + _wild = !_wild; + var b = document.getElementById('sno-wild-badge'); + if (b) b.classList.toggle('sno-wild-on', _wild); + }; + window.snonuxNavEffect = function() { + // Grid zoom forward + var ov = document.querySelector('.overlay'); + if (ov) { ov.classList.add('sno-fx-zoom'); setTimeout(function() { ov.classList.remove('sno-fx-zoom'); }, 330); } + var d = document.createElement('div'); + d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:linear-gradient(180deg,transparent 40%,rgba(255,45,120,0.2) 100%);transition:opacity 0.2s'; + document.body.appendChild(d); + setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 230); }, 20); + }; + window.snonuxPageEffect = function() { + // Warp-speed tunnel flash + var d = document.createElement('div'); + d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:radial-gradient(ellipse at 50% 100%,rgba(255,107,43,0.35) 0%,transparent 65%);transform:scaleY(0.2);transition:transform 0.22s ease,opacity 0.22s ease'; + document.body.appendChild(d); + setTimeout(function() { d.style.transform='scaleY(1.4)'; d.style.opacity='0'; setTimeout(function() { d.remove(); }, 250); }, 20); + }; + })(); |
