Skip to content

Commit aa64f42

Browse files
author
Juho Räsänen
committed
settings improved and pull reload
1 parent 1b27a87 commit aa64f42

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

main.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as THREE from 'three'
77
import { OrbitControls } from 'three/addons/controls/OrbitControls.js'
88
import Stats from 'three/addons/libs/stats.module.js'
99

10-
1110
import { Explosion } from './scenes/explosion'
1211
import { CityAtStreetLevel } from './scenes/cityAtStreetLevel'
1312
import { CityFromWindow } from './scenes/cityFromWindow'
@@ -35,18 +34,18 @@ function init () {
3534
{
3635

3736
scene: new CityFromWindow(),
38-
time: 10000,
37+
time: 10000
3938
},
4039
{
4140
scene: new Explosion(),
42-
time: 10000,
41+
time: 10000
4342
},
4443
{
4544
scene: new Credits(),
4645
time: 10000
4746
}
4847

49-
]
48+
]
5049

5150
// Stats
5251
stats = new Stats()
@@ -82,15 +81,15 @@ function init () {
8281
welcomeGUI.hide()
8382

8483
const settings = {
85-
fullScreen: true,
86-
music: true,
87-
stats: true,
88-
antialias: false,
89-
checkShaderErrors: false,
90-
pixelRatio: Number((window.devicePixelRatio * 0.70).toFixed(1)),
84+
fullScreen: import.meta.env.MODE === 'production',
85+
music: import.meta.env.MODE === 'production',
86+
stats: import.meta.env.MODE === 'development',
87+
antialias: import.meta.env.MODE === 'production',
88+
checkShaderErrors: import.meta.env.MODE === 'development',
89+
pixelRatio: import.meta.env.MODE === 'production' ? window.devicePixelRatio : Number((window.devicePixelRatio * 0.70).toFixed(1)),
9190
start: () => {
9291
welcomeGUI.hide()
93-
document.body.style.cursor = 'none'
92+
if (import.meta.env.MODE === 'production') document.body.style.cursor = 'none'
9493

9594
// Renderer
9695
renderer = new THREE.WebGLRenderer({ antialias: settings.antialias })

vite.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
server: {
3+
watch: {
4+
usePolling: true
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)