Commit Graph

126 Commits

Author SHA1 Message Date
George Powell
1eb8eb2f04 Added umami event to Apple signin and fixed spacing 2026-03-14 18:40:57 -04:00
George Powell
ae4482a551 refactor: move View Stats and Sign In/Out buttons into DevButtons
Consolidates the dev-only stats and auth buttons into the DevButtons
component, passing user and onSignIn as props. Also comments out the
Twitter link in SocialLinks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 11:47:03 -04:00
George Powell
884bbe65c7 feat: add about page, sitemap, social links component, Apple sign-in
prompt on win screen, and layout/theme improvements

  ## New features

  - **About page** (`src/routes/about/`): New static about page rendered
    from `static/about.md` using the `marked` library (added as a
    dependency). Includes the project backstory content.

  - **XML sitemap** (`src/routes/sitemap.xml/`): Dynamic sitemap
    endpoint for SEO, registered in `static/robots.txt` via `Sitemap:`
    directive.

  - **Apple Sign In prompt on win screen** (`WinScreen.svelte`): When
    the game is won and the user is not logged in, a "Sign in to save
    your streak & see your stats" prompt with an Apple Sign In button is
    shown below the share card. Passes `anonymousId` so stats migrate on
    sign-up. Driven by new `isLoggedIn` and `anonymousId` props, passed
    from `+page.svelte`.

  ## Refactoring

  - **`SocialLinks` component**
    (`src/lib/components/SocialLinks.svelte`): Extracted the Bluesky,
    Twitter/X, and email social link icons from `Credits.svelte` into a
    reusable component. `Credits.svelte` now imports and renders
    `<SocialLinks />`.

  - **`ThemeToggle` component**
    (`src/lib/components/ThemeToggle.svelte`): New component for
    toggling light/dark mode, persisted to `localStorage`. Currently
    rendered but hidden (`hidden` class) in `+page.svelte` —
    infrastructure is in place for future use.

  ## Layout changes

  - **`+layout.svelte`**: Moved the page title/header (`<h1>` with
    `TitleAnimation`) and the gradient background wrapper from
    `+page.svelte` into the root layout, so it applies across all
    routes. Also removed the `browser` guard around the analytics script
    injection (it's
    already inside `onMount` which is client-only). Added `<meta
    name="description">`.

  - **`+page.svelte`**: Removed the title/header and gradient wrapper
    (now in layout). Minor formatting cleanup (reformatted `SearchInput`
    props, moved `currentDate` derived state earlier). `ThemeToggle`
    import swapped in place of `TitleAnimation` (which moved to layout).

  ## Styling

  - **`layout.css`**: Added `@custom-variant dark` for class-based dark
    mode toggling (supports `.dark` class on `<html>`). Added explicit
    `html.dark` / `html.light` rules alongside the existing
    `prefers-color-scheme` media query, so the `ThemeToggle` component
    can
    override the system preference. Added background transition
    animation.
2026-03-12 18:22:59 -04:00
George Powell
3de55ba216 removed large xml and systemd service 2026-02-28 03:06:49 -05:00
George Powell
6e74fffb65 no longer initializes embeddings model on startup 2026-02-28 02:48:46 -05:00
George Powell
1ae2b2ac6c fix: remove trailing comma in share text when there is no streak
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 15:13:13 -05:00
George Powell
a188be167b added single day history button 2026-02-26 15:04:34 -05:00
George Powell
e550965086 add unit tests for core game, bible, share, and stats utilities
146 tests covering evaluateGuess, grading, ordinals, bible data
integrity, section counts, share text generation, and stat
string helpers. Also fixes toOrdinal for 111-113 (was using
>= 11 && <= 13 instead of % 100 check).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 15:02:46 -05:00
George Powell
03429b17cc fix: prevent single-day streaks from being shown
A streak requires at least 2 consecutive days. Return 0 when the
count is less than 2 so the streak counter is not displayed after
completing only today's puzzle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 14:57:44 -05:00
George Powell
3ee7331510 remove grade distribution and recent performance sections from stats page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 14:40:25 -05:00
George Powell
592fa917cd added device-dependent dark mode 2026-02-26 07:27:30 -05:00
George Powell
ad1774e6b0 removed url from share, like wordle 2026-02-26 06:55:04 -05:00
George Powell
e1a665ba63 added toggle verse display and fixed timer spacing 2026-02-26 01:23:13 -05:00
George Powell
f3c9feaf97 removed verse snippet from share 2026-02-26 00:52:00 -05:00
George Powell
a5cf248e29 added streak container 2026-02-26 00:51:48 -05:00
George Powell
f9f3f3de12 Update deploy.sh 2026-02-24 19:10:53 -05:00
George Powell
abab886d1a abort if already up to date 2026-02-24 18:11:42 -05:00
George Powell
acc82af7cd updated deploy script 2026-02-24 18:04:28 -05:00
George Powell
fc674d6008 updated done list 2026-02-22 23:29:35 -05:00
George Powell
087a476df8 Remove verse reference from copied text
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 23:19:48 -05:00
George Powell
ba45cbdc37 Progressive disclosure in search dropdown based on guess count
Shows book names only (A-Z) for the first 3 guesses, reveals Old/New
Testament groupings after 3 guesses, and full section-level groupings
in canonical Bible order after 9 guesses. Adds a status banner above
the search bar to inform players when new structure becomes visible.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 23:19:00 -05:00
George Powell
1de436534c added copy verse text button 2026-02-22 22:50:28 -05:00
George Powell
3bcd7ea266 Fixed some things and added analytics events back 2026-02-22 22:29:35 -05:00
George Powell
7ecc84ffbc Centered main share button text 2026-02-22 19:30:35 -05:00
George Powell
3d78353a90 new share button design 2026-02-22 19:26:40 -05:00
George Powell
bd36f29419 Updated streak-percentile to count all players from the last 30 days (or
all active streaks if players have a greater than 30 day streak)
2026-02-22 00:25:08 -05:00
George Powell
3036264d44 Add Rybbit analytics alongside Umami
- Load Rybbit script via app.html (recommended SvelteKit approach)
- Mirror all Umami custom events (First guess, Guessed correctly, Share, Copy to Clipboard, social link clicks) with rybbit.event()
- Identify logged-in users with name/email traits; anonymous users by stable UUID

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 17:13:41 -05:00
George Powell
6554ef8f41 Added streak percentage 2026-02-21 16:17:06 -05:00
George Powell
c3307b3920 Added streak counter 2026-02-21 01:24:16 -05:00
George Powell
19646c72ca WIP new share menu 2026-02-21 00:38:09 -05:00
George Powell
e592751a1c removed unneccesary code i think 2026-02-19 17:59:23 -05:00
George Powell
77cc83841d correctly pass anonymousid to the auth modal in the root route 2026-02-18 18:32:45 -05:00
George Powell
e8b2d2e35e Possible fix for sign in with apple migrations failing 2026-02-18 17:54:01 -05:00
George Powell
c50cccd3d3 validateSessionToken() now returns more user data 2026-02-18 14:53:31 -05:00
George Powell
638a789a0f device always replaces local localStorage completion with the
authoritative DB record
2026-02-18 14:48:02 -05:00
George Powell
e815e15ce5 Countdown timer now shows when there is a new verse available 2026-02-18 14:03:07 -05:00
George Powell
e6081c28f1 Refactor game logic into utility modules and add cross-device sync
Extracted game state management, share logic, and stats API calls into dedicated modules (game-persistence.svelte.ts, share.ts, stats-client.ts), and moved daily verse loading to client-side to fix timezone issues. Added a guesses column to daily_completions for cross-device state restoration for logged-in users, a new GET /api/stats endpoint, and a staging deploy script.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 13:25:40 -05:00
George Powell
2de4e9e2a7 Another attempt at fixing Cross-site POST form submissions are forbidden 2026-02-13 01:56:24 -05:00
George Powell
ea7a848125 Allow for apple bypass 2026-02-13 01:52:48 -05:00
George Powell
1719e0bbbf switched to Bun.env for apple-auth.ts 2026-02-13 01:47:29 -05:00
George Powell
885adad756 added test.bibdle.com domain 2026-02-13 01:35:31 -05:00
George Powell
1b96919acd added --bun flag to deploy.sh 2026-02-13 01:33:36 -05:00
George Powell
8ef2a41a69 Added Sign In with Apple test route 2026-02-13 01:06:21 -05:00
George Powell
ac6ec051d4 Added Sign In with Apple 2026-02-13 00:57:44 -05:00
George Powell
a12c7d011a added some nice animation details 2026-02-13 00:36:06 -05:00
George Powell
77ffd6fbee Implement client-side timezone handling for daily verses
Refactored the daily verse system to properly handle users across different
timezones. Previously, the server used a fixed timezone (America/New_York),
causing users in other timezones to see incorrect verses near midnight.

Key changes:

**Server-side refactoring:**
- Extract `getVerseForDate()` into `src/lib/server/daily-verse.ts` for reuse
- Page load now uses UTC date for initial SSR (fast initial render)
- New `/api/daily-verse` POST endpoint accepts client-calculated date
- Server no longer calculates dates; uses client-provided date directly

**Client-side timezone handling:**
- Client calculates local date using browser's timezone on mount
- If server date doesn't match local date, fetches correct verse via API
- Changed verse data from `$derived` to `$state` to fix reactivity issues
- Mutating props was causing updates to fail; now uses local state
- Added effect to reload page when user returns to stale tab on new day

**Stats page improvements:**
- Accept `tz` query parameter for accurate streak calculations
- Use client's local date when determining "today" for current streaks
- Prevents timezone-based streak miscalculations

**Developer experience:**
- Added debug panel showing client local time vs daily verse date
- Added console logging for timezone fetch process
- Comprehensive test suite for timezone handling and streak logic

**UI improvements:**
- Share text uses 📜 emoji for logged-in users, 📖 for anonymous
- Stats link now includes timezone parameter for accurate display

This ensures users worldwide see the correct daily verse for their local
date, and streaks are calculated based on their timezone, not server time.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 23:37:08 -05:00
George Powell
f6652e59a7 fixed weird signin bug 2026-02-12 20:24:38 -05:00
George Powell
290fb06fe9 Reordered guesses table and added emphasis 2026-02-11 23:42:50 -05:00
George Powell
df8a9e62bb Add staggered page load animations
Implement elegant fadeInUp animations with staggered delays for main page
elements to create a polished, progressive reveal effect on page load.

Changes:
- layout.css: Added fadeInUp keyframes and delay utility classes
  (200ms, 400ms, 600ms, 800ms)
- +page.svelte: Applied animations to title, date, verse display,
  search input, guesses table, and credits

Animation sequence:
1. Title (0ms)
2. Date + Verse Display (200ms)
3. Search Input (400ms)
4. Guesses Table (600ms)
5. Credits (800ms - when won)

Creates a smooth, professional page load experience without changing any
existing design or functionality.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 17:24:14 -05:00
George Powell
730b65201a Redesign stats page with dark theme and enhanced statistics
- Implement dark gradient background with glassmorphism cards
- Add new statistics: worst day, best book, most seen book, unique books by testament
- Design mobile-first responsive grid layout with optimized spacing
- Update Container component to support dark theme (bg-white/10, border-white/20)
- Calculate book-specific stats by linking completions to daily verses
- Improve visual hierarchy with icons and color-coded stat cards

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 13:01:53 -05:00