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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user