|
| 1 | +# Timer Ninja — GitHub Pages Planning Document |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +A Jekyll-based GitHub Pages site serving as both a visually striking landing page and full documentation hub for the Timer Ninja library. Deployed from the `docs/` folder on the `main` branch. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Decisions |
| 10 | + |
| 11 | +| Decision | Choice | |
| 12 | +|---|---| |
| 13 | +| **Tech stack** | Jekyll (GitHub Pages native, no build CI needed) | |
| 14 | +| **Theme** | Fully custom (no base theme) for max creative control | |
| 15 | +| **Page scope** | Multi-page: Landing + User Guide + Examples + Advanced Usage | |
| 16 | +| **Navigation** | Sticky top navbar with logo, page links, GitHub link, day/night toggle | |
| 17 | +| **Hero style** | Full-screen with animated gradient/particle background + ninja sloth mascot | |
| 18 | +| **Code comparison** | Side-by-side panels (Traditional vs Timer Ninja) | |
| 19 | +| **Animations** | Rich — parallax hero, scroll-triggered fade/slide, animated trace output, typing code effect | |
| 20 | +| **Mascot usage** | Heavy — hero, CTA section, footer, 404 page | |
| 21 | +| **Day/night mode** | CSS custom properties + JS toggle, preference saved in localStorage | |
| 22 | +| **Primary color** | `#46bfc6` (light blue) with complementary palette | |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Design System |
| 27 | + |
| 28 | +### Color Palette |
| 29 | + |
| 30 | +**Light Mode:** |
| 31 | +| Token | Value | Usage | |
| 32 | +|---|---|---| |
| 33 | +| Primary | `#46bfc6` | Brand color, buttons, links, accents | |
| 34 | +| Primary Dark | `#3aa3a9` | Hover states | |
| 35 | +| Primary Light | `#6dd5db` | Gradients, glow | |
| 36 | +| Background | `#ffffff` | Page background | |
| 37 | +| Surface | `#f5fafa` | Section backgrounds | |
| 38 | +| Text | `#1a2b3c` | Body text | |
| 39 | +| Text Muted | `#5a6b7c` | Secondary text | |
| 40 | +| Code BG | `#f0f6f6` | Code block backgrounds | |
| 41 | + |
| 42 | +**Dark Mode:** |
| 43 | +| Token | Value | Usage | |
| 44 | +|---|---|---| |
| 45 | +| Primary | `#46bfc6` | Unchanged | |
| 46 | +| Primary Light | `#6dd5db` | Highlighted elements | |
| 47 | +| Background | `#0d1520` | Page background | |
| 48 | +| Surface | `#14202e` | Section backgrounds | |
| 49 | +| Text | `#e8f0f2` | Body text | |
| 50 | +| Text Muted | `#8fa3b2` | Secondary text | |
| 51 | +| Code BG | `#111d2b` | Code block backgrounds | |
| 52 | + |
| 53 | +### Typography |
| 54 | +- **Body:** Inter (Google Fonts) |
| 55 | +- **Code:** JetBrains Mono (Google Fonts) |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Site Structure |
| 60 | + |
| 61 | +``` |
| 62 | +docs/ |
| 63 | +├── _config.yml # Jekyll configuration |
| 64 | +├── _data/ |
| 65 | +│ └── navigation.yml # Navbar links |
| 66 | +├── _includes/ |
| 67 | +│ ├── head.html # Meta, fonts, CSS, theme init script |
| 68 | +│ ├── navbar.html # Sticky navbar with theme toggle |
| 69 | +│ └── footer.html # Footer with mascot |
| 70 | +├── _layouts/ |
| 71 | +│ ├── default.html # Base layout |
| 72 | +│ ├── home.html # Landing page layout (includes particles + typing JS) |
| 73 | +│ └── docs.html # Documentation layout (sidebar TOC + scrollspy) |
| 74 | +├── _sass/ |
| 75 | +│ ├── _variables.scss # Design tokens, CSS custom properties |
| 76 | +│ ├── _base.scss # Reset, typography, global styles |
| 77 | +│ ├── _navbar.scss # Sticky nav, hamburger menu |
| 78 | +│ ├── _hero.scss # Hero section, float animation |
| 79 | +│ ├── _features.scss # Feature cards grid |
| 80 | +│ ├── _code.scss # Code panels, trace output, quickstart steps, tabs |
| 81 | +│ ├── _docs.scss # Documentation sidebar + content styles |
| 82 | +│ ├── _animations.scss # Keyframes, scroll-triggered classes |
| 83 | +│ ├── _footer.scss # Footer styles |
| 84 | +│ └── _dark-mode.scss # Dark mode overrides |
| 85 | +├── assets/ |
| 86 | +│ ├── css/main.scss # SCSS entry point |
| 87 | +│ ├── js/ |
| 88 | +│ │ ├── theme-toggle.js # Day/night mode + hamburger + nav scroll |
| 89 | +│ │ ├── animations.js # IntersectionObserver scroll reveals + tabs + trace |
| 90 | +│ │ ├── particles.js # Canvas particle system for hero |
| 91 | +│ │ ├── typing-effect.js # Typing animation for code comparison |
| 92 | +│ │ └── docs-toc.js # Auto-generated TOC + scrollspy for docs |
| 93 | +│ └── images/ |
| 94 | +│ └── mascot.png # Ninja sloth mascot |
| 95 | +├── index.html # Landing page |
| 96 | +├── user-guide.md # User Guide (from wiki) |
| 97 | +├── examples.md # Examples (from wiki) |
| 98 | +├── advanced-usage.md # Advanced Usage (from wiki) |
| 99 | +├── 404.html # Custom 404 page |
| 100 | +└── Gemfile # Jekyll dependencies |
| 101 | +``` |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## Landing Page Sections |
| 106 | + |
| 107 | +1. **Hero** — Full-screen animated gradient with canvas particles, floating mascot, tagline, CTA buttons, version badge |
| 108 | +2. **Why Timer Ninja?** — 6 feature cards in responsive grid: One Annotation, Visual Call Tree, Block Tracking, Smart Thresholds, Zero Dependencies, Thread-Safe |
| 109 | +3. **Before & After** — Side-by-side code comparison with typing animation: 6 lines of boilerplate → 1 annotation |
| 110 | +4. **See It In Action** — Terminal-style trace output with line-by-line reveal animation |
| 111 | +5. **Quick Start** — 4-step guide with tabbed Maven/Gradle code blocks |
| 112 | +6. **Block Tracking Highlight** — Dedicated showcase of `TimerNinjaBlock.measure()` API |
| 113 | +7. **CTA** — Final call-to-action with mascot |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +## Documentation Pages |
| 118 | + |
| 119 | +| Page | Source | Layout | |
| 120 | +|---|---|---| |
| 121 | +| User Guide | `wiki/User-Guide.md` | `docs` (sidebar TOC) | |
| 122 | +| Examples | `wiki/Examples.md` | `docs` (sidebar TOC) | |
| 123 | +| Advanced Usage | `wiki/Advanced-Usage.md` | `docs` (sidebar TOC) | |
| 124 | + |
| 125 | +Each page includes: |
| 126 | +- Auto-generated sidebar TOC from H2/H3 headings |
| 127 | +- Scrollspy highlighting current section |
| 128 | +- Previous/Next page navigation |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## Features |
| 133 | + |
| 134 | +### Day/Night Mode |
| 135 | +- Toggle button in navbar (sun/moon icon) |
| 136 | +- CSS custom properties for all colors |
| 137 | +- Persisted in `localStorage` |
| 138 | +- Falls back to `prefers-color-scheme` system preference |
| 139 | +- Prevents FOUC with inline `<script>` in `<head>` |
| 140 | + |
| 141 | +### Animations |
| 142 | +- **Hero particles** — Canvas-based, 60 translucent circles with connecting lines |
| 143 | +- **Scroll reveals** — IntersectionObserver: fade-up, fade-left, fade-right, scale-up |
| 144 | +- **Staggered grid** — Feature cards animate in with sequential delays |
| 145 | +- **Trace reveal** — Console lines appear one by one (120ms intervals) |
| 146 | +- **Typing effect** — Code characters type in sequentially with cursor blink |
| 147 | +- **Parallax** — Hero mascot and background shift on scroll |
| 148 | +- **Float animation** — Mascot gently bobs up and down |
| 149 | + |
| 150 | +### Responsive |
| 151 | +- Navbar collapses to hamburger on mobile (< 768px) |
| 152 | +- Feature cards: 3 → 2 → 1 column |
| 153 | +- Code panels: side-by-side → stacked |
| 154 | +- Docs sidebar hidden on mobile (< 1024px) |
| 155 | + |
| 156 | +--- |
| 157 | + |
| 158 | +## Deployment |
| 159 | + |
| 160 | +1. Push `docs/` to `main` branch |
| 161 | +2. GitHub Settings → Pages → Source: "Deploy from a branch" → `main` / `/docs` |
| 162 | +3. Site available at `https://thanglequoc.github.io/timer-ninja/` |
| 163 | + |
| 164 | +### Local Development |
| 165 | + |
| 166 | +```bash |
| 167 | +cd docs |
| 168 | +bundle install |
| 169 | +bundle exec jekyll serve |
| 170 | +# → http://localhost:4000/timer-ninja/ |
| 171 | +``` |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## Verification Checklist |
| 176 | + |
| 177 | +- [ ] Jekyll builds without errors |
| 178 | +- [ ] All 4 pages load correctly |
| 179 | +- [ ] Dark/light mode toggles properly |
| 180 | +- [ ] localStorage persists theme preference |
| 181 | +- [ ] Scroll animations fire on all sections |
| 182 | +- [ ] Particle canvas renders in hero |
| 183 | +- [ ] Typing effect plays on code comparison |
| 184 | +- [ ] Trace output reveals line by line |
| 185 | +- [ ] Tab switchers work (Maven/Gradle) |
| 186 | +- [ ] Navbar hamburger works on mobile |
| 187 | +- [ ] Feature cards grid is responsive |
| 188 | +- [ ] Code panels stack on mobile |
| 189 | +- [ ] Docs sidebar TOC generates correctly |
| 190 | +- [ ] Scrollspy highlights active section |
| 191 | +- [ ] Previous/Next page navigation works |
| 192 | +- [ ] 404 page renders correctly |
| 193 | +- [ ] All links resolve (no broken links) |
| 194 | +- [ ] Mascot image loads |
0 commit comments