Commit Graph

146 Commits

Author SHA1 Message Date
George Powell
e45ac28169 rainbow glow 2026-03-25 02:25:04 -04:00
George Powell
3d578a9eb8 feat: add Google sign-in button to WinScreen and footer provider label
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 01:50:34 -04:00
George Powell
db04da6a2c feat: add Sign In with Google
Adds Google OAuth alongside existing Apple and email/password auth. Follows the same patterns as Apple Sign-In: state cookie for CSRF, anonymousId migration, and user linking by email. Key differences: Google callback is a GET redirect (sameSite: lax) and uses a static client secret instead of a signed JWT.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 01:39:24 -04:00
George Powell
321fac9aa8 feat: add achievements system, hint overlay, and progress page polish
Achievements system:
- Add src/lib/server/milestones.ts with full achievement definitions and
  calculation logic (16 achievements: streaks, book set completions,
  community milestones like Overachiever/Procrastinator/Outlier, and fun
  ones like Prodigal Son, Extra Credit, Is This A Joke To You?)
- Wire calculateMilestones() into the progress page server load
- Replace the old ad-hoc milestone cards with a proper achievements grid
  (3/4 col, uniform min-height cards, larger text)
- Change "With God, All Things Are Possible" from "every game solved in 1"
  to "solve in 1 guess for each of the 66 books at least once"

Game page hint overlay:
- After a correct testament/section/first-letter match, display a subtle
  text hint below the verse prompt (e.g. "It is in the Old Testament.")
- Hints fade in 2.8s after a guess (after the row flip animation)
- Hints are only shown to new players (fewer than 3 tracked wins) to
  avoid being patronising to experienced players

Progress page:
- Hide Skill Growth chart with {#if false && showChart} pending rework
- Fix book tier colour scheme: explored=blue, mastered=purple, perfect=emerald
  (was amber/emerald — now consistent across grid, legend, and stat cards)
- Simplify GuessesTable row colour: remove proximity gradient, use flat red
  for wrong guesses
- Add "Come back tomorrow!" encouragement text in CountdownTimer for new
  players (fewer than 3 wins)
- Fix GamePrompt text colour to always be gray-100

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 00:37:15 -04:00
George Powell
4a5aef5a3d refactor: extract CollapsibleTable component and fix show more
Replaces 7 inline collapsible tables in the global stats page with a
reusable CollapsibleTable component. Adds mode tab toggle (Rolling 30d /
Calendar) into the component. Fixes show more/less which was broken due
to mode-based expanded tracking when no modes were provided.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 20:17:30 -04:00
George Powell
f98ab24d2e fix: update Discord message format to italic date + bold verse
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 01:05:38 -04:00
George Powell
c5b333bbb3 fix: use Bun.env instead of $env/dynamic/private to avoid build-time errors
$env/dynamic/private requires env vars to be present at build time.
Bun.env reads them at runtime, which is correct for runtime secrets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 00:59:16 -04:00
George Powell
e842923d81 guesses 2026-03-22 00:58:17 -04:00
George Powell
51bfb53a39 feat: add /api/send-daily-verse endpoint for daily Discord verse posting
Protected by CRON_SECRET bearer token. Fetches today's verse in
America/New_York timezone and POSTs it to DISCORD_DAILY_WEBHOOK.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 00:57:01 -04:00
George Powell
45d33b6bad feat: improve guesses collapse timing, win screen CTA, and progress page polish
- GuessesTable now accepts a `minimized` prop instead of deriving collapse from `isWon`, giving the parent control over timing
- Delay collapsing guesses grid until win animations complete (1800ms), skipped for already-completed puzzles
- Replace plain progress link on win screen with a styled green button matching other CTAs
- Progress page: remove redundant subtitle and nav button from header, add book status legend, add axis labels to guess history chart

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 00:47:02 -04:00
George Powell
3eb3a968dc feat: add progress page with activity calendar, book grid, and insights
Adds a new /progress route showing a personalized Bible knowledge dashboard
with stat cards, book mastery grid, 30-day activity calendar, skill growth
chart, streak milestones, and section insights. Links added from WinScreen
(logged-in users) and DevButtons.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 23:33:47 -04:00
George Powell
67d9757f98 added discord link and shrunk guessesgrid for more than three guesses 2026-03-19 10:53:57 -04:00
George Powell
b6b41b6ba9 added MaU section with projection 2026-03-19 00:39:54 -04:00
George Powell
bdc08bc58e Added survival curve metrics and table minimizing 2026-03-19 00:18:54 -04:00
George Powell
83cfcc66c0 feat: add WAU history table, fix retention metric, add new logos and favicon
- Add 12-week Weekly Active Users table to global stats with WoW change %
- Fix 7-day and 30-day retention to measure return on exactly day N (not any day within the window)
- Remove "Avg Guesses Today" stat card
- Update retention description to clarify exact-day measurement
- Add bibdle logos (SVG, square PNG, circle PNG) and new favicon.png
- Wire favicon.png as the site favicon via app.html link tag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 00:04:45 -04:00
George Powell
e878dea235 Fixed instructions, added color border based on closeness between guess
and target
2026-03-15 03:19:21 -04:00
George Powell
252edc3a6d fix: show most recent dates first in return rate and retention tables
- Reverse new player return rate table (most recent day at top)
- Reverse 7- and 30-day retention tables (most recent cohort at top)
- Rename "Day Rate" column to "Return Rate"
- Clarify "Last 14 Days" heading to "Last 14 Days — Completions"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 02:16:16 -04:00
George Powell
75b13280ef feat: add return rate and retention metrics to global stats
- Overall return rate: % of all-time players who played more than once
- New player return rate: 7-day rolling avg of daily first-timer return rates, with velocity vs prior 7 days
- 7-day and 30-day retention over time: per-cohort-day retention series

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 02:09:55 -04:00
George Powell
7007df2966 added global route for stat tracking 2026-03-14 22:17:33 -04:00
George Powell
61673a646d Added thank you message 2026-03-14 18:46:22 -04:00
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