744ec0becc
- Introduced GlassModels component with custom vertex and fragment shaders for realistic glass effects. - Updated HeroScene to include HelloModel and CursorStar components, utilizing the new glass shader. - Enhanced Header component with ScrambleReveal for dynamic text display and local clock functionality. - Implemented useIsMobile hook to adapt rendering based on screen size. - Adjusted StickerLayer to ensure falling stickers are captured in the glass models' FBO pass.
19 lines
479 B
TypeScript
19 lines
479 B
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
/** Matches the original's useIsMobileWidth: < 1024px. */
|
|
export function useIsMobile(): boolean {
|
|
const [mobile, setMobile] = useState(false);
|
|
|
|
useEffect(() => {
|
|
const mq = window.matchMedia("(max-width: 1023px)");
|
|
const update = () => setMobile(mq.matches);
|
|
update();
|
|
mq.addEventListener("change", update);
|
|
return () => mq.removeEventListener("change", update);
|
|
}, []);
|
|
|
|
return mobile;
|
|
}
|