Build 0pt ordering flow: configurator, deposit/escrow, production tracker, validation
Customer order lifecycle on the mono design system: red + provenance tokens, useReveal hook, lib/data pricing model, ProvenanceBadge/CellProvenance, OrderStepper, and 4 routes with live pricing, 50/50 escrow, simulated production, 4-view validation. tsc clean; next build green (5 routes). Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
/**
|
||||
* Wire a section so its descendants carrying `.reveal` (+ optional
|
||||
* `.reveal-left|-right|-scale|-fade` and `.delay-N`) animate in when the
|
||||
* section scrolls into view. Matches the keyframes in globals.css.
|
||||
*/
|
||||
export function useReveal<T extends HTMLElement = HTMLElement>() {
|
||||
const ref = useRef<T>(null);
|
||||
useEffect(() => {
|
||||
const el = ref.current;
|
||||
if (!el) return;
|
||||
const io = new IntersectionObserver(
|
||||
(entries) =>
|
||||
entries.forEach((e) => {
|
||||
if (e.isIntersecting) {
|
||||
el
|
||||
.querySelectorAll(
|
||||
".reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-fade",
|
||||
)
|
||||
.forEach((n) => n.classList.add("in-view"));
|
||||
io.unobserve(el);
|
||||
}
|
||||
}),
|
||||
{ threshold: 0.15, rootMargin: "0px 0px -10% 0px" },
|
||||
);
|
||||
io.observe(el);
|
||||
return () => io.disconnect();
|
||||
}, []);
|
||||
return ref;
|
||||
}
|
||||
Reference in New Issue
Block a user