From 359bc8461c38d374aa9551c1b94c6c6e59d2292b Mon Sep 17 00:00:00 2001 From: mariussd Date: Tue, 24 Oct 2023 13:05:39 +0200 Subject: [PATCH] fix routing --- app/routes/{three => three._index}/Experience.jsx | 0 .../{three/_index.tsx => three._index/route.tsx} | 0 app/routes/three.scroll/route.tsx | 4 +++- app/routes/three/styles/style.css | 10 ---------- 4 files changed, 3 insertions(+), 11 deletions(-) rename app/routes/{three => three._index}/Experience.jsx (100%) rename app/routes/{three/_index.tsx => three._index/route.tsx} (100%) delete mode 100644 app/routes/three/styles/style.css diff --git a/app/routes/three/Experience.jsx b/app/routes/three._index/Experience.jsx similarity index 100% rename from app/routes/three/Experience.jsx rename to app/routes/three._index/Experience.jsx diff --git a/app/routes/three/_index.tsx b/app/routes/three._index/route.tsx similarity index 100% rename from app/routes/three/_index.tsx rename to app/routes/three._index/route.tsx diff --git a/app/routes/three.scroll/route.tsx b/app/routes/three.scroll/route.tsx index f51824a..422d9a0 100644 --- a/app/routes/three.scroll/route.tsx +++ b/app/routes/three.scroll/route.tsx @@ -1,5 +1,5 @@ import { Canvas, type MeshProps, useFrame } from "@react-three/fiber"; -import { Float, ScrollControls, useScroll, Scroll } from "@react-three/drei"; +import { Float, ScrollControls, useScroll } from "@react-three/drei"; import { useRef } from "react"; import { type LinksFunction } from "@remix-run/node"; import styles from "~/routes/three.scroll/styles/styles.css"; @@ -37,6 +37,8 @@ const Cube = () => { useFrame((state, delta) => { const scrollDirection = oldOffset.current - scroll.offset > 0 ? 1 : -1; + if (!ref.current) return; + ref.current.rotation.y += scroll.delta * 1.3 * scrollDirection; ref.current.rotation.z -= scroll.delta * 0.2 * -scrollDirection; diff --git a/app/routes/three/styles/style.css b/app/routes/three/styles/style.css deleted file mode 100644 index a683d8d..0000000 --- a/app/routes/three/styles/style.css +++ /dev/null @@ -1,10 +0,0 @@ -.label > div { - position: absolute; - background: #00000088; - color: white; - padding: 15px; - white-space: nowrap; - overflow: hidden; - border-radius: 30px; - user-select: none; -}