// © XlXi 2021 // Graphictoria 5 import React, { useRef, Suspense } from 'react'; import { Canvas, useFrame } from '@react-three/fiber'; import { Instances, Instance, PerspectiveCamera, useGLTF } from '@react-three/drei'; import SetTitle from '../Helpers/Title.js'; const randomVector = (r) => [r / 2 - Math.random() * r, r / 2 - Math.random() * r, r / 2 - Math.random() * r]; const randomEuler = () => [Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI]; const randomData = Array.from({ length: 2000 }, (r = 200) => ({ random: Math.random(), position: randomVector(r), rotation: randomEuler() })); let Buttons = []; let ButtonsAlreadyTemplated = false; function MakeButtons() { if(!ButtonsAlreadyTemplated) { ButtonsAlreadyTemplated = true; let name = 'Graphictoria'; for (var i = 0; i < name.length; i++) { Buttons.push({id: i, value: name.charAt(i)}); } } } function DoButton(position) { console.log(position); } function Scene() { const { nodes, materials } = useGLTF('/models/graphictoriapart.glb'); return ( <> { randomData.map((props, i) => ( )) } ); } function Box({ random, ...props }){ const ref = useRef() useFrame((state) => { const t = state.clock.getElapsedTime() + random * 10000 ref.current.rotation.set(Math.cos(t / 4) / 2, Math.sin(t / 4) / 2, Math.cos(t / 1.5) / 2) ref.current.position.y = Math.sin(t / 1.5) / 2 }); return ( ) } function Camera({ ...props }){ const ref = useRef() useFrame((state) => { const t = state.clock.getElapsedTime() / 70 ref.current.rotation.set(t, 0, t) }); return ( ) } class Maintenance extends React.Component { componentDidMount() { SetTitle("Maintenance"); } render() { MakeButtons(); return ( <>

Graphictoria is currently under maintenance.

Our cyborg team of highly trained code-monkes are working to make Graphictoria better. We'll be back soon!

{ Buttons.map(character => ( )) }
); } } export { Maintenance };