refactor(website): split Landing.vue into section components
Extract 2002-line monolith into landing/ subfolder:
- 8 section components (FolioHeader, HeroSection, ForgettingSection, AnatomySection, DialectSection, MechanicsSection, InstallSection, CatalogFooter)
- useLandingEffects.js composable for all vanilla-JS effects
- landing.css for all styles
- Landing.vue reduced to 28-line orchestrator
Also restores upstream hero lede text ("permanent. Designed for total recall.").
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<section v-pre id="anatomy" class="anatomy">
|
||||
<div class="section-mark"><span class="roman">ii</span> <span>anatomy of a palace</span></div>
|
||||
|
||||
<div class="anatomy-head">
|
||||
<div>
|
||||
<span class="eyebrow">the method of loci, updated</span>
|
||||
<h2 class="display">
|
||||
Wings. Rooms. <em>Drawers.</em>
|
||||
</h2>
|
||||
</div>
|
||||
<p class="lede">
|
||||
An ancient memory technique, reworked for a machine. Broad categories
|
||||
nest time-based groupings; time-based groupings hold verbatim drawers.
|
||||
A symbolic index lets the model scan thousands of drawers in a single
|
||||
pass and open only the ones it needs.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="anatomy-diagram">
|
||||
<article class="stratum">
|
||||
<span class="n">W — wing</span>
|
||||
<h3>The <em>Wing</em></h3>
|
||||
<p class="sub">people · projects · topics</p>
|
||||
<p>A broad region of the palace, keyed to a real entity — a person by name, a project by codename, a domain of your life. Entity-first, always.</p>
|
||||
<div class="diagram">
|
||||
<svg viewBox="0 0 200 80" fill="none" stroke="currentColor" stroke-width="1" style="color:var(--prism);">
|
||||
<rect x="5" y="20" width="190" height="50" opacity="0.4"/>
|
||||
<rect x="15" y="28" width="50" height="34" />
|
||||
<rect x="75" y="28" width="50" height="34" />
|
||||
<rect x="135" y="28" width="50" height="34" />
|
||||
<line x1="5" y1="12" x2="195" y2="12" stroke-dasharray="2 3" opacity="0.5"/>
|
||||
</svg>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article class="stratum">
|
||||
<span class="n">R — room</span>
|
||||
<h3>The <em>Room</em></h3>
|
||||
<p class="sub">days · sessions · threads</p>
|
||||
<p>Inside a wing sit rooms — discrete units of time. One room per day, or one per session. Walk the corridor and the palace unfolds chronologically, room by room.</p>
|
||||
<div class="diagram">
|
||||
<svg viewBox="0 0 200 80" fill="none" stroke="currentColor" stroke-width="1" style="color:var(--prism);">
|
||||
<rect x="10" y="20" width="36" height="44" />
|
||||
<rect x="56" y="20" width="36" height="44" />
|
||||
<rect x="102" y="20" width="36" height="44" />
|
||||
<rect x="148" y="20" width="36" height="44" />
|
||||
<line x1="10" y1="70" x2="184" y2="70" stroke-dasharray="1 3" opacity="0.6"/>
|
||||
</svg>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article class="stratum">
|
||||
<span class="n">D — drawer</span>
|
||||
<h3>The <em>Drawer</em></h3>
|
||||
<p class="sub">verbatim · permanent · exact</p>
|
||||
<p>Each room holds drawers. A drawer is a single chunk of verbatim content — the exact words, untouched. The palace's promise is kept here.</p>
|
||||
<div class="diagram">
|
||||
<svg viewBox="0 0 200 80" fill="none" stroke="currentColor" stroke-width="1" style="color:var(--prism);">
|
||||
<rect x="40" y="14" width="120" height="16" />
|
||||
<rect x="40" y="34" width="120" height="16" />
|
||||
<rect x="40" y="54" width="120" height="16" />
|
||||
<circle cx="150" cy="22" r="1.5" fill="currentColor"/>
|
||||
<circle cx="150" cy="42" r="1.5" fill="currentColor"/>
|
||||
<circle cx="150" cy="62" r="1.5" fill="currentColor"/>
|
||||
</svg>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<footer v-pre class="catalog">
|
||||
<form class="waitlist waitlist-footer" data-source="footer" novalidate>
|
||||
<div class="waitlist-head">
|
||||
<span class="waitlist-pulse" aria-hidden="true"></span>
|
||||
<span class="waitlist-eyebrow">Last call · subscribe for updates</span>
|
||||
</div>
|
||||
<div class="waitlist-row">
|
||||
<input type="email" class="waitlist-input" name="email" placeholder="you@example.com" autocomplete="email" aria-label="Email address" required />
|
||||
<button type="submit" class="waitlist-submit">
|
||||
<span class="waitlist-label-default">Join the list</span>
|
||||
<span class="waitlist-label-pending" aria-hidden="true">Joining…</span>
|
||||
<svg class="waitlist-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>
|
||||
<svg class="waitlist-check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><path d="M5 12l5 5 9-11"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<p class="waitlist-msg" aria-live="polite"></p>
|
||||
</form>
|
||||
|
||||
<div class="catalog-card">
|
||||
<div>
|
||||
<p class="catalog-title">MemPalace <em>—</em> a memory palace for AI.</p>
|
||||
<p class="catalog-desc">Verbatim storage, local-first, zero telemetry. Built for people who believe their words are theirs.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Documentation</h4>
|
||||
<ul>
|
||||
<li><a href="/guide/getting-started">Getting started</a></li>
|
||||
<li><a href="/concepts/the-palace">The palace</a></li>
|
||||
<li><a href="/reference/cli">CLI reference</a></li>
|
||||
<li><a href="/reference/benchmarks">Benchmarks</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<h4>The project</h4>
|
||||
<ul>
|
||||
<li><a href="https://github.com/MemPalace/mempalace">GitHub</a></li>
|
||||
<li><a href="https://github.com/MemPalace/mempalace/blob/main/README.md">Readme</a></li>
|
||||
<li><a href="https://github.com/MemPalace/mempalace/blob/main/ROADMAP.md">Roadmap</a></li>
|
||||
<li><a href="https://github.com/MemPalace/mempalace/blob/main/CHANGELOG.md">Changelog</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
<section v-pre id="dialect" class="dialect">
|
||||
<div class="section-mark"><span class="roman">iii</span> <span>the aaak dialect</span></div>
|
||||
|
||||
<div class="dialect-head">
|
||||
<span class="eyebrow">index ← verbatim</span>
|
||||
<h2 class="display">
|
||||
A compressed symbolic language <em>for finding</em>, not remembering.
|
||||
</h2>
|
||||
<p class="lede">
|
||||
The content stays verbatim — always. The <em>index</em> above it is written
|
||||
in AAAK: a dense symbolic dialect an LLM can scan at a glance. Thousands
|
||||
of entries, one pass, exact drawer located.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="dialect-grid">
|
||||
<article class="slab">
|
||||
<header class="card-head">
|
||||
<span class="l">drawer · D-007</span>
|
||||
<span>verbatim · exact · permanent</span>
|
||||
</header>
|
||||
<p class="label">The drawer, as stored.</p>
|
||||
<p>
|
||||
"My son's name is <strong>Noah</strong>. He turns <strong>six</strong>
|
||||
on <strong>September 12th</strong>. He loves dinosaurs —
|
||||
especially the <strong>therizinosaurus</strong> because of the
|
||||
claws. We want to do a small party at <strong>the park on Glebe
|
||||
Point Road</strong>, maybe eight kids."
|
||||
</p>
|
||||
<p style="color:var(--ice-ghost); font-size: 13.5px; font-family: var(--f-mono); letter-spacing: 0.05em; margin-top:1.5rem;">
|
||||
— kept as spoken. never rewritten.
|
||||
</p>
|
||||
</article>
|
||||
|
||||
<div class="dialect-arrow" aria-hidden="true">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3">
|
||||
<path d="M12 3v18M7 8l5-5 5 5M7 16l5 5 5-5"/>
|
||||
</svg>
|
||||
<span>index · AAAK</span>
|
||||
</div>
|
||||
|
||||
<article class="slab mono">
|
||||
<header class="card-head">
|
||||
<span class="l">index · AAAK</span>
|
||||
<span>indexes · compressed · addressable</span>
|
||||
</header>
|
||||
<p class="label">The pointer, as indexed.</p>
|
||||
<pre><span class="c">§ W-042/R-11/D-007</span>
|
||||
<span class="k">@p</span> <span class="t">noah</span>~<span class="v">son.age=6</span>~<span class="v">dob=09-12</span>
|
||||
<span class="k">@l</span> <span class="t">glebe-pt-rd.park</span>
|
||||
<span class="k">@e</span> <span class="t">birthday</span>~<span class="v">party(n≈8)</span>
|
||||
<span class="k">@i</span> <span class="t">therizinosaurus</span>~<span class="v">claws</span>
|
||||
<span class="k">@t</span> <span class="v">2026-04-14T09:41</span>
|
||||
<span class="c">§ ptr → D-007 (verbatim)</span></pre>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<p class="dialect-caption">
|
||||
Dense compression on the pointer layer. Full fidelity on the content
|
||||
layer. You get speed without ever losing a word.
|
||||
</p>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<header v-pre class="folio" role="banner">
|
||||
<div class="mark" aria-label="MemPalace">
|
||||
<img src="/mempalace_logo.png" alt="" aria-hidden="true" />
|
||||
<span>MemPalace</span>
|
||||
</div>
|
||||
<nav class="right" aria-label="Primary">
|
||||
<a href="#anatomy" class="hide-mobile">Anatomy</a>
|
||||
<a href="#dialect" class="hide-mobile">Dialect</a>
|
||||
<a href="#mechanics" class="hide-mobile">Mechanics</a>
|
||||
<a href="#install" class="hide-mobile">Install</a>
|
||||
<a href="/guide/getting-started">Docs</a>
|
||||
<a href="https://github.com/MemPalace/mempalace">GitHub ↗</a>
|
||||
</nav>
|
||||
</header>
|
||||
</template>
|
||||
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<section v-pre id="forgetting" class="forgetting">
|
||||
<div class="section-mark"><span class="roman">i</span> <span>the forgetting</span></div>
|
||||
|
||||
<header class="forgetting-head">
|
||||
<div class="copy">
|
||||
<span class="eyebrow">before · after</span>
|
||||
<h2 class="display">
|
||||
The same conversation, <em>twice.</em>
|
||||
</h2>
|
||||
<p class="lede" style="margin:0;">
|
||||
Scroll down and watch. On the left, a model without memory. On the right,
|
||||
the same model with MemPalace. The words are identical — until two weeks
|
||||
pass.
|
||||
</p>
|
||||
</div>
|
||||
<button class="replay" id="replay-demo" type="button" aria-label="Replay the demo">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M4 4v6h6"/><path d="M20 20v-6h-6"/><path d="M4 10a8 8 0 0114-5l2 3"/><path d="M20 14a8 8 0 01-14 5l-2-3"/></svg>
|
||||
replay
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="forgetting-compare" id="forgetting-compare" aria-label="Comparison demo">
|
||||
<article class="demo-pane demo-forget">
|
||||
<header>
|
||||
<span class="pane-tag">without mempalace</span>
|
||||
<span class="pane-meta">session <em>resets</em> · no recall</span>
|
||||
</header>
|
||||
<div class="chat" data-pane="forget" aria-live="polite"></div>
|
||||
</article>
|
||||
|
||||
<div class="divider" aria-hidden="true"></div>
|
||||
|
||||
<article class="demo-pane demo-remember">
|
||||
<header>
|
||||
<span class="pane-tag">with mempalace</span>
|
||||
<span class="pane-meta">verbatim · retrieved <em>instantly</em></span>
|
||||
</header>
|
||||
<div class="chat" data-pane="remember" aria-live="polite"></div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<section v-pre class="hero" id="hero">
|
||||
<span class="corner-ticks" aria-hidden="true"><span></span></span>
|
||||
|
||||
<div class="hero-inner">
|
||||
<div class="hero-copy">
|
||||
<h1 class="display">
|
||||
<span class="line">Memory is</span>
|
||||
<span class="line line-2">identity.</span>
|
||||
</h1>
|
||||
<p class="lede">
|
||||
An AI that forgets cannot know you. MemPalace keeps every word you have
|
||||
shared — verbatim, on your machine, permanent. Designed for total
|
||||
recall.
|
||||
</p>
|
||||
<form class="waitlist waitlist-hero" data-source="hero" novalidate>
|
||||
<div class="waitlist-head">
|
||||
<span class="waitlist-pulse" aria-hidden="true"></span>
|
||||
<span class="waitlist-eyebrow">Subscribe for updates</span>
|
||||
</div>
|
||||
<div class="waitlist-row">
|
||||
<input
|
||||
type="email"
|
||||
class="waitlist-input"
|
||||
name="email"
|
||||
placeholder="you@example.com"
|
||||
autocomplete="email"
|
||||
aria-label="Email address"
|
||||
required
|
||||
/>
|
||||
<button type="submit" class="waitlist-submit">
|
||||
<span class="waitlist-label-default">Join the list</span>
|
||||
<span class="waitlist-label-pending" aria-hidden="true">Joining…</span>
|
||||
<svg class="waitlist-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">
|
||||
<path d="M5 12h14M13 6l6 6-6 6"/>
|
||||
</svg>
|
||||
<svg class="waitlist-check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<path d="M5 12l5 5 9-11"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<p class="waitlist-msg" aria-live="polite"></p>
|
||||
</form>
|
||||
|
||||
<div class="hero-secondary">
|
||||
<a href="/guide/getting-started">Read the docs</a>
|
||||
<span class="sep" aria-hidden="true">·</span>
|
||||
<a href="https://github.com/MemPalace/mempalace">GitHub ↗</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Palace video visual -->
|
||||
<div class="palace-stage" aria-hidden="true">
|
||||
<div class="halo"></div>
|
||||
|
||||
<div class="stars">
|
||||
<i style="top:12%; left:22%; --t:5s; --d:0.0s"></i>
|
||||
<i style="top:18%; left:74%; --t:6s; --d:1.2s"></i>
|
||||
<i style="top:34%; left:8%; --t:4s; --d:0.6s"></i>
|
||||
<i style="top:44%; left:88%; --t:7s; --d:0.3s"></i>
|
||||
<i style="top:62%; left:14%; --t:5.5s; --d:1.8s"></i>
|
||||
<i style="top:72%; left:82%; --t:4.5s; --d:0.9s"></i>
|
||||
<i style="top:82%; left:38%; --t:6.2s; --d:2.4s"></i>
|
||||
<i style="top:28%; left:52%; --t:5.2s; --d:3.0s"></i>
|
||||
<i style="top:88%; left:60%; --t:4.8s; --d:1.5s"></i>
|
||||
<i style="top:6%; left:48%; --t:6.8s; --d:0.4s"></i>
|
||||
</div>
|
||||
|
||||
<video
|
||||
class="palace-video"
|
||||
src="/hero_video.mp4"
|
||||
autoplay
|
||||
muted
|
||||
loop
|
||||
playsinline
|
||||
disablepictureinpicture
|
||||
></video>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<section v-pre id="install" class="install">
|
||||
<div class="section-mark" style="left:50%; transform:translateX(-50%);"><span class="roman">v</span> <span>begin</span></div>
|
||||
<span class="eyebrow" style="justify-content:center;">open a drawer</span>
|
||||
<h2 class="display">
|
||||
Build your <em>palace.</em>
|
||||
</h2>
|
||||
<p class="lede" style="margin-left:auto;margin-right:auto;text-align:center;">
|
||||
One command to install. One to initialize. Your words — yours, permanent,
|
||||
instantly recallable — from that moment on.
|
||||
</p>
|
||||
|
||||
<div class="terminal" role="figure" aria-label="Installation commands">
|
||||
<div class="terminal-head">
|
||||
<span class="lights"><i></i><i></i><i></i></span>
|
||||
<span>~/mempalace · bash</span>
|
||||
</div>
|
||||
<pre><span class="prompt">$</span> pip install -e <span class="dim">".[dev]"</span>
|
||||
<span class="c">Successfully installed mempalace</span>
|
||||
<span class="prompt">$</span> mempalace init
|
||||
<span class="ok"> ✓</span> palace created at <span class="dim">~/.mempalace</span>
|
||||
<span class="ok"> ✓</span> hooks registered <span class="dim">(stop, precompact)</span>
|
||||
<span class="ok"> ✓</span> knowledge graph initialized
|
||||
<span class="prompt">$</span> mempalace mine <span class="dim">./notes</span>
|
||||
<span class="ok"> ✓</span> filed · <span class="c">W-001/R-01/D-001</span></pre>
|
||||
</div>
|
||||
|
||||
<div class="install-cta">
|
||||
<a href="/guide/getting-started" class="btn btn-primary">
|
||||
Read the docs
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M5 12h14M13 6l6 6-6 6"/></svg>
|
||||
</a>
|
||||
<a href="https://github.com/MemPalace/mempalace" class="btn">
|
||||
Visit the repository
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<section v-pre id="mechanics">
|
||||
<div class="section-mark"><span class="roman">iv</span> <span>how it works</span></div>
|
||||
|
||||
<div class="mechanics-head">
|
||||
<span class="eyebrow">mechanism · architecture</span>
|
||||
<h2 class="display">
|
||||
Four pieces. <em>No cloud.</em> No keys.
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="mechanics">
|
||||
<article class="mech">
|
||||
<div class="icon" aria-hidden="true">
|
||||
<svg viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.3">
|
||||
<rect x="8" y="10" width="32" height="22" rx="1"/>
|
||||
<path d="M8 16h32"/>
|
||||
<path d="M14 24h20M14 28h12"/>
|
||||
<path d="M16 38h16M20 32v6M28 32v6"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="eyebrow no-rule"><span class="n">— 01</span></span>
|
||||
<h3>Local-<em>first</em></h3>
|
||||
<p>ChromaDB on disk. SQLite for the knowledge graph. Nothing is uploaded. Nothing is synced. Your palace lives under a single directory on your machine.</p>
|
||||
<div class="metric">path · <b>~/.mempalace</b></div>
|
||||
</article>
|
||||
|
||||
<article class="mech">
|
||||
<div class="icon" aria-hidden="true">
|
||||
<svg viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.3">
|
||||
<circle cx="24" cy="24" r="14"/>
|
||||
<path d="M16 24h16M24 16v16"/>
|
||||
<path d="M10 10l28 28" stroke-width="1.5"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="eyebrow no-rule"><span class="n">— 02</span></span>
|
||||
<h3>Zero <em>API</em></h3>
|
||||
<p>Extraction, chunking, and embedding all run locally. No OpenAI key, no Anthropic key, no sentence-transformers endpoint. The memory works even offline, on a plane.</p>
|
||||
<div class="metric">keys required · <b>none</b></div>
|
||||
</article>
|
||||
|
||||
<article class="mech">
|
||||
<div class="icon" aria-hidden="true">
|
||||
<svg viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.3">
|
||||
<path d="M8 36V18l8-8h16l8 8v18"/>
|
||||
<path d="M8 36h32"/>
|
||||
<circle cx="24" cy="26" r="4"/>
|
||||
<path d="M24 22v-4M24 30v4M20 26h-4M28 26h4"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="eyebrow no-rule"><span class="n">— 03</span></span>
|
||||
<h3>Background <em>hooks</em></h3>
|
||||
<p>Filing and indexing happen silently through Claude Code hooks. On session end, on pre-compaction. You write. The palace fills itself behind the curtain.</p>
|
||||
<div class="metric">hook budget · <b><500 ms</b></div>
|
||||
</article>
|
||||
|
||||
<article class="mech">
|
||||
<div class="icon" aria-hidden="true">
|
||||
<svg viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.3">
|
||||
<circle cx="10" cy="12" r="3"/>
|
||||
<circle cx="38" cy="10" r="3"/>
|
||||
<circle cx="24" cy="26" r="3"/>
|
||||
<circle cx="12" cy="38" r="3"/>
|
||||
<circle cx="38" cy="36" r="3"/>
|
||||
<path d="M12 14l10 10M36 12L26 24M14 36l8-8M36 34l-10-6" opacity="0.6"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="eyebrow no-rule"><span class="n">— 04</span></span>
|
||||
<h3>Temporal <em>graph</em></h3>
|
||||
<p>Relationships across entities with valid-from and valid-to dates. Who worked on what. When did this change. Facts that were true then, and may not be now.</p>
|
||||
<div class="metric">store · <b>sqlite</b></div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,385 @@
|
||||
import { onMounted, onBeforeUnmount } from 'vue'
|
||||
|
||||
export function useLandingEffects() {
|
||||
onMounted(() => {
|
||||
if (typeof document === 'undefined') return
|
||||
|
||||
// Hide VitePress chrome while the landing component is live, restore on leave.
|
||||
document.body.classList.add('mempalace-active')
|
||||
|
||||
/* ---------- Waitlist submission ---------- */
|
||||
;(function initWaitlist(){
|
||||
const ENDPOINT = 'https://br.staging.mempalaceofficial.com/waitlist'
|
||||
const forms = document.querySelectorAll('.mempalace-landing .waitlist')
|
||||
const emailRe = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
||||
|
||||
forms.forEach(form => {
|
||||
const input = form.querySelector('.waitlist-input')
|
||||
const button = form.querySelector('.waitlist-submit')
|
||||
const msg = form.querySelector('.waitlist-msg')
|
||||
const source = form.dataset.source || 'landing'
|
||||
|
||||
function setState(state, text) {
|
||||
form.classList.remove('is-pending', 'is-success', 'is-error')
|
||||
if (state) form.classList.add('is-' + state)
|
||||
if (text != null) msg.textContent = text
|
||||
}
|
||||
|
||||
form.addEventListener('submit', async (e) => {
|
||||
e.preventDefault()
|
||||
if (form.classList.contains('is-success') || form.classList.contains('is-pending')) return
|
||||
|
||||
const email = (input.value || '').trim()
|
||||
if (!emailRe.test(email)) {
|
||||
setState('error', 'Please provide a valid email address.')
|
||||
input.focus()
|
||||
return
|
||||
}
|
||||
|
||||
setState('pending', 'Sending…')
|
||||
button.disabled = true
|
||||
input.disabled = true
|
||||
|
||||
try {
|
||||
const res = await fetch(ENDPOINT, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ email, source })
|
||||
})
|
||||
let data = null
|
||||
try { data = await res.json() } catch (_) { /* no body */ }
|
||||
|
||||
if (res.ok) {
|
||||
setState('success', (data && data.message) || "You're on the list! We'll be in touch.")
|
||||
// keep inputs disabled so they can't resubmit accidentally
|
||||
input.value = email
|
||||
return
|
||||
}
|
||||
|
||||
if (res.status === 429) {
|
||||
setState('error', 'Whoa — slow down a moment, then try again.')
|
||||
} else if (res.status === 400) {
|
||||
setState('error', (data && data.message) || 'Please provide a valid email address.')
|
||||
} else {
|
||||
setState('error', (data && data.message) || 'Something went wrong. Please try again later.')
|
||||
}
|
||||
button.disabled = false
|
||||
input.disabled = false
|
||||
} catch (_err) {
|
||||
setState('error', 'Network error — please try again.')
|
||||
button.disabled = false
|
||||
input.disabled = false
|
||||
}
|
||||
})
|
||||
|
||||
// Clear error state as soon as the user edits
|
||||
input.addEventListener('input', () => {
|
||||
if (form.classList.contains('is-error')) setState(null, '')
|
||||
})
|
||||
})
|
||||
})()
|
||||
|
||||
|
||||
|
||||
/* ---------- Reveal-on-scroll for cards ---------- */
|
||||
;(function(){
|
||||
if (!('IntersectionObserver' in window)) return
|
||||
const items = document.querySelectorAll('.mempalace-landing .stratum, .mempalace-landing .mech, .mempalace-landing .slab')
|
||||
items.forEach(el => {
|
||||
el.style.opacity = '0'
|
||||
el.style.transform = 'translateY(20px)'
|
||||
el.style.transition = 'opacity 0.9s ease, transform 0.9s ease'
|
||||
})
|
||||
const io = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting){
|
||||
const idx = [...entry.target.parentElement.children].indexOf(entry.target)
|
||||
entry.target.style.transitionDelay = (idx * 80) + 'ms'
|
||||
entry.target.style.opacity = '1'
|
||||
entry.target.style.transform = 'translateY(0)'
|
||||
io.unobserve(entry.target)
|
||||
}
|
||||
})
|
||||
}, { rootMargin: '0px 0px -80px 0px' })
|
||||
items.forEach(el => io.observe(el))
|
||||
})()
|
||||
|
||||
/* ---------- Forgetting demo ---------- */
|
||||
;(function initForgettingDemo(){
|
||||
const compare = document.getElementById('forgetting-compare')
|
||||
if (!compare) return
|
||||
const leftChat = compare.querySelector('[data-pane="forget"]')
|
||||
const rightChat = compare.querySelector('[data-pane="remember"]')
|
||||
const replayBtn = document.getElementById('replay-demo')
|
||||
const reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||
|
||||
const delay = ms => new Promise(r => setTimeout(r, reduced ? Math.min(ms, 60) : ms))
|
||||
|
||||
function clear() {
|
||||
leftChat.innerHTML = ''
|
||||
rightChat.innerHTML = ''
|
||||
if (replayBtn) replayBtn.classList.remove('visible')
|
||||
}
|
||||
|
||||
function addMsg(chat, who, opts = {}) {
|
||||
const row = document.createElement('div')
|
||||
row.className = 'msg ' + (who === 'You' ? 'you' : 'ai')
|
||||
if (opts.id) row.dataset.id = opts.id
|
||||
row.innerHTML = '<span class="who">' + who + '</span><span class="body"></span>'
|
||||
chat.appendChild(row)
|
||||
chat.scrollTop = chat.scrollHeight
|
||||
return row
|
||||
}
|
||||
|
||||
async function typeInto(row, text, speed = 14) {
|
||||
const body = row.querySelector('.body')
|
||||
const parts = text.split(/(<[^>]+>)/)
|
||||
row.classList.add('typing')
|
||||
for (const part of parts) {
|
||||
if (!part) continue
|
||||
if (part.startsWith('<')) { body.insertAdjacentHTML('beforeend', part); continue }
|
||||
for (const ch of part) {
|
||||
body.insertAdjacentText('beforeend', ch)
|
||||
if (!reduced) await delay(speed + (Math.random() < 0.08 ? 40 : 0))
|
||||
}
|
||||
}
|
||||
row.classList.remove('typing')
|
||||
}
|
||||
|
||||
function addDivider(chat, text) {
|
||||
const d = document.createElement('div')
|
||||
d.className = 'divider-time'
|
||||
d.textContent = '— ' + text + ' —'
|
||||
chat.appendChild(d)
|
||||
return d
|
||||
}
|
||||
|
||||
function addRetrieval(chat, callNumber, ms) {
|
||||
const row = document.createElement('div')
|
||||
row.className = 'retrieval'
|
||||
row.innerHTML =
|
||||
'<span class="who">mem</span>' +
|
||||
'<span class="l">retrieved · <span class="r">' + callNumber + '</span></span>' +
|
||||
'<span>' + ms + ' ms</span>'
|
||||
chat.appendChild(row)
|
||||
return row
|
||||
}
|
||||
|
||||
function addStamp(chat, text, callNumber) {
|
||||
const el = document.createElement('div')
|
||||
el.className = 'stamp'
|
||||
el.innerHTML = '<span>— ' + text + '</span>' +
|
||||
(callNumber ? '<span class="call">' + callNumber + '</span>' : '')
|
||||
chat.appendChild(el)
|
||||
return el
|
||||
}
|
||||
|
||||
function disintegrate(target) {
|
||||
return new Promise(resolve => {
|
||||
const parent = target.closest('.chat')
|
||||
if (!parent) { resolve(); return }
|
||||
const parentRect = parent.getBoundingClientRect()
|
||||
const style = getComputedStyle(target)
|
||||
const font = style.font ||
|
||||
(style.fontStyle + ' ' + style.fontWeight + ' ' + style.fontSize + '/' + style.lineHeight + ' ' + style.fontFamily)
|
||||
const color = style.color
|
||||
|
||||
let overlay = parent.querySelector('.dust-overlay')
|
||||
if (!overlay) {
|
||||
overlay = document.createElement('div')
|
||||
overlay.className = 'dust-overlay'
|
||||
parent.appendChild(overlay)
|
||||
}
|
||||
|
||||
const walker = document.createTreeWalker(target, NodeFilter.SHOW_TEXT)
|
||||
const range = document.createRange()
|
||||
const spans = []
|
||||
let node
|
||||
while ((node = walker.nextNode())) {
|
||||
const chars = node.textContent
|
||||
for (let i = 0; i < chars.length; i++) {
|
||||
if (chars[i] === ' ') continue
|
||||
range.setStart(node, i)
|
||||
range.setEnd(node, i + 1)
|
||||
const r = range.getBoundingClientRect()
|
||||
if (r.width === 0 || r.height === 0) continue
|
||||
const span = document.createElement('span')
|
||||
span.className = 'dust'
|
||||
span.textContent = chars[i]
|
||||
span.style.left = (r.left - parentRect.left) + 'px'
|
||||
span.style.top = (r.top - parentRect.top) + 'px'
|
||||
span.style.width = r.width + 'px'
|
||||
span.style.height = r.height + 'px'
|
||||
span.style.font = font
|
||||
span.style.color = color
|
||||
span.style.opacity = '1'
|
||||
span.style.transform = 'translate(0,0)'
|
||||
span.style.transitionDuration = (1500 + Math.random() * 900) + 'ms'
|
||||
overlay.appendChild(span)
|
||||
spans.push(span)
|
||||
}
|
||||
}
|
||||
|
||||
target.style.transition = 'color 0.35s ease, opacity 0.35s ease'
|
||||
target.style.color = 'transparent'
|
||||
|
||||
void overlay.offsetHeight
|
||||
const cx = parentRect.width / 2
|
||||
spans.forEach((s) => {
|
||||
s.style.transitionDelay = (Math.random() * 500) + 'ms'
|
||||
const x0 = parseFloat(s.style.left)
|
||||
const dx = (x0 - cx) * 0.06 + (Math.random() - 0.5) * 36
|
||||
const dy = 30 + Math.random() * 80
|
||||
const rot = (Math.random() - 0.5) * 44
|
||||
s.style.transform = 'translate(' + dx + 'px,' + dy + 'px) rotate(' + rot + 'deg)'
|
||||
s.style.opacity = '0'
|
||||
s.style.filter = 'blur(2px)'
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
spans.forEach(s => s.remove())
|
||||
resolve()
|
||||
}, reduced ? 200 : 2600)
|
||||
})
|
||||
}
|
||||
|
||||
const NOAH_TEXT = "My son's name is Noah. He turns six on September 12th."
|
||||
|
||||
async function runForget() {
|
||||
const you1 = addMsg(leftChat, 'You', { id: 'noah' })
|
||||
await delay(200)
|
||||
await typeInto(you1, NOAH_TEXT, 16)
|
||||
await delay(500)
|
||||
const ai1 = addMsg(leftChat, 'Model')
|
||||
await typeInto(ai1, "Noted. I'll remember that for next time we talk.", 14)
|
||||
await delay(900)
|
||||
addDivider(leftChat, 'two weeks later')
|
||||
await delay(700)
|
||||
const you2 = addMsg(leftChat, 'You')
|
||||
await typeInto(you2, "Help me plan Noah's birthday.", 18)
|
||||
await delay(700)
|
||||
const target = leftChat.querySelector('.msg[data-id="noah"] .body')
|
||||
if (target) await disintegrate(target)
|
||||
await delay(250)
|
||||
const ai2 = addMsg(leftChat, 'Model')
|
||||
await typeInto(ai2, "Of course. Who is Noah? How old is he turning?", 16)
|
||||
await delay(500)
|
||||
addStamp(leftChat, 'forgotten.')
|
||||
}
|
||||
|
||||
async function runRemember() {
|
||||
const you1 = addMsg(rightChat, 'You', { id: 'noah' })
|
||||
await delay(200)
|
||||
await typeInto(you1, NOAH_TEXT, 16)
|
||||
await delay(500)
|
||||
const ai1 = addMsg(rightChat, 'Model')
|
||||
await typeInto(ai1, "Noted. Filed — <strong>W-042/R-01/D-003</strong>.", 14)
|
||||
await delay(900)
|
||||
addDivider(rightChat, 'two weeks later')
|
||||
await delay(700)
|
||||
const you2 = addMsg(rightChat, 'You')
|
||||
await typeInto(you2, "Help me plan Noah's birthday.", 18)
|
||||
await delay(600)
|
||||
addRetrieval(rightChat, 'W-042/R-01/D-003', 42)
|
||||
await delay(700)
|
||||
const ai2 = addMsg(rightChat, 'Model')
|
||||
await typeInto(ai2,
|
||||
"Of course — <strong>Noah</strong> turns <strong>six</strong> on <strong>September 12th</strong>. " +
|
||||
"You mentioned he loves the <strong>therizinosaurus</strong>, and a park on " +
|
||||
"<strong>Glebe Point Road</strong>. Shall we build from there?",
|
||||
11)
|
||||
await delay(500)
|
||||
addStamp(rightChat, 'remembered.', 'W-042/R-01/D-003')
|
||||
}
|
||||
|
||||
let running = { forget: false, remember: false }
|
||||
let started = { forget: false, remember: false }
|
||||
|
||||
async function runBoth() {
|
||||
if (running.forget || running.remember) return
|
||||
running.forget = running.remember = true
|
||||
started.forget = started.remember = true
|
||||
clear()
|
||||
await delay(200)
|
||||
await Promise.all([runForget(), runRemember()])
|
||||
running.forget = running.remember = false
|
||||
if (replayBtn) replayBtn.classList.add('visible')
|
||||
}
|
||||
|
||||
async function runSide(side) {
|
||||
if (running[side] || started[side]) return
|
||||
running[side] = true
|
||||
started[side] = true
|
||||
const chat = side === 'forget' ? leftChat : rightChat
|
||||
chat.innerHTML = ''
|
||||
await delay(200)
|
||||
await (side === 'forget' ? runForget() : runRemember())
|
||||
running[side] = false
|
||||
if (started.forget && started.remember && !running.forget && !running.remember && replayBtn) {
|
||||
replayBtn.classList.add('visible')
|
||||
}
|
||||
}
|
||||
|
||||
function resetAll() {
|
||||
started.forget = started.remember = false
|
||||
clear()
|
||||
}
|
||||
|
||||
const stackedMQ = window.matchMedia('(max-width: 900px)')
|
||||
const isStacked = () => stackedMQ.matches
|
||||
|
||||
function observeOnce(el, onReach) {
|
||||
if (!('IntersectionObserver' in window)) { onReach(); return null }
|
||||
let done = false
|
||||
const io = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (done || !entry.isIntersecting) return
|
||||
const rect = entry.boundingClientRect
|
||||
const elementCoverage = entry.intersectionRatio
|
||||
const viewportCoverage = entry.intersectionRect.height / window.innerHeight
|
||||
const mostlyVisible = elementCoverage >= 0.65
|
||||
const dominatesView = viewportCoverage >= 0.60 && rect.top <= window.innerHeight * 0.15
|
||||
if (mostlyVisible || dominatesView) {
|
||||
done = true
|
||||
onReach()
|
||||
io.disconnect()
|
||||
}
|
||||
})
|
||||
}, {
|
||||
threshold: [0.1, 0.25, 0.4, 0.55, 0.7, 0.85, 1.0],
|
||||
rootMargin: '-8% 0px -8% 0px'
|
||||
})
|
||||
io.observe(el)
|
||||
return io
|
||||
}
|
||||
|
||||
let observers = []
|
||||
function disconnectObservers() {
|
||||
observers.forEach(io => io && io.disconnect())
|
||||
observers = []
|
||||
}
|
||||
|
||||
function armObservers() {
|
||||
disconnectObservers()
|
||||
if (isStacked()) {
|
||||
observers.push(observeOnce(compare.querySelector('.demo-forget'), () => runSide('forget')))
|
||||
observers.push(observeOnce(compare.querySelector('.demo-remember'), () => runSide('remember')))
|
||||
} else {
|
||||
observers.push(observeOnce(compare, runBoth))
|
||||
}
|
||||
}
|
||||
|
||||
if (replayBtn) replayBtn.addEventListener('click', () => {
|
||||
resetAll()
|
||||
armObservers()
|
||||
})
|
||||
|
||||
armObservers()
|
||||
})()
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (typeof document === 'undefined') return
|
||||
document.body.classList.remove('mempalace-active')
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user