Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kekkorider committed Jul 19, 2024
1 parent 163df42 commit 5f2417a
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 100 deletions.
144 changes: 72 additions & 72 deletions playground/src/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
<script setup lang="ts">
import {
advancedRoutes,
basicRoutes,
cameraRoutes,
eventsRoutes,
issuesRoutes,
loaderRoutes,
miscRoutes,
modelsRoutes,
webgpuRoutes,
advancedRoutes,
basicRoutes,
cameraRoutes,
eventsRoutes,
issuesRoutes,
loaderRoutes,
miscRoutes,
modelsRoutes,
webgpuRoutes,
} from '../router/routes'
const sections = [
{ icon: '📦', title: 'Basic', routes: basicRoutes },
{ icon: '🤓', title: 'Advanced', routes: advancedRoutes },
{ icon: '📣', title: 'Events', routes: eventsRoutes },
{ icon: '📷', title: 'Camera', routes: cameraRoutes },
{ icon: '🛜', title: 'Loaders', routes: loaderRoutes },
{ icon: '🐇', title: 'Models', routes: modelsRoutes },
{ icon: '🤪', title: 'Misc', routes: miscRoutes },
{ icon: '🔬', title: 'Issues', routes: issuesRoutes },
{ icon: '🔮', title: 'WebGPU', routes: webgpuRoutes },
{ icon: '📦', title: 'Basic', routes: basicRoutes },
{ icon: '🤓', title: 'Advanced', routes: advancedRoutes },
{ icon: '📣', title: 'Events', routes: eventsRoutes },
{ icon: '📷', title: 'Camera', routes: cameraRoutes },
{ icon: '🛜', title: 'Loaders', routes: loaderRoutes },
{ icon: '🐇', title: 'Models', routes: modelsRoutes },
{ icon: '🤪', title: 'Misc', routes: miscRoutes },
{ icon: '🔬', title: 'Issues', routes: issuesRoutes },
{ icon: '🔮', title: 'WebGPU', routes: webgpuRoutes },
]
</script>

<template>
<div
class="container mx-auto max-w-3xl font-sans text-xs color-gray bg-white"
>
<div class="mx-4">
<div
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"
>
<div>
<img
src="/logo.svg"
alt="TresJS logo"
class="max-w-24 sm:max-w-48 align-baseline"
/>
</div>
<div class="sm:w-2/3">
<h1
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"
>
<span class="text-tres-primary">TresJS</span> Playground
</h1>
<p class="text-lg">Testing zone for TresJS/core components</p>
</div>
</div>
<div
class="text-center sm:text-left sm:grid sm:grid-cols-2 md:grid-cols-3 gap-4"
>
<div
v-for="{ title, routes, icon } in sections"
:key="title"
class="p-4 my-4 leading-normal size-m weight-600 bg-zinc-50 rounded sm:my-0"
>
<div
class="inline-block p-2 p-x-3 m-b-3 text-2xl bg-zinc-200 rounded"
>
{{ icon }}
</div>
<h2 class="text-sm p-0 m-0 mb-1.5 font-semibold text-zinc-600">
{{ title }}
</h2>
<div v-if="routes.length">
<div v-for="route in routes" :key="route.name" class="link-wrapper">
<router-link
class="no-underline text-zinc-700 visited:text-zinc-400 hover:text-cientos-blue"
:to="route.path"
>
<span>{{ route.name }} </span>
</router-link>
</div>
</div>
<div v-else>(empty)</div>
</div>
</div>
</div>
</div>
<div
class="container mx-auto max-w-3xl font-sans text-xs color-gray bg-white"
>
<div class="mx-4">
<div
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"
>
<div>
<img
src="/logo.svg"
alt="TresJS logo"
class="max-w-24 sm:max-w-48 align-baseline"
/>
</div>
<div class="sm:w-2/3">
<h1
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"
>
<span class="text-tres-primary">TresJS</span> Playground
</h1>
<p class="text-lg">Testing zone for TresJS/core components</p>
</div>
</div>
<div
class="text-center sm:text-left sm:grid sm:grid-cols-2 md:grid-cols-3 gap-4"
>
<div
v-for="{ title, routes, icon } in sections"
:key="title"
class="p-4 my-4 leading-normal size-m weight-600 bg-zinc-50 rounded sm:my-0"
>
<div
class="inline-block p-2 p-x-3 m-b-3 text-2xl bg-zinc-200 rounded"
>
{{ icon }}
</div>
<h2 class="text-sm p-0 m-0 mb-1.5 font-semibold text-zinc-600">
{{ title }}
</h2>
<div v-if="routes.length">
<div v-for="route in routes" :key="route.name" class="link-wrapper">
<router-link
class="no-underline text-zinc-700 visited:text-zinc-400 hover:text-cientos-blue"
:to="route.path"
>
<span>{{ route.name }} </span>
</router-link>
</div>
</div>
<div v-else>(empty)</div>
</div>
</div>
</div>
</div>
</template>
import { webgpuRoutes } from '../router/routes/webgpu';
43 changes: 21 additions & 22 deletions playground/src/pages/webgpu/WebGPURenderer.vue
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
<script setup lang="ts">
import {
BasicShadowMap,
MeshToonMaterial,
NoToneMapping,
SRGBColorSpace,
BasicShadowMap,
NoToneMapping,
SRGBColorSpace,
} from 'three'
import { TresCanvas, useRenderLoop } from '@tresjs/core'
import { OrbitControls } from '@tresjs/cientos'
import { onMounted, nextTick } from 'vue'
import { nextTick, onMounted } from 'vue'
const state = reactive({
clearColor: '#201919',
shadows: false,
alpha: false,
clearColor: '#201919',
shadows: false,
alpha: false,
shadowMapType: BasicShadowMap,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
shadowMapType: BasicShadowMap,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
})
const { onLoop } = useRenderLoop()
onMounted(async () => {
await nextTick()
await nextTick()
onLoop(({ elapsed }) => {})
onLoop(({ elapsed }) => {})
})
</script>

<template>
<TresCanvas v-bind="state">
<TresPerspectiveCamera :position="[0, 1, -3]" :look-at="[0, 0, 0]" />
<TresCanvas v-bind="state">
<TresPerspectiveCamera :position="[0, 1, -3]" :look-at="[0, 0, 0]" />

<OrbitControls />
<OrbitControls />

<TresAmbientLight :intensity="0.5" />
<TresAmbientLight :intensity="0.5" />

<TresMesh>
<TresBoxGeometry />
<TresMeshStandardMaterial color="red" />
</TresMesh>
</TresCanvas>
<TresMesh>
<TresBoxGeometry />
<TresMeshStandardMaterial color="red" />
</TresMesh>
</TresCanvas>
</template>
4 changes: 2 additions & 2 deletions playground/src/router/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const allRoutes = [
...miscRoutes,
...issuesRoutes,
...loaderRoutes,
...webgpuRoutes
...webgpuRoutes,
]

export {
Expand All @@ -30,5 +30,5 @@ export {
issuesRoutes,
allRoutes,
loaderRoutes,
webgpuRoutes
webgpuRoutes,
}
6 changes: 3 additions & 3 deletions src/core/nodeOps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1626,9 +1626,9 @@ function createSimpleMeshPrimitiveTree(nodeOps) {
const nodes = []
const objects = []
const spiesByKey: Partial<Record<
keyof typeof nodesByKey,
{ material: () => void, geometry: () => void }
>> = { }
keyof typeof nodesByKey,
{ material: () => void, geometry: () => void }
>> = { }
const spies = []
const undisposed = new Set()
for (const [key, node] of Object.entries(nodesByKey)) {
Expand Down
1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ export function invalidateInstance(instance: TresObject) {
}

export function noop(fn: string): any {
// eslint-disable-next-line no-unused-expressions
fn
}

Expand Down

0 comments on commit 5f2417a

Please sign in to comment.