interplane.Get Omega
Read in your language

aienos.com

Source of www.aienos.com, served from my own hardware

Brought by drakestapleton

branch main Branches Tags History

aienos.com / om / site / client.om

12 lines · 10675 bytes Raw Blame History
1note Aien-first progressive experience. No navigation bar, synthetic chat, tracking request or automatic relay.
2note Scene readiness, the opening and the chirp belong to aien-universe.js (data-sky, data-formed, #aien-replay); transport to AllenChat.
3note Draft interface agreed with AllenChat: /aien/#draft=<encoded text>, max 2000 characters, never auto-send.
4text sjsite0 "/* Generated by om/site/client.om. Do not edit the generated asset. */\n(() => {\n'use strict';\nconst byId = id => document.getElementById(id);\nconst reduced = matchMedia('(prefers-reduced-motion: reduce)');\nfunction loadLocal(key) {\n for (const kind of ['localStorage', 'sessionStorage']) {\n try { const value = window[kind].getItem(key); if (value !== null) return value; } catch (_) {}\n }\n return null;\n}\nfunction saveLocal(key, value) {\n let saved = false;\n for (const kind of ['localStorage', 'sessionStorage']) {\n try { window[kind].setItem(key, value); saved = true; } catch (_) {}\n }\n return saved;\n}\nfunction eraseLocal(key) {\n for (const kind of ['localStorage', 'sessionStorage']) { try { window[kind].removeItem(key); } catch (_) {} }\n}\nfunction navigation() {\n document.querySelectorAll('[data-site-mode]').forEach(link => {\n link.addEventListener('click', () => {\n const mode = link.dataset.siteMode;\n if (mode === 'allen' || mode === 'classic') saveLocal('aienos-site-mode', mode);\n });\n });\n document.querySelectorAll('.site-index').forEach(index => {\n index.addEventListener('keydown', event => {\n if (event.key === 'Escape' && index.open) { event.preventDefault(); index.open = false; index.querySelector('summary').focus(); }\n });\n });\n}\n"
5text sjsite1 "function homeDoor() {\n const door = byId('site-door');\n if (!door) return;\n const enter = byId('site-door-enter'), skip = byId('site-door-skip');\n const status = byId('site-door-status'), choice = byId('site-mode-choice');\n const stay = byId('site-stay-allen'), welcome = byId('site-welcome-status');\n const root = byId('allen'), opening = byId('aien-replay');\n const key = 'aienos-intro-seen', modeKey = 'aienos-site-mode';\n const replay = location.hash === '#site-door';\n const savedMode = loadLocal(modeKey);\n // Visiting /aien/ is an explicit choice, regardless of an old homepage preference.\n let ready = false, done = false, playing = false, returnFocus = null;\n // aien-universe.js owns the sky (#aien-sky) and the chirp: it marks\n // #allen data-sky on or off once the native scene loads, data-formed yes when\n // the opening ends, and its replay control plays the opening from the tube\n // with sound armed by the activating click.\n function activate() {\n if (!choice.hidden) stay.focus({preventScroll:true});\n else if (returnFocus && returnFocus.isConnected) returnFocus.focus({preventScroll:true});\n returnFocus = null;\n }\n function finish(skipped = false, message = '') {\n if (done) return;\n done = true; playing = false;\n if (skipped && window.AllenAudio) window.AllenAudio.stop();\n saveLocal(key, '1'); door.hidden = true;\n const selected = loadLocal(modeKey);\n choice.hidden = selected === 'allen' || selected === 'classic';\n welcome.textContent = message;\n welcome.hidden = !message;\n activate();\n }\n function unavailable() {\n ready = false; enter.disabled = true;\n finish(true, 'The opening is unavailable. Aien and the complete classic site are still here.');\n }\n function offer() {\n if (ready || !root) return;\n if (root.dataset.sky === 'off' || !opening) { unavailable(); return; }\n if (root.dataset.sky !== 'on') return;\n if (!window.AllenAudio) { unavailable(); return; }\n ready = true;\n if (!done) { enter.disabled = false; status.textContent = 'An optional native introduction. Enter with sound, or skip.'; }\n }\n function reset() {\n done = false; playing = false;\n welcome.hidden = true; choice.hidden = true; door.hidden = false;\n door.dataset.playing = 'false'; enter.hidden = false; enter.disabled = !ready;\n status.textContent = ready ? 'An optional native introduction. Enter with sound, or skip.' : 'Aien is loading. Skip is always available.';\n if (reduced.matches) finish(true, 'Reduced motion is on. Welcome to Aien.');\n }\n enter.addEventListener('click', () => {\n if (!ready || done || playing || reduced.matches) return;\n playing = true; door.dataset.playing = 'true'; enter.hidden = true;\n status.textContent = 'Skip or press Escape at any time.'; skip.focus({preventScroll:true});\n // Still inside this click: the replay arms the chirp, so audio starts here and nowhere else.\n opening.click();\n });\n skip.addEventListener('click', event => { event.preventDefault(); finish(true); });\n stay.addEventListener('click', () => {\n saveLocal(modeKey, 'allen'); choice.hidden = true; welcome.hidden = true;\n activate();\n });\n // The universe arms sound on the first pointer or key press anywhere. A press\n // on the door's own controls is the door's to answer, so it stops at window.\n for (const kind of ['pointerdown', 'keydown']) {\n window.addEventListener(kind, event => {\n if (event.key === 'Escape' && !done) {\n event.preventDefault(); event.stopImmediatePropagation(); finish(true);\n } else if (event.key === 'Escape' && !choice.hidden) {\n event.preventDefault(); choice.hidden = true; activate();\n } else if (!door.hidden && door.contains(event.target)) event.stopPropagation();\n }, true);\n }\n document.querySelectorAll('[data-site-replay]').forEach(link => {\n link.addEventListener('click', event => {\n if (event.button || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault(); returnFocus = link; reset(); skip.focus({preventScroll:true});\n });\n });\n if (root) new MutationObserver(() => {\n offer();\n if (playing && root.dataset.formed === 'yes') finish();\n }).observe(root, {attributes: true, attributeFilter: ['data-sky', 'data-formed']});\n reduced.addEventListener('change', () => {\n if (reduced.matches && !done) finish(true, 'Reduced motion is on. Welcome to Aien.');\n });\n window.addEventListener('pagehide', () => { if (window.AllenAudio) window.AllenAudio.stop(); });\n reset(); offer();\n if (!replay && loadLocal(key) === '1' && !done) finish(true, 'Welcome back. Aien is here.');\n}\n"
6text sjsite2 "function localTrail() {\n const panel = byId('site-trail');\n if (!panel) return;\n const enable = byId('site-trail-enable'), list = byId('site-trail-list');\n const status = byId('site-trail-status'), clear = byId('site-trail-clear');\n const report = byId('site-trail-report'), draft = byId('site-trail-draft');\n const message = byId('site-trail-message'), take = byId('site-trail-send');\n const key = 'aienos-local-trail';\n let pages = [], on = false, persistent = false;\n function validPage(row) {\n if (!row || typeof row.path !== 'string' || typeof row.title !== 'string') return false;\n try {\n const url = new URL(row.path, location.origin);\n return url.origin === location.origin && url.pathname === row.path && !url.search && !url.hash && row.path.length <= 256 && row.title.length <= 160;\n } catch (_) { return false; }\n }\n try {\n const state = JSON.parse(loadLocal(key) || 'null');\n if (state && state.on === true && Array.isArray(state.pages)) {\n on = true; pages = state.pages.filter(validPage).slice(-20); persistent = true;\n }\n } catch (_) {}\n function remember() {\n if (!on) return;\n const row = {path:location.pathname, title:(document.querySelector('main h1')?.textContent || document.title).trim().slice(0,160)};\n if (validPage(row)) { pages = pages.filter(item => item.path !== row.path); pages.push(row); pages = pages.slice(-20); }\n persistent = saveLocal(key, JSON.stringify({on:true,pages}));\n }\n function paint() {\n enable.checked = on; list.replaceChildren();\n for (const row of pages) {\n const li = document.createElement('li'), anchor = document.createElement('a');\n anchor.href = row.path; anchor.textContent = row.title;\n if (row.path === location.pathname) anchor.setAttribute('aria-current','page');\n li.append(anchor); list.append(li);\n }\n status.textContent = !on ? 'Trail is off. No visits are being saved.' : persistent ? 'Your trail is saved only in this browser. No trail data is sent to a server.' : 'Browser storage is unavailable. This trail lasts only while this page is open.';\n clear.disabled = pages.length === 0 && !on;\n }\n function dismiss() { draft.hidden = true; message.value = ''; take.href = '/aien/'; report.focus(); }\n enable.addEventListener('change', () => {\n on = enable.checked;\n if (on) remember(); else { pages = []; eraseLocal(key); }\n draft.hidden = true; message.value = ''; take.href = '/aien/'; paint();\n });\n clear.addEventListener('click', () => {\n on = false; pages = []; eraseLocal(key); draft.hidden = true; message.value = ''; take.href = '/aien/'; paint(); enable.focus();\n });\n report.addEventListener('click', () => {\n const entries = pages.length ? pages : [{path:location.pathname,title:document.title}];\n message.value = ('I explored these pages and would like to talk about them:\\n' + entries.map(row => '- ' + row.title + ': ' + row.path).join('\\n')).slice(0,2000);\n draft.hidden = false; message.focus();\n });\n take.addEventListener('click', () => {\n // The fragment is local navigation data, not an HTTP query. The Aien page\n // clears it after prefilling its editable input. Only its Send button sends.\n take.href = '/aien/#draft=' + encodeURIComponent(message.value.slice(0,2000));\n });\n byId('site-trail-cancel').addEventListener('click', dismiss);\n draft.addEventListener('keydown', event => { if (event.key === 'Escape') { event.preventDefault(); dismiss(); } });\n window.addEventListener('storage', event => {\n if (event.key !== key && event.key !== null) return;\n let state = null; try { state = JSON.parse(event.newValue); } catch (_) {}\n on = Boolean(state && state.on === true && Array.isArray(state.pages));\n pages = on ? state.pages.filter(validPage).slice(-20) : [];\n if (!on) eraseLocal(key);\n draft.hidden = true; message.value = ''; take.href = '/aien/'; paint();\n });\n remember(); paint(); panel.hidden = false;\n}\nnavigation(); homeDoor(); localTrail();\n})();\n"
7fn client_emit to void
8sr_raw sjsite0
9sr_raw sjsite1
10sr_raw sjsite2
11floor_client
12end