Spaces:
Running
Running
Update index_2.js
Browse files- index_2.js +18 -5
index_2.js
CHANGED
@@ -143,7 +143,7 @@
|
|
143 |
border: 1px solid #474558;
|
144 |
border-radius: 5px;
|
145 |
padding: 10px;
|
146 |
-
font-size:
|
147 |
line-height: 1.4;
|
148 |
color: #474558;
|
149 |
}
|
@@ -232,9 +232,9 @@
|
|
232 |
// Set help instructions based on device type.
|
233 |
if (isMobile) {
|
234 |
menuContent.innerHTML = `
|
235 |
-
-
|
236 |
-
-
|
237 |
-
-
|
238 |
`;
|
239 |
} else {
|
240 |
menuContent.innerHTML = `
|
@@ -352,8 +352,21 @@
|
|
352 |
controls.maxAngle = maxAngle;
|
353 |
controls.minAzimuth = minAzimuth;
|
354 |
controls.maxAzimuth = maxAzimuth;
|
355 |
-
// Set panSpeed to 0.1
|
356 |
controls.panSpeed = 0.1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
|
358 |
controls.update();
|
359 |
|
|
|
143 |
border: 1px solid #474558;
|
144 |
border-radius: 5px;
|
145 |
padding: 10px;
|
146 |
+
font-size: 15px;
|
147 |
line-height: 1.4;
|
148 |
color: #474558;
|
149 |
}
|
|
|
232 |
// Set help instructions based on device type.
|
233 |
if (isMobile) {
|
234 |
menuContent.innerHTML = `
|
235 |
+
- Pour vous déplacer, glissez deux doigts sur l'écran.<br>
|
236 |
+
- Pour orbiter, utilisez un doigt.<br>
|
237 |
+
- Pour zoomer, pincez avec deux doigts.
|
238 |
`;
|
239 |
} else {
|
240 |
menuContent.innerHTML = `
|
|
|
352 |
controls.maxAngle = maxAngle;
|
353 |
controls.minAzimuth = minAzimuth;
|
354 |
controls.maxAzimuth = maxAzimuth;
|
355 |
+
// Set panSpeed to 0.1 for all devices.
|
356 |
controls.panSpeed = 0.1;
|
357 |
+
// Set moveSpeed based on device: 0.5 on mobile, 1 on computer.
|
358 |
+
const moveSpeed = isMobile ? 0.5 : 1;
|
359 |
+
|
360 |
+
// Update the controls' internal move speed in the update loop.
|
361 |
+
// (Assuming your OrbitControls.update() function uses a moveSpeed variable)
|
362 |
+
// We'll override the moveSpeed in the update function via closure.
|
363 |
+
const originalUpdate = controls.update;
|
364 |
+
controls.update = function() {
|
365 |
+
// In your update() implementation, use the new moveSpeed instead of a hardcoded value.
|
366 |
+
// (This assumes your library's OrbitControls code uses a moveSpeed constant inside update,
|
367 |
+
// you may need to modify that file directly.)
|
368 |
+
originalUpdate.call(controls, moveSpeed);
|
369 |
+
};
|
370 |
|
371 |
controls.update();
|
372 |
|