main #4

Merged
lan merged 8 commits from uNagi/carrotskin:main into main 2026-01-11 18:54:01 +08:00
Showing only changes of commit e41a66f176 - Show all commits

View File

@@ -23,11 +23,9 @@ export default function Home() {
const [isHovered, setIsHovered] = useState(false);
useEffect(() => {
// 添加防抖处理,减少状态更新频率
let timeoutId: number | undefined;
const handleMouseMove = (e: MouseEvent) => {
// 使用防抖每16ms更新一次约60fps
clearTimeout(timeoutId);
timeoutId = window.setTimeout(() => {
setMousePosition({ x: e.clientX, y: e.clientY });
@@ -87,7 +85,6 @@ export default function Home() {
<div
className="absolute w-32 h-32 bg-gradient-to-r from-orange-400/30 to-amber-400/30 rounded-full blur-2xl transition-all duration-150 ease-out will-change-transform"
style={{
// 使用transform而非top/left利用GPU加速
transform: `translate(${mousePosition.x - 64}px, ${mousePosition.y - 64}px) scale(${isHovered ? 1.5 : 1})`
}}
/>