Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added LOGISDATA/public/warehouse-interior.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions LOGISDATA/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,14 @@ button:focus-visible {
* entering section no longer invalidates the other four full-viewport
* subtrees stacked in the native scroll host.
*
* Scroll snapping is intentionally omitted: the briefing follows the
* browser's continuous native scroll position, while nav and keyboard
* jumps choose exact section offsets explicitly.
* Each section is a native snap point. Wheel, trackpad and touch gestures
* advance through the five chapter positions; the browser settles on the
* nearest chapter when input stops. Reduced-motion users get proximity
* snapping rather than a forced long-distance settle.
*/
contain: layout paint style;
scroll-snap-align: start;
scroll-snap-stop: always;
}

.section-inner {
Expand Down
7 changes: 4 additions & 3 deletions LOGISDATA/src/components/Presentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { presentationCopy } from "@/lib/data";
import { downloadExecutiveReportJson } from "@/lib/export";
import { t, text } from "@/lib/i18n";
import { shouldIgnorePresentationShortcut } from "@/lib/keyboard";
import { DURATION, transition } from "@/lib/motion";
import { DURATION, scrollBehaviorForMotion, transition } from "@/lib/motion";
import { sound } from "@/lib/sound";
import {
SECTIONS,
Expand Down Expand Up @@ -269,8 +269,8 @@ export function Presentation() {
};
scrollMetricsRef.current = metrics;
const targetTop = scrollTopForSection(index, metrics.scrollHeight, metrics.clientHeight);
element.scrollTo({ top: targetTop, behavior: "smooth" });
}, []);
element.scrollTo({ top: targetTop, behavior: scrollBehaviorForMotion(reduced) });
}, [reduced]);

useEffect(() => {
toggleLanguageRef.current = toggleLanguage;
Expand Down Expand Up @@ -568,6 +568,7 @@ export function Presentation() {
style={{
scrollbarWidth: "none",
overscrollBehaviorY: "contain",
scrollSnapType: reduced ? "y proximity" : "y mandatory",
}}
>
<ScrollBridge onReady={onScrollReady} />
Expand Down
39 changes: 37 additions & 2 deletions LOGISDATA/src/components/three/IndustrialScene.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import { useFrame, useThree } from "@react-three/fiber";
import { useFrame, useLoader, useThree } from "@react-three/fiber";
import { useScroll } from "@react-three/drei";
import { memo, useEffect, useMemo, useRef } from "react";
import { memo, Suspense, useEffect, useMemo, useRef } from "react";
import * as THREE from "three";
import { SECTION_COUNT, pagePositionFromOffset } from "@/lib/sections";
import type { DeviceProfile } from "@/lib/device";
Expand Down Expand Up @@ -53,6 +53,36 @@ const DEPTH_STEP = 2.2;
const clamp01 = (value: number) => THREE.MathUtils.clamp(value, 0, 1);
const smoothStep = (value: number) => value * value * (3 - 2 * value);

/** Photo-real warehouse plate behind the scroll-synchronized 3D audit models. */
function WarehouseBackdrop() {
const texture = useLoader(THREE.TextureLoader, "/warehouse-interior.jpg");

// Configure the cached GPU texture once; this is an owned renderer resource,
// not React state. The loader cache must retain the same texture reference.
/* eslint-disable react-hooks/immutability */
useEffect(() => {
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = 4;
texture.needsUpdate = true;
}, [texture]);
/* eslint-enable react-hooks/immutability */

return (
<mesh position={[0, 0, -30]} frustumCulled={false} renderOrder={-10}>
<planeGeometry args={[56, 32]} />
<meshBasicMaterial
map={texture}
color="#a9bac2"
transparent
opacity={0.46}
depthWrite={false}
fog={false}
toneMapped={false}
/>
</mesh>
);
}

function SceneRig({ language, theme, device }: IndustrialSceneProps) {
const scroll = useScroll();
const invalidate = useThree((state) => state.invalidate);
Expand Down Expand Up @@ -153,6 +183,11 @@ function SceneRig({ language, theme, device }: IndustrialSceneProps) {
<fogExp2 attach="fog" args={[theme === "dark" ? "#06121d" : "#f8fafc", 0.022]} />
<ambientLight intensity={theme === "dark" ? 0.72 : 1.15} />
<directionalLight position={[4, 7, 5]} intensity={theme === "dark" ? 1.35 : 1.05} />
{device.tier !== "low" && (
<Suspense fallback={null}>
<WarehouseBackdrop />
</Suspense>
)}
{device.effects && <DataStreamField device={device} theme={theme} />}
<group ref={heroRef}><SupplyNetwork language={language} theme={theme} animate={device.effects} /></group>
<group ref={auditRef}><AuditScanner language={language} theme={theme} animate={device.effects} /></group>
Expand Down
Loading
Loading