easter-egg-quest 1.0.0
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/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/easter-egg-quest.es.js +4997 -0
- package/dist/easter-egg-quest.umd.js +1 -0
- package/dist/three.module-BYIS7JD4.mjs +30588 -0
- package/dist/types/GameController.d.ts +67 -0
- package/dist/types/config.d.ts +5 -0
- package/dist/types/core/EventBus.d.ts +11 -0
- package/dist/types/core/StateMachine.d.ts +22 -0
- package/dist/types/entry/HiddenEntry.d.ts +43 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/input/InputTracker.d.ts +55 -0
- package/dist/types/narrative/Script.d.ts +7 -0
- package/dist/types/rendering/FallbackRenderer.d.ts +27 -0
- package/dist/types/rendering/HUDRenderer.d.ts +28 -0
- package/dist/types/rendering/NarrativeRenderer.d.ts +29 -0
- package/dist/types/rendering/OverlayManager.d.ts +20 -0
- package/dist/types/rendering/PageBreather.d.ts +29 -0
- package/dist/types/rendering/PageReactor.d.ts +18 -0
- package/dist/types/rendering/ResultsRenderer.d.ts +41 -0
- package/dist/types/rendering/ShrineRenderer.d.ts +32 -0
- package/dist/types/rendering/ThreeRenderer.d.ts +147 -0
- package/dist/types/scoring/Persistence.d.ts +26 -0
- package/dist/types/scoring/ScoringEngine.d.ts +37 -0
- package/dist/types/stages/MotionStage.d.ts +34 -0
- package/dist/types/stages/RhythmStage.d.ts +42 -0
- package/dist/types/stages/StillnessStage.d.ts +32 -0
- package/dist/types/types.d.ts +202 -0
- package/dist/types/utils/helpers.d.ts +29 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Easter Egg Quest Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# ๐ฅ Easter Egg Quest
|
|
2
|
+
|
|
3
|
+
Drop a hidden Easter-themed mini-game onto **any website** with a single line of code. Users discover a secret entry point on your page and solve three poetic riddles โ *Stillness*, *Motion*, *Rhythm* โ to collect three symbolic eggs.
|
|
4
|
+
|
|
5
|
+
**Zero configuration required.** The game overlays your page without breaking layout. Fully self-contained โ Three.js 3D rendering is built in.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
### CDN (simplest)
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<script src="https://unpkg.com/easter-egg-quest"></script>
|
|
13
|
+
<script>
|
|
14
|
+
EasterEggQuest.init();
|
|
15
|
+
</script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
That's it. The game hides itself inside your page content and waits to be discovered.
|
|
19
|
+
|
|
20
|
+
### npm
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install easter-egg-quest
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { EasterEggQuest } from 'easter-egg-quest';
|
|
28
|
+
|
|
29
|
+
EasterEggQuest.init();
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## How It Works
|
|
33
|
+
|
|
34
|
+
1. **Hidden entry** โ the game injects a subtle "start hunt" trigger into existing text on your page
|
|
35
|
+
2. **Stage 1: Stillness** โ stop moving. The egg comes to those who wait
|
|
36
|
+
3. **Stage 2: Motion** โ keep moving. Be the river
|
|
37
|
+
4. **Stage 3: Rhythm** โ find the pulse. Breathe
|
|
38
|
+
5. **Finale** โ all three eggs appear in a 3D carousel with a "Happy Easter!" greeting
|
|
39
|
+
6. **Results** โ a personalized profile card based on your behavior (shareable as image)
|
|
40
|
+
|
|
41
|
+
The user clicks "finish" to close โ the game removes all traces of itself from the DOM.
|
|
42
|
+
|
|
43
|
+
## Configuration
|
|
44
|
+
|
|
45
|
+
All options are optional:
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
EasterEggQuest.init({
|
|
49
|
+
// Lifecycle callbacks
|
|
50
|
+
callbacks: {
|
|
51
|
+
onInit: () => {},
|
|
52
|
+
onEntryFound: () => {},
|
|
53
|
+
onStageStart: (stage) => {},
|
|
54
|
+
onEggFound: (eggIndex) => {},
|
|
55
|
+
onComplete: (score) => {},
|
|
56
|
+
onDestroy: () => {},
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// Stage durations
|
|
60
|
+
stageDurations: {
|
|
61
|
+
stillnessMs: 20000,
|
|
62
|
+
motionMs: 20000,
|
|
63
|
+
rhythmCycles: 6,
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
// Rendering: 'auto' | '3d' | '2d'
|
|
67
|
+
renderer: 'auto',
|
|
68
|
+
|
|
69
|
+
// Accessibility
|
|
70
|
+
accessibility: {
|
|
71
|
+
reducedMotion: 'auto', // follows prefers-reduced-motion
|
|
72
|
+
disableHiddenEntry: false, // shows a visible button instead
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
// Hidden entry targeting
|
|
76
|
+
hiddenEntry: {
|
|
77
|
+
selector: undefined, // CSS selector to limit entry candidates
|
|
78
|
+
excludeSelectors: [], // selectors to exclude
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
// Custom narrative text
|
|
82
|
+
narrative: {
|
|
83
|
+
// Override any dialogue array:
|
|
84
|
+
// stage1Intro: ['your', 'custom', 'lines'],
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## API
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
EasterEggQuest.init(config?) // Start the game
|
|
93
|
+
EasterEggQuest.pause() // Pause
|
|
94
|
+
EasterEggQuest.resume() // Resume
|
|
95
|
+
EasterEggQuest.destroy() // Remove everything, restore DOM
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Safety
|
|
99
|
+
|
|
100
|
+
Designed to be safe on production websites:
|
|
101
|
+
|
|
102
|
+
- **No layout shifts** โ all UI is `position: fixed` overlay
|
|
103
|
+
- **Shadow DOM isolation** โ CSS never collides with your styles
|
|
104
|
+
- **Smart element filtering** โ hidden entry avoids Buy, Delete, Checkout, Submit buttons
|
|
105
|
+
- **Clean destroy** โ removes all DOM elements, listeners, and WebGL resources
|
|
106
|
+
|
|
107
|
+
## Browser Support
|
|
108
|
+
|
|
109
|
+
Chrome/Edge 90+ ยท Firefox 90+ ยท Safari 15+ ยท Mobile browsers
|
|
110
|
+
|
|
111
|
+
Falls back to CSS 2D rendering if WebGL is unavailable.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
MIT
|