diff --git a/CHANGELOG.md b/CHANGELOG.md index 73bd558..a8d867e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added — Drift reconvergence with celeste-tts-bot (sub-project #2) - **`CorruptionCharsets`** — named registry backed by `src/data/charsets.json` (standard/soft/intense/all computed sets). -- **`CorruptionManager`** — unified `decode`/`flicker`/`hybrid` lifecycle with `visibilitychange` auto-cleanup. +- **`DecryptReveal`** — fixed-length decryption animation (`@whykusanagi/corrupted-theme/decrypt-reveal`). Renamed from CorruptionManager during 0.2.0 development to distinguish from TypingAnimation's streaming-typed pattern. Provides `.decode(element, finalText, opts)` for the chaos-buffer → resolved-text effect. - **`CRTEffects`** — CRT post-processing layer (scanlines, chromatic aberration, flicker, screen shake, RGB split). - **`animation-blocks`** — 10 classes: `TitleDecoder`, `ProgressBar`, `ScanlineSweep`, `TerminalBoot`, `GlitchPulse`, `ASCIIBorder`, `SystemDiagnostic`, `LoadingBarMulti`, `DataTransmission`, `TerminalPrompt`. - **`corrupted-particles-background`** — auto-injector for behind-blur particles with DPR=1 performance mode. diff --git a/README.md b/README.md index c14fb20..b9306d0 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ For production hardening, add SRI hashes (published in `CHANGELOG.md` for each r │ │ ├── timer-registry.js # lifecycle: tracked setTimeout/setInterval/rAF │ │ ├── event-tracker.js # lifecycle: tracked addEventListener │ │ ├── corruption-charsets.js # CorruptionCharsets registry (0.2.0) -│ │ ├── corruption-manager.js # CorruptionManager unified lifecycle (0.2.0) +│ │ ├── decrypt-reveal.js # DecryptReveal fixed-length decryption (0.2.0) │ │ ├── websocket-manager.js # WebSocketManager auto-reconnect (0.2.0) │ │ ├── random-utils.js # randomPick / randomInt / shuffle … (0.2.0) │ │ ├── time-utils.js # formatTime / timeAgo / formatDuration … (0.2.0) @@ -258,7 +258,7 @@ See [docs/CROSS_LANGUAGE_CONTRACT.md](docs/CROSS_LANGUAGE_CONTRACT.md) for the G | `CorruptedParticles` | `includeLewd` | `nsfw` | | `animation-blocks` | `lewdMode` | `nsfw` | | `TypingAnimation` | `nsfw` | `nsfw` (unchanged) | -| `CorruptionManager` | — | `nsfw` | +| `DecryptReveal` | — | — | ```js // Correct — all components now use the same option name @@ -414,8 +414,8 @@ import { initCountdown } from '@whykusanagi/corrupted-theme/countdown'; // 0.2.0 — Drift reconvergence (canonical corruption layer) import { CorruptionCharsets } from '@whykusanagi/corrupted-theme/corruption-charsets'; -import { CorruptionManager, decodeText, phraseFlicker, hybridDecode } - from '@whykusanagi/corrupted-theme/corruption-manager'; +import { DecryptReveal, decodeText } + from '@whykusanagi/corrupted-theme/decrypt-reveal'; import { CRTEffects, applyCRTGlow } from '@whykusanagi/corrupted-theme/crt-effects'; import { TitleDecoder, ProgressBar, ScanlineSweep, TerminalBoot, GlitchPulse, ASCIIBorder, SystemDiagnostic, LoadingBarMulti, DataTransmission, TerminalPrompt, @@ -642,25 +642,27 @@ CorruptionCharsets.all; // union of every set See [COMPONENTS_REFERENCE.md](docs/COMPONENTS_REFERENCE.md#corruptioncharsets) for all sets. -#### CorruptionManager +#### DecryptReveal -Unified lifecycle runner for all three canonical corruption patterns. +Fixed-length decryption animation. The target string is shown at its final length from frame 1 (scrambled with charset characters), then progressively resolves left-to-right to the target text. + +**Distinct from TypingAnimation** — TypingAnimation grows the string over time (streaming/typed reveal with phrase-buffer flicker in the not-yet-revealed tail). DecryptReveal keeps the string at final length and scrambles unrevealed positions. ```js -import { CorruptionManager } from '@whykusanagi/corrupted-theme/corruption-manager'; +import { DecryptReveal, decodeText } from '@whykusanagi/corrupted-theme/decrypt-reveal'; -const mgr = new CorruptionManager({ nsfw: false }); +const dr = new DecryptReveal({ charset: CorruptionCharsets.standard }); -mgr.decode(el, 'SYSTEM READY', { duration: 2000 }); // Pattern 1 -mgr.flicker(el, ['アイウエオ', '██████'], { duration: 3000 }); // Pattern 2 -mgr.hybrid(el, ['CORRUPTION'], 'SIGNAL RESTORED', {}); // Pattern 3 -mgr.stop(); // cancel all -mgr.destroy(); // full teardown -``` +dr.decode(el, 'SYSTEM READY', { duration: 2000 }); +dr.decode(el, 'アクセス許可', { duration: 3000, charset: CorruptionCharsets.kanji }); +dr.stop(); // cancel all +dr.destroy(); // full teardown -One-shot helpers (no instance needed): `decodeText`, `phraseFlicker`, `hybridDecode` — each returns a cancel function. +// One-shot helper (no instance needed) — returns a cancel function +const cancel = decodeText(el, 'NEURAL CORE ONLINE', { duration: 1500 }); +``` -See [COMPONENTS_REFERENCE.md](docs/COMPONENTS_REFERENCE.md#corruptionmanager) for full method table. +See [COMPONENTS_REFERENCE.md](docs/COMPONENTS_REFERENCE.md#decryptreveal) for full method table. #### CRTEffects diff --git a/docs/COMPONENTS_REFERENCE.md b/docs/COMPONENTS_REFERENCE.md index 9340cca..caa3799 100644 --- a/docs/COMPONENTS_REFERENCE.md +++ b/docs/COMPONENTS_REFERENCE.md @@ -1280,57 +1280,53 @@ CorruptionCharsets.all; // union of every set **Available sets:** `katakana`, `hiragana`, `kanji`, `symbols`, `blocks`, `standard`, `soft`, `intense`, `all`. -All getters return a `string` — index directly with `Math.random()` or pass as `charset` to `CorruptionManager` / animation block options. +All getters return a `string` — index directly with `Math.random()` or pass as `charset` to `DecryptReveal` / animation block options. --- -## CorruptionManager +## DecryptReveal -**Module:** `@whykusanagi/corrupted-theme/corruption-manager` -**Source:** `src/core/corruption-manager.js` +**Module:** `@whykusanagi/corrupted-theme/decrypt-reveal` +**Source:** `src/core/decrypt-reveal.js` **Since:** 0.2.0 -Unified lifecycle runner for all three canonical corruption patterns defined in `CORRUPTED_THEME_SPEC.md`. Tracks every active timer via `TimerRegistry` so a single `stop()` / `destroy()` call cleans up everything. Auto-stops when `document.hidden` becomes `true` (Visibility API). +Fixed-length decryption animation. The target string is shown at its final length from frame 1, scrambled with random characters from a charset, and progressively resolves left-to-right to the target text (chaos → order). + +**Distinct from TypingAnimation:** TypingAnimation grows the string over time (streaming/typed reveal with a phrase-buffer flicker in the not-yet-revealed tail). DecryptReveal keeps the string at final length and scrambles unrevealed positions. Use DecryptReveal for code reveals, passwords, and terminal boot sequences. + +Tracks every active timer via `TimerRegistry` so a single `stop()` / `destroy()` call cleans up everything. Auto-stops when `document.hidden` becomes `true` (Visibility API). ```js import { - CorruptionManager, + DecryptReveal, decodeText, - phraseFlicker, - hybridDecode, -} from '@whykusanagi/corrupted-theme/corruption-manager'; - -const mgr = new CorruptionManager({ nsfw: false, charset: CorruptionCharsets.standard }); +} from '@whykusanagi/corrupted-theme/decrypt-reveal'; -// Pattern 1 — character-by-character decode -const id1 = mgr.decode(el, 'SYSTEM READY', { duration: 2000 }); +const dr = new DecryptReveal({ charset: CorruptionCharsets.standard }); -// Pattern 2 — phrase flickering -const id2 = mgr.flicker(el, ['アイウエオ', 'LOADING...', '██████'], { duration: 3000, finalText: '' }); +// Fixed-length decrypt — text shown scrambled at full length, resolves left-to-right +const id1 = dr.decode(el, 'SYSTEM READY', { duration: 2000 }); -// Pattern 3 — hybrid (flicker phase → decode phase) -const id3 = mgr.hybrid(el, ['CORRUPTION DETECTED'], 'SIGNAL RESTORED', { duration: 4000 }); +// Override charset per-call +const id2 = dr.decode(el, 'アクセス許可', { duration: 3000, charset: CorruptionCharsets.kanji }); -mgr.cleanup(id1); // cancel one animation early -mgr.stop(); // cancel all animations (Visibility API auto-calls this) -mgr.start(); // resume hook (intentional no-op — re-queue animations explicitly) -mgr.destroy(); // full teardown; instance not reusable after this +dr.cleanup(id1); // cancel one animation early +dr.stop(); // cancel all animations (Visibility API auto-calls this) +dr.start(); // resume hook (intentional no-op — re-queue animations explicitly) +dr.destroy(); // full teardown; instance not reusable after this ``` **Constructor Options:** | Option | Type | Default | Description | |--------|------|---------|-------------| -| `nsfw` | boolean | `false` | Include NSFW phrase pools when auto-generating default phrase lists | -| `charset` | string | `CorruptionCharsets.standard` | Default charset for decode/hybrid; overridable per call | +| `charset` | string | `CorruptionCharsets.standard` | Default charset for decode operations; overridable per call | **Methods:** | Method | Returns | Description | |--------|---------|-------------| -| `decode(element, content, opts?)` | `number` | Start Pattern 1. `opts`: `duration` (ms), `charset` | -| `flicker(element, phrases, opts?)` | `number` | Start Pattern 2. `opts`: `duration`, `flickerInterval`, `finalText`, `nsfw` | -| `hybrid(element, phrases, content, opts?)` | `number` | Start Pattern 3. `opts`: `duration`, `charset`, `flickerInterval`, `nsfw` | +| `decode(element, content, opts?)` | `number` | Start decryption animation. `opts`: `duration` (ms), `charset` | | `cleanup(id)` | `void` | Cancel one animation by its return ID | | `stop()` | `void` | Cancel all active animations; element text preserved as-is | | `start()` | `void` | No-op resume hook; re-queue animations explicitly | @@ -1339,13 +1335,11 @@ mgr.destroy(); // full teardown; instance not reusable after this | `isAnimating(id)` | `boolean` | Whether animation `id` is still running | | `cleanupAll()` | `void` | **Deprecated** — alias for `stop()`. Removed in 0.3.x | -**Standalone one-shot exports** (no manager instance needed — each returns a cleanup `Function`): +**Standalone one-shot export** (no manager instance needed — returns a cleanup `Function`): | Export | Signature | |--------|-----------| | `decodeText` | `(element, finalText, opts?) → Function` | -| `phraseFlicker` | `(element, phrases, finalText, opts?) → Function` | -| `hybridDecode` | `(element, flickerPhrases, finalText, opts?) → Function` | --- @@ -1899,7 +1893,7 @@ Methods: `connect()`, `disconnect()`, `send(msg)`, `on(handler)`, `off(handler)` ### TimerRegistry -**Module:** `@whykusanagi/corrupted-theme/corruption-manager` (internal; also used directly in lib components) +**Module:** `@whykusanagi/corrupted-theme/decrypt-reveal` (internal; also used directly in lib components) **Source:** `src/core/timer-registry.js` **Type:** Class **Since:** 0.1.x (merged with TimerManager API in 0.2.0) @@ -1912,7 +1906,7 @@ Centralized timer tracking for component lifecycle cleanup. Wraps `setTimeout`, - `destroy()`: calls `clearAll()` then sets `destroyed = true` ```js -import { TimerRegistry } from '@whykusanagi/corrupted-theme/corruption-manager'; +import { TimerRegistry } from '@whykusanagi/corrupted-theme/decrypt-reveal'; // or import directly for internal use: // import { TimerRegistry } from '@whykusanagi/corrupted-theme/src/core/timer-registry.js'; diff --git a/docs/components/COMPONENT_LIBRARY.md b/docs/components/COMPONENT_LIBRARY.md index 73e62f6..dcc2e71 100644 --- a/docs/components/COMPONENT_LIBRARY.md +++ b/docs/components/COMPONENT_LIBRARY.md @@ -1059,7 +1059,7 @@ The 0.2.0 release adds a canonical JS layer on top of the CSS framework. Full AP | Module | Class / Export | Purpose | |--------|---------------|---------| -| `corruption-manager.js` | `CorruptionManager` | Lifecycle-managed multi-animation runner | +| `decrypt-reveal.js` | `DecryptReveal` | Fixed-length decryption animation | | `corruption-charsets.js` | charset helpers | Canonical charset access from `src/data/charsets.json` | | `corruption-phrases.js` | phrase helpers | Canonical phrase access from `src/data/phrases.json` | | `typing-animation.js` | `TypingAnimation` | Buffer-style corruption with SFW/NSFW modes | diff --git a/docs/platforms/COMPONENT_MAPPING.md b/docs/platforms/COMPONENT_MAPPING.md index c512837..3ee5687 100644 --- a/docs/platforms/COMPONENT_MAPPING.md +++ b/docs/platforms/COMPONENT_MAPPING.md @@ -122,7 +122,7 @@ The following JS modules have no CLI equivalent — they target browser/canvas/W | npm Export | Class | Category | CLI Equivalent | |------------|-------|----------|---------------| -| `./corruption-manager` | `CorruptionManager` | Core | None (CLI uses Go structs) | +| `./decrypt-reveal` | `DecryptReveal` | Core | None (CLI uses Go structs) | | `./animation-blocks` | 10 block classes | Animation | `CorruptText()` + `CorruptTextJapanese()` (approximate) | | `./crt-effects` | `CRTEffects` | Animation | None | | `./corrupted-text` | `CorruptedText` | Corruption | `CorruptTextJapanese()` | diff --git a/docs/platforms/NPM_PACKAGE.md b/docs/platforms/NPM_PACKAGE.md index 656300f..a9820e8 100644 --- a/docs/platforms/NPM_PACKAGE.md +++ b/docs/platforms/NPM_PACKAGE.md @@ -684,7 +684,7 @@ Example: 0.2.0 | Version | Date | Changes | Migration | |---------|------|---------|-----------| -| **0.2.0** | 2026-05-18 | Canonical JSON data layer, CDN distribution, CorruptionManager, CRTEffects, animation-blocks (10 classes), 7 new widgets, 5 utility modules, glassmorphism CSS merge, UMD build, .container redesign | [Migration guide](../MIGRATION_CONTAINER_0.2.0.md) | +| **0.2.0** | 2026-05-18 | Canonical JSON data layer, CDN distribution, DecryptReveal, CRTEffects, animation-blocks (10 classes), 7 new widgets, 5 utility modules, glassmorphism CSS merge, UMD build, .container redesign | [Migration guide](../MIGRATION_CONTAINER_0.2.0.md) | | 0.1.9 | 2026-04-19 | CorruptedText dedup, TypingAnimation buffer redesign, NSFW page consolidation, layout fix, orphan docs removed, CI workflow | N/A | | 0.1.8 | 2026-03-01 | GLSL vortex, Canvas particles, new JS components | N/A | | 0.1.7 | 2026-02-07 | Security, lifecycle, new components | N/A | @@ -732,7 +732,7 @@ See [`docs/MIGRATION_CONTAINER_0.2.0.md`](../MIGRATION_CONTAINER_0.2.0.md) for t - **`.container` class redesigned** — now controls max-width layout; replace old `.container` usage with new `.glass-container` variants where glass effect was intended - **New canonical JSON data** — phrase lists and charsets live in `src/data/` instead of inline in JS -- **New JS exports** — 19 new modules available under `./corruption-manager`, `./animation-blocks`, `./crt-effects`, etc. in `package.json` exports map +- **New JS exports** — 19 new modules available under `./decrypt-reveal`, `./animation-blocks`, `./crt-effects`, etc. in `package.json` exports map - **No removed exports** — all 0.1.x CSS classes and JS classes remain; 0.2.0 is additive ### From Custom CSS to Corrupted Theme diff --git a/docs/platforms/WEB_IMPLEMENTATION.md b/docs/platforms/WEB_IMPLEMENTATION.md index 947525c..4f681d4 100644 --- a/docs/platforms/WEB_IMPLEMENTATION.md +++ b/docs/platforms/WEB_IMPLEMENTATION.md @@ -1219,7 +1219,7 @@ Quick reference: ``` diff --git a/examples/advanced/crt-effects.html b/examples/advanced/crt-effects.html index e2008ee..8a2ca37 100644 --- a/examples/advanced/crt-effects.html +++ b/examples/advanced/crt-effects.html @@ -183,7 +183,7 @@ Buffer Corruption Animation Blocks CRT Effects - Corruption Manager + Decrypt Reveal Widgets Showcase diff --git a/examples/advanced/corruption-manager.html b/examples/advanced/decrypt-reveal.html similarity index 59% rename from examples/advanced/corruption-manager.html rename to examples/advanced/decrypt-reveal.html index 9225edb..a667356 100644 --- a/examples/advanced/corruption-manager.html +++ b/examples/advanced/decrypt-reveal.html @@ -3,7 +3,7 @@
-