|
1 | 1 | <script setup lang="ts"> |
2 | | -import { Vector3 } from 'three' |
3 | | -import { TresCanvas } from '@tresjs/core' |
4 | | -import { OrbitControls } from '@tresjs/cientos' |
| 2 | +import { |
| 3 | + advancedRoutes, |
| 4 | + basicRoutes, |
| 5 | +} from '../router/routes' |
5 | 6 |
|
6 | | -import { TresLeches, useControls } from '@tresjs/leches' |
7 | | -
|
8 | | -/* import '@tresjs/leches/style.css' */ |
9 | | -import { reactive, ref } from 'vue' |
10 | | -
|
11 | | -const gl = reactive({ |
12 | | - clearColor: '#82DBC5', |
13 | | -}) |
14 | | -
|
15 | | -const cameraRef = ref() |
16 | | -const boxRef = ref() |
17 | | -useControls('fpsgraph') |
18 | | -
|
19 | | -const { wireframe, camPos, position, rotation } = useControls({ |
20 | | - wireframe: false, |
21 | | - camPos: new Vector3(4, 4, 4), |
22 | | - position: new Vector3(0, 1, 2), |
23 | | - rotation: { |
24 | | - value: new Vector3(5, 5, 5), |
25 | | - }, |
26 | | - select: { |
27 | | - value: 'option1', |
28 | | - options: ['option1', 'option2', 'option3'], |
29 | | - icon: 'i-carbon-checkmark', |
30 | | - }, |
31 | | - range: { |
32 | | - value: 1, |
33 | | - min: 0, |
34 | | - max: 10, |
35 | | - step: 0.1, |
36 | | - }, |
37 | | -}) |
| 7 | +const sections = [ |
| 8 | + { icon: '📦', title: 'Basic', routes: basicRoutes }, |
| 9 | + { icon: '🤓', title: 'Advanced', routes: advancedRoutes }, |
| 10 | +] |
38 | 11 | </script> |
39 | 12 |
|
40 | 13 | <template> |
41 | | - <TresLeches /> |
42 | | - <TresCanvas v-bind="gl"> |
43 | | - <TresPerspectiveCamera |
44 | | - ref="cameraRef" |
45 | | - :position="[camPos.value.x, camPos.value.y, camPos.value.z]" |
46 | | - :look-at="[1, 2, 0]" |
47 | | - /> |
48 | | - <TresMesh |
49 | | - ref="boxRef" |
50 | | - :position="[position.value.x, position.value.y, position.value.z]" |
51 | | - :rotation="[rotation.value.x, rotation.value.y, rotation.value.z]" |
52 | | - :scale="[2, 2, 2]" |
53 | | - > |
54 | | - <TresBoxGeometry /> |
55 | | - <TresMeshNormalMaterial |
56 | | - color="teal" |
57 | | - :wireframe="wireframe.value" |
58 | | - /> |
59 | | - </TresMesh> |
60 | | - <TresGridHelper /> |
61 | | - <TresAmbientLight :intensity="1" /> |
62 | | - <TresDirectionalLight |
63 | | - :position="[3, 3, 3]" |
64 | | - :intensity="1" |
65 | | - /> |
66 | | - <OrbitControls /> |
67 | | - </TresCanvas> |
| 14 | + <div |
| 15 | + class="container mx-auto max-w-3xl font-sans text-xs color-gray bg-white" |
| 16 | + > |
| 17 | + <div class="mx-4"> |
| 18 | + <div |
| 19 | + class="mt-24 mb-12 text-center align-baseline items-center gap-6 sm:mt-16 sm:mb-6 sm:text-left sm:flex sm:flex-row-reverse sm:justify-left" |
| 20 | + > |
| 21 | + <div> |
| 22 | + 🍰 |
| 23 | + </div> |
| 24 | + <div class="sm:w-2/3"> |
| 25 | + <h1 |
| 26 | + class="w-auto max-w-75 mx-auto text-5xl text-zinc-700 mb-3 sm:mx-none sm:w-1/2 sm:max-w-72" |
| 27 | + > |
| 28 | + <span class="text-tres-primary">TresJS Leches</span> Playground |
| 29 | + </h1> |
| 30 | + <p class="text-lg">Testing zone for TresJS/leches</p> |
| 31 | + </div> |
| 32 | + </div> |
| 33 | + <div |
| 34 | + class="text-center sm:text-left sm:grid sm:grid-cols-2 md:grid-cols-3 gap-4" |
| 35 | + > |
| 36 | + <div |
| 37 | + v-for="{ title, routes, icon } in sections" |
| 38 | + :key="title" |
| 39 | + class="p-4 my-4 leading-normal size-m weight-600 bg-zinc-50 rounded sm:my-0" |
| 40 | + > |
| 41 | + <div |
| 42 | + class="inline-block p-2 p-x-3 m-b-3 text-2xl bg-zinc-200 rounded" |
| 43 | + > |
| 44 | + {{ icon }} |
| 45 | + </div> |
| 46 | + <h2 class="text-sm p-0 m-0 mb-1.5 font-semibold text-zinc-600"> |
| 47 | + {{ title }} |
| 48 | + </h2> |
| 49 | + <div v-if="routes.length"> |
| 50 | + <div v-for="route in routes" :key="route.name" class="link-wrapper"> |
| 51 | + <router-link |
| 52 | + class="no-underline text-zinc-700 visited:text-zinc-400 hover:text-cientos-blue" |
| 53 | + :to="route.path" |
| 54 | + > |
| 55 | + <span>{{ route.name }} </span> |
| 56 | + </router-link> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + <div v-else> |
| 60 | + (empty) |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + </div> |
68 | 66 | </template> |
0 commit comments