import "./canvas.sass"; import {motion} from "framer-motion"; import {Canvas as ThreeCanvas, useFrame} from "@react-three/fiber"; import {Moon} from "./Moon"; import {AnimateSpin} from "../animations"; import {BakeShadows, Environment, OrbitControls, Preload, useTexture} from "@react-three/drei"; import Jupiter from "../img/2k_jupiter.webp"; import Makemake from "../img/2k_makemake_fictional.webp"; import Ceres from "../img/2k_ceres_fictional.webp"; import Haumea from "../img/2k_haumea_fictional.webp"; import MilkyWay from "../img/2k_stars_milky_way.jpg"; import SaturnRings from "../img/12k_jupiter_rings.webp"; import {useRef} from "react"; import type {Mesh} from "three"; import * as THREE from "three"; export default function Canvas() { // fade animation sync with loading return (
Welcome to my blog

Drag to orbit

) } function Moons() { const makemake = useTexture(Makemake); const haumea = useTexture(Haumea); const ceres = useTexture(Ceres); return <> } function Rings() { const map = useTexture(SaturnRings); // To avoid seeing the backside as invisible, use DoubleSide. // We should also use a RingGeometry rather than a CircleGeometry so it is empty in the center. return } function Planet() { const colorMap = useTexture(Jupiter); const planetRef = useRef(null); // add planet spin useFrame(() => { if(!planetRef.current) return; planetRef.current.rotation.y += 0.005; }); return }