diff --git a/.eslintignore b/.eslintignore
index f910d66c..d88e5152 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -3,4 +3,6 @@ dist
**.test.ts
**.test.js
**.cy.js
-**/cypress/**
\ No newline at end of file
+**/cypress/**
+docs/.vitepress/cache
+docs/.vitepress/dist
\ No newline at end of file
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
deleted file mode 100644
index ade84fef..00000000
--- a/.eslintrc.cjs
+++ /dev/null
@@ -1,39 +0,0 @@
-module.exports = {
- root: true,
- env: {
- node: true,
- browser: true,
- es6: true,
- },
- parser: 'vue-eslint-parser',
- plugins: ['vue', '@typescript-eslint'],
- extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:vue/vue3-recommended', 'prettier'],
- parserOptions: {
- tsconfigRootDir: __dirname,
- parser: '@typescript-eslint/parser',
- ecmaVersion: 2020,
- sourceType: 'module',
- allowImportExportEverywhere: true,
- },
- ignorePatterns: ['**/*.test.ts', 'packages/**/dist', 'package.json'],
- rules: {
- 'no-console': 'warn',
- 'arrow-parens': ['error', 'as-needed'],
- 'comma-dangle': 'off',
- 'space-before-function-paren': 'off',
- 'max-len': [1, { code: 120 }],
- 'require-jsdoc': 0,
- 'no-invalid-this': 0,
- 'import/no-absolute-path': 'off',
- '@typescript-eslint/no-explicit-any': 'off',
- 'vue/no-deprecated-slot-attribute': 'off',
- 'vue/require-default-prop': 'off',
- 'vue/html-self-closing': 'off',
- 'vue/max-attributes-per-line': 'off',
- 'vue/multi-word-component-names': 0,
- 'vue/no-multiple-template-root': 'off',
- 'vue/first-attribute-linebreak': 'off',
- 'vue/setup-compiler-macros': 0,
- 'vue/no-dupe-keys': 'off', // TODO: remove this when https://github.com/vuejs/eslint-plugin-vue/issues/2121 is fixed
- },
-}
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 00000000..f592a0d8
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,6 @@
+{
+ "extends": "@tresjs/eslint-config-vue",
+ "rules": {
+ "@typescript-eslint/no-use-before-define": "off"
+ }
+}
diff --git a/.prettierrc.cjs b/.prettierrc.cjs
deleted file mode 100644
index c7e30143..00000000
--- a/.prettierrc.cjs
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = {
- ...require('@alvarosabu/prettier-config'),
- printWidth: 120,
-}
diff --git a/docs/.eslintrc.json b/docs/.eslintrc.json
new file mode 100644
index 00000000..abc08e54
--- /dev/null
+++ b/docs/.eslintrc.json
@@ -0,0 +1,3 @@
+{
+ "extends": "@tresjs/eslint-config-vue"
+}
diff --git a/docs/.vitepress/theme/components/BackdropDemo.vue b/docs/.vitepress/theme/components/BackdropDemo.vue
index cde940ad..d0dcd689 100644
--- a/docs/.vitepress/theme/components/BackdropDemo.vue
+++ b/docs/.vitepress/theme/components/BackdropDemo.vue
@@ -3,9 +3,7 @@ import { TresCanvas } from '@tresjs/core'
import { PCFSoftShadowMap, SRGBColorSpace, NoToneMapping } from 'three'
import { useProgress, Backdrop, GLTFModel } from '@tresjs/cientos'
-import { ref } from 'vue'
-import { watch } from 'vue'
-import { watchEffect } from 'vue'
+import { ref, watch, watchEffect } from 'vue'
const gl = {
clearColor: 'pink',
@@ -18,7 +16,7 @@ const gl = {
const model = ref(null)
watch(model, ({ value }) => {
- value.traverse(child => {
+ value.traverse((child) => {
if (child.isMesh) {
child.castShadow = true
}
@@ -26,6 +24,7 @@ watch(model, ({ value }) => {
})
function onCameraChange(e) {
+ // eslint-disable-next-line no-console
console.log('camera changed', e)
}
@@ -51,21 +50,37 @@ const { hasFinishLoading, progress, items } = await useProgress()
v-show="!hasFinishLoading"
class="absolute bg-grey-600 t-0 l-0 w-full h-full z-20 flex justify-center items-center text-black font-mono"
>
-
Loading... {{ progress }} %
+
+ Loading... {{ progress }} %
+
-
+
-
-
+
+
@@ -83,8 +98,8 @@ const { hasFinishLoading, progress, items } = await useProgress()
cast-shadow
:position="[-3, 2, 4]"
:look-at="[0, 0, 0]"
- :shadow-mapSize-width="256"
- :shadow-mapSize-height="256"
+ :shadow-map-size-width="256"
+ :shadow-map-size-height="256"
:shadow-camera-near="0.5"
:shadow-camera-left="-10"
/>
diff --git a/docs/.vitepress/theme/components/Feather.vue b/docs/.vitepress/theme/components/Feather.vue
index 2c4b4a0e..1f01726f 100644
--- a/docs/.vitepress/theme/components/Feather.vue
+++ b/docs/.vitepress/theme/components/Feather.vue
@@ -1,7 +1,7 @@
+
-
-
+
+
diff --git a/docs/.vitepress/theme/components/LeviosoDemo.vue b/docs/.vitepress/theme/components/LeviosoDemo.vue
index 48a5e7ee..fd4cc369 100644
--- a/docs/.vitepress/theme/components/LeviosoDemo.vue
+++ b/docs/.vitepress/theme/components/LeviosoDemo.vue
@@ -15,13 +15,18 @@ const gl = {
-
+
-
+
diff --git a/docs/.vitepress/theme/components/LoveVueThreeJS.vue b/docs/.vitepress/theme/components/LoveVueThreeJS.vue
index 0b46ded0..6b6f14c4 100644
--- a/docs/.vitepress/theme/components/LoveVueThreeJS.vue
+++ b/docs/.vitepress/theme/components/LoveVueThreeJS.vue
@@ -1,10 +1,10 @@
-
+
-
+
-
+
diff --git a/docs/package.json b/docs/package.json
index e89a1a49..d0ad4691 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -9,12 +9,10 @@
"preview": "vitepress preview"
},
"devDependencies": {
- "unocss": "^0.53.5",
- "vite-svg-loader": "^4.0.0",
- "vitepress": "1.0.0-beta.5"
+ "unocss": "^0.54.0",
+ "vite-svg-loader": "^4.0.0"
},
"dependencies": {
- "@tresjs/cientos": "workspace:^",
- "gsap": "^3.12.2"
+ "@tresjs/cientos": "workspace:^"
}
}
diff --git a/package.json b/package.json
index 0d1a5948..1807f504 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"vue": ">=3.3"
},
"devDependencies": {
- "@alvarosabu/prettier-config": "^1.3.0",
+ "@tresjs/eslint-config-vue": "^0.1.1",
"@release-it/conventional-changelog": "^7.0.0",
"@tweakpane/core": "^1.1.9",
"@types/node": "^20.5.4",
@@ -59,12 +59,10 @@
"@typescript-eslint/parser": "^6.4.1",
"@vitejs/plugin-vue": "^4.3.3",
"eslint": "^8.47.0",
- "eslint-config-prettier": "^9.0.0",
"eslint-plugin-vue": "^9.17.0",
"gsap": "^3.12.2",
"kolorist": "^1.8.0",
"pathe": "^1.1.1",
- "prettier": "^3.0.2",
"release-it": "^16.1.5",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-visualizer": "^5.9.2",
diff --git a/playground/.eslintrc.json b/playground/.eslintrc.json
new file mode 100644
index 00000000..a5a64c13
--- /dev/null
+++ b/playground/.eslintrc.json
@@ -0,0 +1,6 @@
+{
+ "extends": "@tresjs/eslint-config-vue",
+ "rules": {
+ "no-console": "off"
+ }
+}
diff --git a/playground/src/components/EnvironmentDemo.vue b/playground/src/components/EnvironmentDemo.vue
index e774cea0..f5cb13a3 100644
--- a/playground/src/components/EnvironmentDemo.vue
+++ b/playground/src/components/EnvironmentDemo.vue
@@ -1,10 +1,11 @@
-
+
@@ -33,14 +36,20 @@ watch(glassMaterialRef, value => {
-
+
-
+
diff --git a/playground/src/components/LeviosoDemo.vue b/playground/src/components/LeviosoDemo.vue
index 0a8fb1bf..4737771b 100644
--- a/playground/src/components/LeviosoDemo.vue
+++ b/playground/src/components/LeviosoDemo.vue
@@ -40,14 +40,16 @@ pane.addInput(leviosoState, 'floatFactor', {
max: 10,
})
const groupRef = shallowRef()
-
-
+
diff --git a/playground/src/components/ModelsDemo.vue b/playground/src/components/ModelsDemo.vue
index 4b47da4b..cf668281 100644
--- a/playground/src/components/ModelsDemo.vue
+++ b/playground/src/components/ModelsDemo.vue
@@ -21,22 +21,45 @@ const gl = {
alpha: true,
toneMapping: NoToneMapping,
}
-
-
+
-
-
+
+
-
+
-
+
-
+
diff --git a/playground/src/components/TheGizmos.vue b/playground/src/components/TheGizmos.vue
index 2fb87f49..573b0e3b 100644
--- a/playground/src/components/TheGizmos.vue
+++ b/playground/src/components/TheGizmos.vue
@@ -36,7 +36,7 @@ pane
],
value: transformState.mode,
})
- .on('change', ev => {
+ .on('change', (ev) => {
transformState.mode = ev.value
})
@@ -58,24 +58,37 @@ axisFolder
],
value: transformState.axis,
})
- .on('change', ev => {
+ .on('change', (ev) => {
transformState.axis = ev.value
})
axisFolder.addInput(transformState, 'showX')
axisFolder.addInput(transformState, 'showY')
axisFolder.addInput(transformState, 'showZ')
+
-
+
-
+
-
+
diff --git a/playground/src/components/WobbleMaterial.vue b/playground/src/components/WobbleMaterial.vue
index e141c109..34bee183 100644
--- a/playground/src/components/WobbleMaterial.vue
+++ b/playground/src/components/WobbleMaterial.vue
@@ -14,19 +14,28 @@ const gl = {
}
const context = ref()
-
-
+
-
+
-
+
diff --git a/playground/src/components/gltf/index.vue b/playground/src/components/gltf/index.vue
index ac0b8101..e645dce7 100644
--- a/playground/src/components/gltf/index.vue
+++ b/playground/src/components/gltf/index.vue
@@ -1,5 +1,6 @@
+
-
+
@@ -46,6 +54,10 @@ watchEffect(() => {
/>
-
+
diff --git a/playground/src/components/useVideoTextureDemo.vue b/playground/src/components/useVideoTextureDemo.vue
index 83a911f1..a9337244 100644
--- a/playground/src/components/useVideoTextureDemo.vue
+++ b/playground/src/components/useVideoTextureDemo.vue
@@ -1,9 +1,9 @@
+
-
+
-
+
diff --git a/playground/src/pages/BackdropDemo.vue b/playground/src/pages/BackdropDemo.vue
index 6ace8e5d..f6587701 100644
--- a/playground/src/pages/BackdropDemo.vue
+++ b/playground/src/pages/BackdropDemo.vue
@@ -18,8 +18,15 @@ const gl = {
-
-
+
+
diff --git a/playground/src/pages/CameraControlsDemo.vue b/playground/src/pages/CameraControlsDemo.vue
index b7019585..24fe99d3 100644
--- a/playground/src/pages/CameraControlsDemo.vue
+++ b/playground/src/pages/CameraControlsDemo.vue
@@ -1,10 +1,9 @@
-
+
diff --git a/playground/src/pages/MouseParallaxDemo.vue b/playground/src/pages/MouseParallaxDemo.vue
index 96577976..095ad3c0 100644
--- a/playground/src/pages/MouseParallaxDemo.vue
+++ b/playground/src/pages/MouseParallaxDemo.vue
@@ -15,8 +15,13 @@ const gl = {
-
-
+
+
diff --git a/playground/src/pages/OrbitControlsDemo.vue b/playground/src/pages/OrbitControlsDemo.vue
index e3790e8a..7af80735 100644
--- a/playground/src/pages/OrbitControlsDemo.vue
+++ b/playground/src/pages/OrbitControlsDemo.vue
@@ -131,7 +131,12 @@ function onEnd() {
-
+
diff --git a/playground/src/pages/PrecipitationDemo.vue b/playground/src/pages/PrecipitationDemo.vue
index efa0a3e7..7effe075 100644
--- a/playground/src/pages/PrecipitationDemo.vue
+++ b/playground/src/pages/PrecipitationDemo.vue
@@ -61,8 +61,11 @@ pane.addInput(options, 'areaZ', {
max: 30,
})
+
-
+
+ />
diff --git a/playground/src/pages/SVGDemo.vue b/playground/src/pages/SVGDemo.vue
index 34eb1eef..fb9d801c 100644
--- a/playground/src/pages/SVGDemo.vue
+++ b/playground/src/pages/SVGDemo.vue
@@ -9,58 +9,76 @@ xmlns="http://www.w3.org/2000/svg">
-`;
+`
const svgSquareString = ``;
+`
-const svgHeartURL = "/cientos.svg";
+const svgHeartURL = '/cientos.svg'
const { onLoop } = useRenderLoop()
-const skipFillsA = shallowRef(false);
-const skipFillsB = shallowRef(true);
-const skipFillsC = shallowRef(false);
+const skipFillsA = shallowRef(false)
+const skipFillsB = shallowRef(true)
+const skipFillsC = shallowRef(false)
-let cooldown = 0;
+let cooldown = 0
onLoop(({ delta }) => {
- cooldown -= delta;
+ cooldown -= delta
while (cooldown <= 0) {
- const skipFillsTmp = skipFillsA.value;
- skipFillsA.value = skipFillsC.value;
- skipFillsC.value = skipFillsB.value;
- skipFillsB.value = skipFillsTmp;
- cooldown += 1;
+ const skipFillsTmp = skipFillsA.value
+ skipFillsA.value = skipFillsC.value
+ skipFillsC.value = skipFillsB.value
+ skipFillsB.value = skipFillsTmp
+ cooldown += 1
}
-});
+})
const gl = {
clearColor: '#333',
alpha: true,
toneMapping: NoToneMapping,
}
-
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/playground/src/pages/ScrollControlsDemo.vue b/playground/src/pages/ScrollControlsDemo.vue
index b4f6b57a..7489e606 100644
--- a/playground/src/pages/ScrollControlsDemo.vue
+++ b/playground/src/pages/ScrollControlsDemo.vue
@@ -3,7 +3,7 @@ import { ref, watchEffect } from 'vue'
import { TresCanvas, useRenderLoop } from '@tresjs/core'
import { ScrollControls, Stars, Sphere, Box } from '@tresjs/cientos'
import { SRGBColorSpace, NoToneMapping } from 'three'
-import { TresLeches, useControls } from '@tresjs/leches';
+import { TresLeches, useControls } from '@tresjs/leches'
import '@tresjs/leches/styles'
const scRef = ref()
@@ -25,7 +25,7 @@ const gl = {
useControls('fpsgraph')
useControls({
- progress: progress.value
+ progress: progress.value,
})
const { onLoop } = useRenderLoop()
@@ -36,16 +36,35 @@ onLoop(() => {
}
})
+
-
+
-
-
-
+
+
+
@@ -61,6 +80,7 @@ onLoop(() => {
+