@whykusanagi/corrupted-theme 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +140 -4
- package/docs/COMPONENTS_REFERENCE.md +205 -2
- package/docs/governance/VERSION_MANAGEMENT.md +2 -2
- package/docs/governance/VERSION_REFERENCES.md +65 -202
- package/docs/platforms/NPM_PACKAGE.md +8 -6
- package/examples/advanced/glsl-vortex.html +297 -0
- package/examples/advanced/particles-bg.html +263 -0
- package/examples/basic/corrupted-text.html +2 -3
- package/examples/basic/typing-animation.html +136 -55
- package/examples/button.html +1 -2
- package/examples/card.html +1 -2
- package/examples/extensions-showcase.html +36 -1
- package/examples/form.html +1 -2
- package/examples/index.html +28 -4
- package/examples/layout.html +1 -2
- package/examples/nikke-team-builder.html +1 -2
- package/examples/showcase-complete.html +2 -3
- package/examples/showcase.html +1 -2
- package/package.json +4 -3
- package/src/core/typing-animation.js +274 -106
- package/src/css/theme.css +0 -15
- package/src/lib/corrupted-particles.js +309 -0
- package/src/lib/corrupted-text.js +127 -36
- package/src/lib/corrupted-vortex.js +329 -0
- package/docs/ROADMAP.md +0 -266
- package/examples/advanced/nsfw-corruption.html +0 -348
- package/src/core/corrupted-text.js +0 -300
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
+
## [0.1.9] - 2026-04-19
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- **Deduplicate `CorruptedText`** - `src/core/corrupted-text.js` was an orphaned, better-documented copy of `src/lib/corrupted-text.js` (not exported by `package.json`, but still shipped). Promoted the documented version into `src/lib/corrupted-text.js` and removed the duplicate. Fixes #7.
|
|
21
|
+
- **TypingAnimation buffer redesign** - `src/core/typing-animation.js` now shows a continuous, always-on buffer phrase to the right of the revealed text (flickering every 100ms on an independent timer) instead of the previous probabilistic 8%-per-tick flash. Added `duration`, `loop`, `loopDelay`, `bufferEnabled`, and `bufferFlickerSpeed` options. Default `typingSpeed` lowered from 40 → 12 chars/sec for readability in no-network demo contexts. `glitchChance` deprecated as a no-op (emits a one-time `console.warn` with migration note). All existing method signatures (`start`, `stop`, `restart`, `settle`) unchanged; new public `destroy()` added for full teardown. Refs #9.
|
|
22
|
+
- **Consolidated NSFW examples** - `examples/advanced/nsfw-corruption.html` removed; its scope is now a checkbox toggle at the top of `examples/basic/typing-animation.html` (resets per page-load, no localStorage — explicit per-visit opt-in per the corrupted-theme content-rating policy).
|
|
23
|
+
- **Updated example pages** - `examples/basic/typing-animation.html` migrated to the new TypingAnimation API (dropped `glitchChance`, added `loop: true, loopDelay: 2000` so demos auto-restart). Removed the now-nonfunctional "Corruption" slider.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- **CI workflow** (`.github/workflows/checks.yml`) - First automated checks for the repo: `npm run build`, `node --check` on every JS file, `dist/theme.min.css` validation, `package.json` `exports` resolution check.
|
|
27
|
+
|
|
28
|
+
### Removed
|
|
29
|
+
- `src/core/corrupted-text.js` (duplicate file; behavior preserved at `src/lib/corrupted-text.js`)
|
|
30
|
+
- `src/css/theme.css` `.container` rule - The unused hero-grid layout (display: grid, 1fr 1fr, min-height: 100vh) that collided with every example page's single-column layout. No page in the repo used the hero behavior; removing the rule fixes 8 previously-broken example pages with zero regression. Closes #9.
|
|
31
|
+
- `examples/advanced/nsfw-corruption.html` - Consolidated into the toggle on `examples/basic/typing-animation.html` (see Changed above).
|
|
32
|
+
- `docs/ROADMAP.md`, `docs/FUTURE_WORK.md` - Orphaned CelesteCLI documents that referenced Go packages, AWS Bedrock, Vertex AI, etc. — entirely irrelevant to this CSS+JS theme package. Also dropped `docs/ROADMAP.md` from `package.json` `files` so future publishes won't ship it.
|
|
33
|
+
|
|
34
|
+
### Deprecated
|
|
35
|
+
- **`TypingAnimation` option `glitchChance`** - Ignored with a one-time `console.warn`. Behavior is now governed by `bufferEnabled: true` (default). Pass `bufferEnabled: false` for a clean typewriter with no buffer.
|
|
36
|
+
|
|
37
|
+
### Documentation
|
|
38
|
+
- `README.md`: updated script tag to point at `src/lib/corrupted-text.js`; removed `nsfw-corruption.html` from the file-tree listing; cross-reference now points at the typing-animation toggle.
|
|
39
|
+
- `examples/basic/corrupted-text.html`: updated script tag and inline reference.
|
|
40
|
+
- `CLAUDE.md` "Current Version" updated from stale 0.1.4 → 0.1.9.
|
|
41
|
+
- `docs/governance/VERSION_REFERENCES.md` "One-Command Version Bump" template restructured as forward-looking (NEW=0.1.10 OLD=0.1.9) so future sed runs leave the template intact.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
17
45
|
## [0.1.7] - 2026-02-07
|
|
18
46
|
|
|
19
47
|
### Security
|
package/README.md
CHANGED
|
@@ -96,16 +96,27 @@ Copy `src/css` into your project (or use `dist/theme.min.css`) and import it loc
|
|
|
96
96
|
│ │ └── event-tracker.js # lifecycle: tracked addEventListener
|
|
97
97
|
│ └── lib/
|
|
98
98
|
│ ├── carousel.js # carousel/slideshow with autoplay + swipe
|
|
99
|
+
│ ├── celeste-proxy.js # Celeste CLI proxy integration
|
|
100
|
+
│ ├── celeste-widget.js # Celeste chat widget
|
|
99
101
|
│ ├── character-corruption.js# auto-corruption for individual characters
|
|
100
102
|
│ ├── components.js # modal, dropdown, tabs, collapse, accordion, toast
|
|
103
|
+
│ ├── corrupted-particles.js # Canvas 2D floating phrase particle background
|
|
101
104
|
│ ├── corrupted-text.js # multi-language glitch animation
|
|
105
|
+
│ ├── corrupted-vortex.js # WebGL raymarched spiral vortex shader
|
|
102
106
|
│ ├── corruption-loading.js # cinematic loading curtain
|
|
103
107
|
│ ├── countdown-widget.js # event countdown with shapes
|
|
104
108
|
│ └── gallery.js # gallery grid with filtering + lightbox
|
|
105
109
|
├── dist/theme.min.css # postcss + cssnano build output
|
|
106
110
|
├── examples/
|
|
107
111
|
│ ├── showcase-complete.html # full design system demo
|
|
108
|
-
│
|
|
112
|
+
│ ├── interactive-components.html # modal, dropdown, tabs, carousel demo
|
|
113
|
+
│ ├── basic/
|
|
114
|
+
│ │ ├── corrupted-text.html # CorruptedText demo
|
|
115
|
+
│ │ ├── multi-gallery.html # multi-instance gallery demo
|
|
116
|
+
│ │ └── typing-animation.html # TypingAnimation demo
|
|
117
|
+
│ └── advanced/
|
|
118
|
+
│ ├── glsl-vortex.html # CorruptedVortex WebGL demo
|
|
119
|
+
│ └── particles-bg.html # CorruptedParticles demo
|
|
109
120
|
├── scripts/static-server.js # ESM static server (Docker)
|
|
110
121
|
└── docs/COMPONENTS_REFERENCE.md # exhaustive snippets
|
|
111
122
|
```
|
|
@@ -414,7 +425,7 @@ document.addEventListener('click', e => {
|
|
|
414
425
|
data-kanji="今日は">
|
|
415
426
|
</span>
|
|
416
427
|
|
|
417
|
-
<script type="module" src="@whykusanagi/corrupted-theme/src/
|
|
428
|
+
<script type="module" src="@whykusanagi/corrupted-theme/src/lib/corrupted-text.js"></script>
|
|
418
429
|
```
|
|
419
430
|
|
|
420
431
|
**Pattern 2: Phrase Flickering (Buffer Corruption)**
|
|
@@ -439,11 +450,11 @@ typing.start('Neural corruption detected... System Online');
|
|
|
439
450
|
- **SFW Mode (Default)**: Cute, playful, atmospheric phrases - safe for all audiences
|
|
440
451
|
- **NSFW Mode (Opt-in)**: Explicit 18+ content - requires `{ nsfw: true }` flag
|
|
441
452
|
|
|
442
|
-
See `examples/basic
|
|
453
|
+
See `examples/basic/typing-animation.html` — it has a toggle switch at the top to opt into NSFW phrases (checkbox resets each page load per the explicit-opt-in spec).
|
|
443
454
|
|
|
444
455
|
## Interactive Components
|
|
445
456
|
|
|
446
|
-
v0.1.
|
|
457
|
+
v0.1.8 adds JS-driven interactive components that self-initialize via `data-ct-*` attributes. Import the components module and everything wires up automatically on `DOMContentLoaded`.
|
|
447
458
|
|
|
448
459
|
```html
|
|
449
460
|
<script type="module">
|
|
@@ -553,11 +564,35 @@ Class | Behavior
|
|
|
553
564
|
|
|
554
565
|
### JavaScript Corruption Components
|
|
555
566
|
|
|
567
|
+
All JS corruption components follow the same lifecycle: `new Class(element, options)` with `start()`, `stop()`, `destroy()` methods. Full API details are in [COMPONENTS_REFERENCE.md](docs/COMPONENTS_REFERENCE.md#javascript-corruption-components).
|
|
568
|
+
|
|
556
569
|
**CorruptedText** - Pattern 1: Character-Level Corruption
|
|
557
570
|
- Visual glitch effect using random characters (Katakana, Hiragana, symbols)
|
|
558
571
|
- Always SFW (no phrases, just character-level noise)
|
|
559
572
|
- Cycles through multi-language variants
|
|
560
573
|
- Class: `.corrupted-multilang`
|
|
574
|
+
- Demo: `examples/basic/corrupted-text.html`
|
|
575
|
+
|
|
576
|
+
```js
|
|
577
|
+
import { initCorruptedText } from '@whykusanagi/corrupted-theme/corrupted-text';
|
|
578
|
+
|
|
579
|
+
// Auto-init all .corrupted-multilang elements
|
|
580
|
+
initCorruptedText();
|
|
581
|
+
|
|
582
|
+
// Or manual:
|
|
583
|
+
const ct = new CorruptedText(element, {
|
|
584
|
+
duration: 3000, // total animation duration (ms)
|
|
585
|
+
cycleDelay: 100, // delay between corruption steps (ms)
|
|
586
|
+
startDelay: 0, // initial delay before animation
|
|
587
|
+
loop: true, // loop or settle on final text
|
|
588
|
+
finalText: null // text to settle on (null = english variant)
|
|
589
|
+
});
|
|
590
|
+
ct.start(); // begin animation
|
|
591
|
+
ct.stop(); // pause
|
|
592
|
+
ct.restart(); // reset to first variant
|
|
593
|
+
ct.settle('Hello'); // stop and settle to specific text
|
|
594
|
+
ct.destroy(); // full teardown
|
|
595
|
+
```
|
|
561
596
|
|
|
562
597
|
**TypingAnimation** - Pattern 2: Phrase Flickering (Buffer Corruption)
|
|
563
598
|
- Simulates neural network decoding corrupted data buffer
|
|
@@ -565,6 +600,107 @@ Class | Behavior
|
|
|
565
600
|
- SFW mode (default): Cute, playful, atmospheric phrases
|
|
566
601
|
- NSFW mode (opt-in): Explicit 18+ content with `{ nsfw: true }`
|
|
567
602
|
- Color: Magenta (#d94f90) for SFW, Purple (#8b5cf6) for NSFW
|
|
603
|
+
- Demo: `examples/basic/typing-animation.html`
|
|
604
|
+
|
|
605
|
+
```js
|
|
606
|
+
import { TypingAnimation } from '@whykusanagi/corrupted-theme/src/core/typing-animation.js';
|
|
607
|
+
|
|
608
|
+
const typing = new TypingAnimation(element, {
|
|
609
|
+
typingSpeed: 50, // ms per character
|
|
610
|
+
glitchChance: 0.3, // probability of glitch per character
|
|
611
|
+
nsfw: false // enable 18+ phrase mode
|
|
612
|
+
});
|
|
613
|
+
typing.start();
|
|
614
|
+
typing.stop();
|
|
615
|
+
typing.settle(); // resolve to final text
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
**CorruptedParticles** - Canvas 2D Floating Phrase Background
|
|
619
|
+
- Floating Japanese phrase particles across three depth layers
|
|
620
|
+
- Mouse hover repel, click burst (6 particles), connection lines between nearby particles
|
|
621
|
+
- SFW/NSFW phrase modes with `includeLewd` toggle
|
|
622
|
+
- Demo: `examples/advanced/particles-bg.html`
|
|
623
|
+
|
|
624
|
+
```js
|
|
625
|
+
import CorruptedParticles from '@whykusanagi/corrupted-theme/corrupted-particles';
|
|
626
|
+
|
|
627
|
+
const particles = new CorruptedParticles(canvas, {
|
|
628
|
+
count: 60, // number of particles
|
|
629
|
+
speed: 1.0, // global speed multiplier
|
|
630
|
+
lineDistance: 150, // max distance for connection lines (px)
|
|
631
|
+
includeLewd: false // enable 18+ phrases (default: off)
|
|
632
|
+
});
|
|
633
|
+
// auto-starts on construction
|
|
634
|
+
particles.stop(); // pause animation
|
|
635
|
+
particles.start(); // resume
|
|
636
|
+
particles.destroy(); // full teardown
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
**CorruptedVortex** - WebGL Raymarched Spiral Vortex
|
|
640
|
+
- WebGL1 raymarched black hole accretion disk shader
|
|
641
|
+
- Quasar mode (hue: null) cycles yellow-to-magenta by depth
|
|
642
|
+
- Fixed hue mode locks to a single color
|
|
643
|
+
- Throttled to ~30fps for GPU efficiency
|
|
644
|
+
- Demo: `examples/advanced/glsl-vortex.html`
|
|
645
|
+
|
|
646
|
+
```js
|
|
647
|
+
import CorruptedVortex from '@whykusanagi/corrupted-theme/corrupted-vortex';
|
|
648
|
+
|
|
649
|
+
const vortex = new CorruptedVortex(canvas, {
|
|
650
|
+
speed: 1.0, // animation speed multiplier
|
|
651
|
+
intensity: 1.0, // brightness/glow intensity
|
|
652
|
+
rotationRate: 1.0, // rotation speed of spiral
|
|
653
|
+
hue: null // null = quasar multi-color, 0-1 = fixed hue
|
|
654
|
+
});
|
|
655
|
+
// auto-starts on construction
|
|
656
|
+
vortex.stop();
|
|
657
|
+
vortex.start();
|
|
658
|
+
vortex.destroy();
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
**Character Corruption** - Auto-Corruption for Individual Characters
|
|
662
|
+
- Replaces English characters with Japanese (Katakana, Hiragana, Kanji)
|
|
663
|
+
- Configurable intensity levels from `NONE` (0) to `MAX_READABLE` (0.45)
|
|
664
|
+
- Auto-corruption via `.auto-corrupt` class with `data-text`, `data-intensity`, `data-interval` attributes
|
|
665
|
+
- Includes phrase libraries (technical UI + personality/demon phrases)
|
|
666
|
+
|
|
667
|
+
```js
|
|
668
|
+
import {
|
|
669
|
+
corruptTextJapanese,
|
|
670
|
+
initAutoCorruption,
|
|
671
|
+
stopAutoCorruption,
|
|
672
|
+
destroyAllAutoCorruption,
|
|
673
|
+
createCorruptedElement,
|
|
674
|
+
getRandomPhrase,
|
|
675
|
+
INTENSITY
|
|
676
|
+
} from '@whykusanagi/corrupted-theme/character-corruption';
|
|
677
|
+
|
|
678
|
+
// Corrupt a string at medium intensity
|
|
679
|
+
corruptTextJapanese('Hello World', INTENSITY.MEDIUM); // → "Heアロo ワoケld"
|
|
680
|
+
|
|
681
|
+
// Auto-init all .auto-corrupt elements on page
|
|
682
|
+
initAutoCorruption();
|
|
683
|
+
|
|
684
|
+
// Create a new auto-corrupting element
|
|
685
|
+
const el = createCorruptedElement('System Online', {
|
|
686
|
+
intensity: 0.35,
|
|
687
|
+
interval: 2000,
|
|
688
|
+
className: 'status-text',
|
|
689
|
+
tag: 'span'
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
// Get a random phrase from the library
|
|
693
|
+
getRandomPhrase('loading'); // → "initializing neural link..."
|
|
694
|
+
getRandomPhrase('personality', 'japanese'); // → "データ破損検出..."
|
|
695
|
+
|
|
696
|
+
// Cleanup
|
|
697
|
+
stopAutoCorruption(element); // stop one element
|
|
698
|
+
destroyAllAutoCorruption(); // stop all
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
**Corruption Loading Screen** - Cinematic Loading Curtain
|
|
702
|
+
- Full-screen dramatic loading animation
|
|
703
|
+
- Module: `src/lib/corruption-loading.js`
|
|
568
704
|
|
|
569
705
|
**Corruption Phrases Library**
|
|
570
706
|
- Normalized SFW/NSFW phrase sets
|
|
@@ -25,6 +25,8 @@ This document provides a comprehensive reference for all components available in
|
|
|
25
25
|
- [NSFW Content Blur](#nsfw-content-blur)
|
|
26
26
|
- [Social Links List](#social-links-list)
|
|
27
27
|
- [Countdown Widget](#countdown-widget)
|
|
28
|
+
11. [JavaScript Corruption Components](#javascript-corruption-components)
|
|
29
|
+
- [CorruptedText](#corruptedtext) | [CorruptedParticles](#corruptedparticles) | [CorruptedVortex](#corruptedvortex) | [Character Corruption](#character-corruption) | [Corruption Loading Screen](#corruption-loading-screen)
|
|
28
30
|
|
|
29
31
|
---
|
|
30
32
|
|
|
@@ -1039,6 +1041,207 @@ initCountdown();
|
|
|
1039
1041
|
|
|
1040
1042
|
---
|
|
1041
1043
|
|
|
1044
|
+
## JavaScript Corruption Components
|
|
1045
|
+
|
|
1046
|
+
Full API reference for all JavaScript corruption modules. All canvas-based components (CorruptedParticles, CorruptedVortex) auto-start on construction and use `ResizeObserver` + `IntersectionObserver` for responsive sizing and visibility-based lifecycle.
|
|
1047
|
+
|
|
1048
|
+
### CorruptedText
|
|
1049
|
+
|
|
1050
|
+
Multi-language glitch animation that cycles through character variants with corruption effects.
|
|
1051
|
+
|
|
1052
|
+
**Source:** `src/lib/corrupted-text.js`
|
|
1053
|
+
**Demo:** `examples/basic/corrupted-text.html`
|
|
1054
|
+
**Import:** `@whykusanagi/corrupted-theme/corrupted-text`
|
|
1055
|
+
|
|
1056
|
+
```js
|
|
1057
|
+
const ct = new CorruptedText(element, options);
|
|
1058
|
+
```
|
|
1059
|
+
|
|
1060
|
+
**Constructor Options:**
|
|
1061
|
+
|
|
1062
|
+
| Option | Type | Default | Description |
|
|
1063
|
+
|--------|------|---------|-------------|
|
|
1064
|
+
| `duration` | number | `3000` | Total animation duration (ms) |
|
|
1065
|
+
| `cycleDelay` | number | `100` | Delay between character corruption steps (ms) |
|
|
1066
|
+
| `startDelay` | number | `0` | Initial delay before animation starts (ms) |
|
|
1067
|
+
| `loop` | boolean | `true` | Loop animation or settle on final text |
|
|
1068
|
+
| `finalText` | string\|null | `null` | Text to settle on when not looping (null = english variant) |
|
|
1069
|
+
|
|
1070
|
+
**Data Attributes** (read from element):
|
|
1071
|
+
|
|
1072
|
+
| Attribute | Description |
|
|
1073
|
+
|-----------|-------------|
|
|
1074
|
+
| `data-english` | English text (defaults to `element.textContent`) |
|
|
1075
|
+
| `data-romaji` | Romaji (romanized Japanese) |
|
|
1076
|
+
| `data-hiragana` | Hiragana text |
|
|
1077
|
+
| `data-katakana` | Katakana text |
|
|
1078
|
+
| `data-kanji` | Kanji text |
|
|
1079
|
+
|
|
1080
|
+
**Methods:**
|
|
1081
|
+
|
|
1082
|
+
| Method | Description |
|
|
1083
|
+
|--------|-------------|
|
|
1084
|
+
| `start()` | Begin animation (no-op if already running) |
|
|
1085
|
+
| `stop()` | Pause animation and clear all timers |
|
|
1086
|
+
| `animate()` | Cycle to next text variant with corruption effect |
|
|
1087
|
+
| `corruptToText(targetText, callback)` | Corrupt display to target text over 20 steps |
|
|
1088
|
+
| `restart()` | Reset to first variant and restart animation |
|
|
1089
|
+
| `settle(finalText)` | Stop and settle to final text with corruption transition |
|
|
1090
|
+
| `destroy()` | Cleanup and remove element reference |
|
|
1091
|
+
|
|
1092
|
+
**Auto-Initialization:**
|
|
1093
|
+
|
|
1094
|
+
```js
|
|
1095
|
+
import { initCorruptedText } from '@whykusanagi/corrupted-theme/corrupted-text';
|
|
1096
|
+
initCorruptedText(); // inits all .corrupted-multilang elements
|
|
1097
|
+
```
|
|
1098
|
+
|
|
1099
|
+
Also auto-called on `DOMContentLoaded`.
|
|
1100
|
+
|
|
1101
|
+
---
|
|
1102
|
+
|
|
1103
|
+
### CorruptedParticles
|
|
1104
|
+
|
|
1105
|
+
Canvas 2D floating Japanese phrase background with three depth layers, mouse interaction, and connection lines.
|
|
1106
|
+
|
|
1107
|
+
**Source:** `src/lib/corrupted-particles.js`
|
|
1108
|
+
**Demo:** `examples/advanced/particles-bg.html`
|
|
1109
|
+
**Import:** `@whykusanagi/corrupted-theme/corrupted-particles`
|
|
1110
|
+
|
|
1111
|
+
```js
|
|
1112
|
+
const particles = new CorruptedParticles(canvas, options);
|
|
1113
|
+
```
|
|
1114
|
+
|
|
1115
|
+
**Constructor Options:**
|
|
1116
|
+
|
|
1117
|
+
| Option | Type | Default | Description |
|
|
1118
|
+
|--------|------|---------|-------------|
|
|
1119
|
+
| `count` | number | `60` | Number of particles to render |
|
|
1120
|
+
| `speed` | number | `1.0` | Global speed multiplier for particle movement |
|
|
1121
|
+
| `lineDistance` | number | `150` | Max distance between particles for connection lines (px) |
|
|
1122
|
+
| `includeLewd` | boolean | `false` | Enable 18+ phrase mode (logs console warning) |
|
|
1123
|
+
|
|
1124
|
+
**Methods:**
|
|
1125
|
+
|
|
1126
|
+
| Method | Description |
|
|
1127
|
+
|--------|-------------|
|
|
1128
|
+
| `init()` | Initialize animation system, event listeners, observers (called automatically) |
|
|
1129
|
+
| `start()` | Begin animation loop via `requestAnimationFrame` |
|
|
1130
|
+
| `stop()` | Pause animation (preserves state) |
|
|
1131
|
+
| `destroy()` | Full teardown: remove listeners, clear particles, disconnect observers |
|
|
1132
|
+
|
|
1133
|
+
**Properties:**
|
|
1134
|
+
|
|
1135
|
+
| Property | Type | Description |
|
|
1136
|
+
|----------|------|-------------|
|
|
1137
|
+
| `canvas` | HTMLCanvasElement | Reference to canvas element |
|
|
1138
|
+
| `ctx` | CanvasRenderingContext2D | Canvas rendering context |
|
|
1139
|
+
| `particles` | Array | Currently active particle objects |
|
|
1140
|
+
| `mouse` | Object | `{x, y}` cursor position (updated on mousemove) |
|
|
1141
|
+
|
|
1142
|
+
**Behaviors:**
|
|
1143
|
+
- Hover: particles repel from cursor
|
|
1144
|
+
- Click: burst of 6 particles at click location
|
|
1145
|
+
- Three depth layers with different speeds and opacity
|
|
1146
|
+
- Auto-starts/stops based on viewport intersection
|
|
1147
|
+
- Adjusts particle count for mobile viewports
|
|
1148
|
+
|
|
1149
|
+
---
|
|
1150
|
+
|
|
1151
|
+
### CorruptedVortex
|
|
1152
|
+
|
|
1153
|
+
WebGL1 raymarched black hole accretion disk shader with corona and depth-driven color cycling.
|
|
1154
|
+
|
|
1155
|
+
**Source:** `src/lib/corrupted-vortex.js`
|
|
1156
|
+
**Demo:** `examples/advanced/glsl-vortex.html`
|
|
1157
|
+
**Import:** `@whykusanagi/corrupted-theme/corrupted-vortex`
|
|
1158
|
+
|
|
1159
|
+
```js
|
|
1160
|
+
const vortex = new CorruptedVortex(canvas, options);
|
|
1161
|
+
```
|
|
1162
|
+
|
|
1163
|
+
**Constructor Options:**
|
|
1164
|
+
|
|
1165
|
+
| Option | Type | Default | Description |
|
|
1166
|
+
|--------|------|---------|-------------|
|
|
1167
|
+
| `speed` | number | `1.0` | Animation speed multiplier |
|
|
1168
|
+
| `intensity` | number | `1.0` | Brightness/glow intensity multiplier |
|
|
1169
|
+
| `rotationRate` | number | `1.0` | Rotation speed of vortex spiral |
|
|
1170
|
+
| `hue` | number\|null | `null` | `null` = quasar mode (depth-driven yellow→magenta), `0-1` = fixed hue |
|
|
1171
|
+
|
|
1172
|
+
**Methods:**
|
|
1173
|
+
|
|
1174
|
+
| Method | Description |
|
|
1175
|
+
|--------|-------------|
|
|
1176
|
+
| `init()` | Initialize WebGL context, compile shaders, set up buffer (called automatically) |
|
|
1177
|
+
| `start()` | Begin render loop (throttled to ~30fps) |
|
|
1178
|
+
| `stop()` | Pause rendering |
|
|
1179
|
+
| `destroy()` | Delete GL program/buffer, disconnect observers |
|
|
1180
|
+
|
|
1181
|
+
**Properties:**
|
|
1182
|
+
|
|
1183
|
+
| Property | Type | Description |
|
|
1184
|
+
|----------|------|-------------|
|
|
1185
|
+
| `canvas` | HTMLCanvasElement | Reference to canvas element |
|
|
1186
|
+
| `gl` | WebGLRenderingContext\|null | WebGL context (null if unsupported) |
|
|
1187
|
+
| `program` | WebGLProgram | Compiled shader program |
|
|
1188
|
+
| `options` | Object | Configuration (can be modified at runtime) |
|
|
1189
|
+
|
|
1190
|
+
**Notes:**
|
|
1191
|
+
- Renders at half-resolution for GPU efficiency
|
|
1192
|
+
- DPR capped at 2.0
|
|
1193
|
+
- Falls back gracefully if WebGL unavailable
|
|
1194
|
+
|
|
1195
|
+
---
|
|
1196
|
+
|
|
1197
|
+
### Character Corruption
|
|
1198
|
+
|
|
1199
|
+
Auto-corruption module for replacing English characters with Japanese characters at configurable intensity levels.
|
|
1200
|
+
|
|
1201
|
+
**Source:** `src/lib/character-corruption.js`
|
|
1202
|
+
**Import:** `@whykusanagi/corrupted-theme/character-corruption`
|
|
1203
|
+
|
|
1204
|
+
**Intensity Constants:**
|
|
1205
|
+
|
|
1206
|
+
| Constant | Value | Use Case |
|
|
1207
|
+
|----------|-------|----------|
|
|
1208
|
+
| `INTENSITY.NONE` | `0.0` | No corruption |
|
|
1209
|
+
| `INTENSITY.MINIMAL` | `0.15` | Subtle effect |
|
|
1210
|
+
| `INTENSITY.LOW` | `0.25` | Section headers |
|
|
1211
|
+
| `INTENSITY.MEDIUM` | `0.35` | Dashboards (recommended) |
|
|
1212
|
+
| `INTENSITY.HIGH` | `0.45` | Maximum readable |
|
|
1213
|
+
| `INTENSITY.MAX_READABLE` | `0.45` | Alias for HIGH |
|
|
1214
|
+
|
|
1215
|
+
**Functions:**
|
|
1216
|
+
|
|
1217
|
+
| Function | Description |
|
|
1218
|
+
|----------|-------------|
|
|
1219
|
+
| `corruptTextJapanese(text, intensity?)` | Replace English chars with Japanese (50% Katakana, 25% Kanji, 15% Keep+Insert, 10% Hiragana). Default intensity: `0.3` |
|
|
1220
|
+
| `corruptTextSemantic(text, context?, intensity?)` | Context-aware corruption (currently falls back to `corruptTextJapanese`) |
|
|
1221
|
+
| `initAutoCorruption()` | Init all `.auto-corrupt` elements. Reads `data-text`, `data-intensity`, `data-interval`. Auto-called on `DOMContentLoaded` |
|
|
1222
|
+
| `stopAutoCorruption(element)` | Stop re-corruption interval for a specific element |
|
|
1223
|
+
| `restartAutoCorruption(element)` | Stop and restart corruption cycle for element |
|
|
1224
|
+
| `destroyAllAutoCorruption()` | Stop all active corruption intervals |
|
|
1225
|
+
| `createCorruptedElement(text, options?)` | Create new element with auto-corruption. Options: `intensity`, `interval`, `className`, `tag` |
|
|
1226
|
+
| `getRandomPhrase(category, subcategory?)` | Random phrase from library. Categories: `loading`, `processing`, `analyzing`, `corrupting`, `watching`, `void`. Personality subcategories: `english`, `japanese`, `romaji` |
|
|
1227
|
+
|
|
1228
|
+
**Exported Objects:**
|
|
1229
|
+
|
|
1230
|
+
| Object | Description |
|
|
1231
|
+
|--------|-------------|
|
|
1232
|
+
| `CORRUPTION_PHRASES` | Technical UI phrases grouped by category |
|
|
1233
|
+
| `PERSONALITY_PHRASES` | Personality/demon phrases in English, Japanese, Romaji |
|
|
1234
|
+
|
|
1235
|
+
---
|
|
1236
|
+
|
|
1237
|
+
### Corruption Loading Screen
|
|
1238
|
+
|
|
1239
|
+
Full-screen cinematic loading curtain with dramatic corruption animation.
|
|
1240
|
+
|
|
1241
|
+
**Source:** `src/lib/corruption-loading.js`
|
|
1242
|
+
|
|
1243
|
+
---
|
|
1244
|
+
|
|
1042
1245
|
## Related Documentation
|
|
1043
1246
|
|
|
1044
1247
|
- [README.md](../README.md) - Main documentation and quick start guide
|
|
@@ -1047,7 +1250,7 @@ initCountdown();
|
|
|
1047
1250
|
|
|
1048
1251
|
---
|
|
1049
1252
|
|
|
1050
|
-
**Last Updated:** 2026-
|
|
1051
|
-
**Version:** 2.
|
|
1253
|
+
**Last Updated:** 2026-04-05
|
|
1254
|
+
**Version:** 2.1
|
|
1052
1255
|
**Status:** Complete and Production Ready
|
|
1053
1256
|
|
|
@@ -104,7 +104,7 @@ Increment when you make **backward-compatible bug fixes**:
|
|
|
104
104
|
- **Public API**: Not stable yet
|
|
105
105
|
- **Use case**: Early adopters, experimentation
|
|
106
106
|
|
|
107
|
-
**Current Celeste version**: `0.1.
|
|
107
|
+
**Current Celeste version**: `0.1.9` (pre-1.0.0)
|
|
108
108
|
|
|
109
109
|
### Post-1.0.0 (Stable)
|
|
110
110
|
|
|
@@ -441,7 +441,7 @@ npm view @whykusanagi/corrupted-theme version
|
|
|
441
441
|
|
|
442
442
|
**Last Updated**: 2025-12-13
|
|
443
443
|
**Version**: 1.0.0
|
|
444
|
-
**Current Celeste Version**: 0.1.
|
|
444
|
+
**Current Celeste Version**: 0.1.9
|
|
445
445
|
**Versioning Spec**: Semantic Versioning 2.0.0
|
|
446
446
|
**Maintainer**: Celeste Brand System
|
|
447
447
|
**Status**: ✅ Active Policy
|