Skip to content

Commit

Permalink
Project starter
Browse files Browse the repository at this point in the history
  • Loading branch information
wass08 committed Feb 28, 2023
0 parents commit 540346d
Show file tree
Hide file tree
Showing 11 changed files with 1,246 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "r3f-loading-animations",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@react-three/drei": "^9.56.28",
"@react-three/fiber": "^8.11.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"three": "^0.150.1"
},
"devDependencies": {
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^3.1.0",
"vite": "^4.1.0"
}
}
1 change: 1 addition & 0 deletions public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Canvas } from "@react-three/fiber";
import { Experience } from "./components/Experience";

function App() {
return (
<Canvas shadows camera={{ position: [3, 3, 3], fov: 30 }}>
<color attach="background" args={["#ececec"]} />
<Experience />
</Canvas>
);
}

export default App;
1 change: 1 addition & 0 deletions src/assets/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/components/Experience.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { OrbitControls } from "@react-three/drei";

export const Experience = () => {
return (
<>
<OrbitControls />
<mesh>
<meshNormalMaterial />
<boxBufferGeometry />
</mesh>
</>
);
};
8 changes: 8 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#root {
width: 100vw;
height: 100vh;
}

body {
margin: 0;
}
10 changes: 10 additions & 0 deletions src/main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './index.css'

ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
7 changes: 7 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
Loading

0 comments on commit 540346d

Please sign in to comment.