6b1f329231
- HyperspaceModel.tsx:1:1 移植原站 cx——cursor.glb 合并几何、屏幕矩形追踪(12 帧缓存+滚动增量修正)、restScale 0.1→峰值 hypot(vw,vh)×1.64/radius 的吞噬缩放(damp 32/s)、shrink 折叠、条纹 shader(uStripeReveal 蓝底→黑底星空放射)、scaleSpinDegrees 180 收拢自旋、指针跟随高光 - HyperSpaceSection.tsx:8 视口高 + sticky,段位推进 seg0-primary/secondary(Innovate with purpose / human touch)→ seg1(进度环 + 四段主张)→ end(FUTURE-FIRST/ALWAYS);逐字符哈希延迟 stagger(hsstFadeIn/Out) - arrowFullscreen.ts:原站 module 1111 进度 store(setDampedScaleT 阈值翻转订阅,header 0.5 阈值白模式、section 0.5 白模式同步) - Header:箭头过阈值后整体转白(ARROW_FULLSCREEN_DOM_COLOR_TRANSITION) - 修复:main 不再是滚动容器(原站 sticky 依赖内部滚动,我们的 Lenis 是窗口级,sticky 永不钉住导致末段文案不出现) - scrollBus 增加 subscribeScroll/notifyScroll 供 DOM 侧响应式读取;useLightController 从 GlassModels 导出复用 - 验证:glError=0 无反馈环;段位推进/白模式触发与回落/区块顺序 全部 CDP 行为探针通过;build+tsc 通过
17 lines
503 B
TypeScript
17 lines
503 B
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
/** Window size (original useWindowSize, module 30468). */
|
|
export function useWindowSize() {
|
|
const [size, setSize] = useState({ width: 0, height: 0 });
|
|
useEffect(() => {
|
|
const update = () =>
|
|
setSize({ width: window.innerWidth, height: window.innerHeight });
|
|
update();
|
|
window.addEventListener("resize", update, { passive: true });
|
|
return () => window.removeEventListener("resize", update);
|
|
}, []);
|
|
return size;
|
|
}
|