A modular, framework-agnostic input engine ecosystem for the web.
A stratagem-style input pattern engine inspired by games like Helldivers 2, bringing directional sequences, key combinations, and touch gesture detection to modern web applications.
This repository is organized as a monorepo containing the following packages:
Secret Sequence is perfect for:
- 🎮 Easter eggs & game-like web experiences
- 🔐 Hidden admin panels
- 🛠 Developer shortcuts
- 🧩 Interactive UI systems
- ⚡ Stratagem-style input mechanics
Secret Sequence follows a layered architecture:
- Core → Pure logic, zero framework dependencies
- Wrappers → Framework-specific integrations (React, Angular, Vue)
- UI (optional) → Visual components built on top
This separation ensures long-term scalability, portability, and framework independence.
The project is designed as a growing ecosystem:
- Core engine (headless)
- Framework wrappers
- Optional UI components
- Devtools (planned)
npm install secret-sequence-coreimport { SecretSequenceEngine } from "secret-sequence-core"
const engine = new SecretSequenceEngine({
sequences: [
{
id: "konami",
sequence: ["up", "up", "down", "down", "left", "right", "left", "right"],
onSuccess: () => console.log("🎉 Konami Code activated!"),
},
],
timeout: 3000,
})
engine.start()
// When done:
// engine.destroy()npm install secret-sequence-core secret-sequence-reactimport { useSecretSequence } from "secret-sequence-react"
function App() {
const { progress } = useSecretSequence({
sequences: [
{
id: "konami",
sequence: ["up", "up", "down", "down", "left", "right", "left", "right"],
onSuccess: () => console.log("🎉 Konami Code activated!"),
},
],
enableTouch: true,
})
return <pre>{JSON.stringify(progress, null, 2)}</pre>
}See the secret-sequence-react package for full documentation.
- ✅ Multi-sequence detection
- ✅ Directional + key combination support
- ✅ Touch gesture detection (swipes)
- ✅ Timeout-based reset
- ✅ Independent progress tracking
- ✅ Headless (bring your own UI)
- ✅ SSR-safe
- ✅ Fully typed with TypeScript
- ✅ Tree-shakeable
- ✅ Zero runtime dependencies
- ✅ Framework-agnostic
- Smart partial matching (KMP algorithm)
- Advanced touch gesture support
- Custom event targets
- Devtools debug mode
- React wrapper package (
secret-sequence-react)
Inspired by the stratagem input system in Helldivers 2, where players input directional sequences under pressure to call tactical support.
Secret Sequence brings that same fast, sequential, multi-pattern input detection to the web.
- input sequence engine
- konami code detection
- directional input handler
- keyboard sequence detection
- touch gesture sequence
Contributions, issues, and feature requests are welcome.
Feel free to open an issue or submit a pull request.
MIT © Diego Alonso