Skip to content

Commit

Permalink
fix routing
Browse files Browse the repository at this point in the history
  • Loading branch information
mariussd committed Oct 24, 2023
1 parent b06417d commit 359bc84
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion app/routes/three.scroll/route.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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;

Expand Down
10 changes: 0 additions & 10 deletions app/routes/three/styles/style.css

This file was deleted.

0 comments on commit 359bc84

Please sign in to comment.