Add Christmas theme and snow effects for December
Introduces a Christmas theme that activates in December, including themed colors, subtle background patterns, and snowflake effects on loading screens. Adds a reusable SnowLoader component and utility for December detection. Updates layout and loading components to conditionally apply decorations and styles only during December.
This commit is contained in:
@@ -1,21 +1,31 @@
|
||||
"use client"
|
||||
|
||||
import { useEffect, useState } from "react"
|
||||
import { isDecember } from "@/lib/utils/christmas"
|
||||
|
||||
export function ChristmasDecorations() {
|
||||
const [snowflakes, setSnowflakes] = useState<Array<{ id: number; left: number; delay: number; duration: number }>>([])
|
||||
const [isDec, setIsDec] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
// Generate snowflakes
|
||||
const flakes = Array.from({ length: 30 }, (_, i) => ({
|
||||
id: i,
|
||||
left: Math.random() * 100,
|
||||
delay: Math.random() * 5,
|
||||
duration: 8 + Math.random() * 4,
|
||||
}))
|
||||
setSnowflakes(flakes)
|
||||
setIsDec(isDecember())
|
||||
|
||||
if (isDecember()) {
|
||||
// Generate snowflakes
|
||||
const flakes = Array.from({ length: 30 }, (_, i) => ({
|
||||
id: i,
|
||||
left: Math.random() * 100,
|
||||
delay: Math.random() * 5,
|
||||
duration: 8 + Math.random() * 4,
|
||||
}))
|
||||
setSnowflakes(flakes)
|
||||
}
|
||||
}, [])
|
||||
|
||||
if (!isDec) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 pointer-events-none z-50 overflow-hidden">
|
||||
{/* Snowflakes */}
|
||||
|
||||
Reference in New Issue
Block a user