Skip to content

Extract blur animation constants to shared module - #15

Open
injoon5 wants to merge 2 commits into
mainfrom
claude/add-calendar-blur-effect-jGWs5
Open

Extract blur animation constants to shared module#15
injoon5 wants to merge 2 commits into
mainfrom
claude/add-calendar-blur-effect-jGWs5

Conversation

@injoon5

@injoon5 injoon5 commented Apr 24, 2026

Copy link
Copy Markdown
Owner

Summary

Refactored blur animation timing values into a centralized configuration module to improve maintainability and consistency across the application.

Key Changes

  • Created new apps/web/src/lib/animation.ts module with exported animation constants:
    • BLUR_TRANSITION_MS = 100 - CSS transition duration for blur effects
    • BLUR_TIMER_MS = 150 - Timeout duration for blur state management
  • Updated three page components to import and use these constants:
    • apps/web/src/routes/calendar/+page.svelte - Added blur effect logic and replaced hardcoded transition values
    • apps/web/src/routes/meals/+page.svelte - Replaced hardcoded 200ms timer and 150ms transition with constants
    • apps/web/src/routes/timetable/+page.svelte - Replaced hardcoded 200ms timer and 150ms transition with constants

Implementation Details

  • The calendar page now implements a blur effect that triggers when the displayed year/month changes, with proper cleanup via effect cleanup function
  • All three pages now use consistent animation timing values, eliminating magic numbers from inline styles
  • The blur effect provides visual feedback during data transitions with a 4px blur and 0.7 opacity

https://claude.ai/code/session_012Rizz6AWf3faNH58eNpKvz

… timing

Adds the same blur(4px)/opacity transition to calendar month changes that
meals and timetable already use on their selector changes. Extracts
BLUR_TRANSITION_MS (100ms) and BLUR_TIMER_MS (150ms) into a shared
$lib/animation.ts so all three pages stay in sync; durations are slightly
shorter than the previous hardcoded 150ms/200ms.

https://claude.ai/code/session_012Rizz6AWf3faNH58eNpKvz
@vercel

vercel Bot commented Apr 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
class-info Ready Ready Preview, Comment Apr 24, 2026 2:25pm

The blur now clears as soon as Convex delivers new data (via a $effect
tracking both query .data references), rather than always waiting for a
fixed timer. The fallback timer is kept for same-year month hops where
no new fetch occurs and data references don't change.

https://claude.ai/code/session_012Rizz6AWf3faNH58eNpKvz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants