feat: 添加 FooterSection 组件,更新页面结构以包含联系信息;优化 ScrambleReveal 组件以支持反向字符揭示
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useMemo, useRef } from "react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useFrame, useLoader, useThree } from "@react-three/fiber";
|
||||
import * as THREE from "three";
|
||||
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
|
||||
@@ -677,3 +677,41 @@ export function CursorStar({ isMobile = false }: { isMobile?: boolean }) {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* #contact footer model (original cp call: model/cnt.gltf, scale 19,
|
||||
* beforeRotation [-180,0,0], scrollSyncFactor 1 — the cp default — and
|
||||
* light-theme tingColor m[0]/m[1] = #FFFFFF/#009dff). Anchored to the
|
||||
* footer section's document geometry, measured live so it tracks layout.
|
||||
*/
|
||||
export function FooterModel() {
|
||||
const [geom, setGeom] = useState({ top: 0, height: 0 });
|
||||
useEffect(() => {
|
||||
const measure = () => {
|
||||
const el = document.getElementById("contact");
|
||||
if (el) setGeom({ top: el.offsetTop, height: el.offsetHeight });
|
||||
};
|
||||
measure();
|
||||
window.addEventListener("resize", measure);
|
||||
document.fonts?.ready?.then(measure).catch(() => {});
|
||||
const t = window.setTimeout(measure, 500);
|
||||
return () => {
|
||||
window.removeEventListener("resize", measure);
|
||||
window.clearTimeout(t);
|
||||
};
|
||||
}, []);
|
||||
return (
|
||||
<GlassModel
|
||||
url="/model/cnt.gltf"
|
||||
position={[0, 0, 0]}
|
||||
beforeRotation={[-180, 0, 0]}
|
||||
rotation={[0, 0, 0]}
|
||||
scale={19}
|
||||
tintColors={["#FFFFFF", "#009dff"]}
|
||||
tintEnabled
|
||||
sectionTopDocY={geom.top}
|
||||
sectionHeightPx={geom.height}
|
||||
scrollSyncFactor={1}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Canvas, useThree } from "@react-three/fiber";
|
||||
import { PerspectiveCamera } from "@react-three/drei";
|
||||
|
||||
import { StickerDrop, StickerCamera } from "@/components/canvas/StickerDrop";
|
||||
import { HelloModel, CursorStar } from "@/components/canvas/GlassModels";
|
||||
import { HelloModel, CursorStar, FooterModel } from "@/components/canvas/GlassModels";
|
||||
import ImageLayers from "@/components/canvas/ImageLayers";
|
||||
import BackgroundFX from "@/components/canvas/BackgroundFX";
|
||||
import DotOverlay from "@/components/canvas/DotOverlay";
|
||||
@@ -148,6 +148,9 @@ export function HeroScene() {
|
||||
{/* Glass hero models (hello + blue cursor star), refractive tint shader */}
|
||||
<HelloModel isMobile={isMobile} />
|
||||
<CursorStar isMobile={isMobile} />
|
||||
{/* #contact footer model (original: cnt.gltf scale 19, x-180° flip,
|
||||
section-anchored, scrollSyncFactor 1) */}
|
||||
<FooterModel />
|
||||
|
||||
{/* Post FX (original cG): lens-flare star streaks + pointer-driven
|
||||
fluid refraction + lime dot-trail indicator. */}
|
||||
|
||||
Reference in New Issue
Block a user