This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { FC, useEffect } from 'react'; | |
type State = { | |
progress: number; | |
isLoading: boolean; | |
} | |
const useStore = create<State>((set, get) => ({ | |
isLoading: true, | |
progress: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react' | |
import gsap from 'gsap' | |
import { useFrame } from '@react-three/fiber' | |
// sync gsap raf to r3f raf | |
gsap.ticker.remove(gsap.updateRoot) | |
export const GsapTicker = () => { | |
const pg = React.useRef(0) | |
gsap.ticker.remove(gsap.updateRoot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useFrame, useThree } from '@react-three/fiber' | |
import { useEffect, useMemo } from 'react' | |
import * as THREE from 'three' | |
function getFullscreenTriangle() { | |
const geometry = new THREE.BufferGeometry() | |
const vertices = new Float32Array([-1, -1, 3, -1, -1, 3]) | |
const uvs = new Float32Array([0, 0, 2, 0, 0, 2]) | |
geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 2)) |
OlderNewer