Spaces:
Running
Running
Update interface.js
Browse files- interface.js +8 -5
interface.js
CHANGED
|
@@ -73,13 +73,14 @@ const currentScriptTag = document.currentScript;
|
|
| 73 |
widgetContainer.setAttribute('data-original-aspect', aspectPercent);
|
| 74 |
|
| 75 |
// TOOLTIP BUTTON HTML IF NEEDED
|
| 76 |
-
|
| 77 |
? `<button id="tooltips-toggle-${instanceId}" class="widget-button tooltips-toggle" title="Tooltips" aria-label="Afficher/Masquer les tooltips">⦿</button>`
|
| 78 |
: '';
|
| 79 |
|
| 80 |
// COLOR BUTTON: will open the color panel
|
| 81 |
const colorButtonId = `color-btn-${instanceId}`;
|
| 82 |
const colorPanelId = `color-panel-${instanceId}`;
|
|
|
|
| 83 |
|
| 84 |
// Color choices: add more as needed
|
| 85 |
const colorChoices = Array.isArray(config.colorChoices) ? config.colorChoices : [];
|
|
@@ -108,7 +109,9 @@ const currentScriptTag = document.currentScript;
|
|
| 108 |
widgetContainer.innerHTML = `
|
| 109 |
<div id="viewer-container-${instanceId}" class="viewer-container">
|
| 110 |
<div class="controls-row">
|
| 111 |
-
<button id="${colorButtonId}" class="widget-button color-menu-btn" aria-label="Ouvrir le menu de couleurs" title="Couleur">
|
|
|
|
|
|
|
| 112 |
<button id="fullscreen-toggle-${instanceId}" class="widget-button fullscreen-toggle" title="Plein écran" aria-label="Plein écran">⇱</button>
|
| 113 |
<button id="help-toggle-${instanceId}" class="widget-button help-toggle" title="Aide" aria-label="Aide">?</button>
|
| 114 |
<button id="reset-camera-btn-${instanceId}" class="widget-button reset-camera-btn" title="Réinitialiser la caméra" aria-label="Réinitialiser la caméra">
|
|
@@ -160,9 +163,9 @@ const currentScriptTag = document.currentScript;
|
|
| 160 |
? '- Cliquez sur ⦿ pour afficher/masquer les tooltips.<br>'
|
| 161 |
: '';
|
| 162 |
|
| 163 |
-
// ==== MODIFIED HELP TEXT, with
|
| 164 |
-
const
|
| 165 |
-
|
| 166 |
const resetHelpLine = '- Cliquez sur ⟲ pour réinitialiser la caméra.<br>';
|
| 167 |
|
| 168 |
if (isMobile) {
|
|
|
|
| 73 |
widgetContainer.setAttribute('data-original-aspect', aspectPercent);
|
| 74 |
|
| 75 |
// TOOLTIP BUTTON HTML IF NEEDED
|
| 76 |
+
const tooltipsButtonHTML = config.tooltips_url
|
| 77 |
? `<button id="tooltips-toggle-${instanceId}" class="widget-button tooltips-toggle" title="Tooltips" aria-label="Afficher/Masquer les tooltips">⦿</button>`
|
| 78 |
: '';
|
| 79 |
|
| 80 |
// COLOR BUTTON: will open the color panel
|
| 81 |
const colorButtonId = `color-btn-${instanceId}`;
|
| 82 |
const colorPanelId = `color-panel-${instanceId}`;
|
| 83 |
+
const PALETTE_IMG_URL = 'https://huggingface.co/datasets/MikaFil/3D_models/resolve/main/EARCARE/palette.png';
|
| 84 |
|
| 85 |
// Color choices: add more as needed
|
| 86 |
const colorChoices = Array.isArray(config.colorChoices) ? config.colorChoices : [];
|
|
|
|
| 109 |
widgetContainer.innerHTML = `
|
| 110 |
<div id="viewer-container-${instanceId}" class="viewer-container">
|
| 111 |
<div class="controls-row">
|
| 112 |
+
<button id="${colorButtonId}" class="widget-button color-menu-btn" aria-label="Ouvrir le menu de couleurs" title="Couleur">
|
| 113 |
+
<img src="${PALETTE_IMG_URL}" alt="palette" class="palette-btn-img" draggable="false">
|
| 114 |
+
</button>
|
| 115 |
<button id="fullscreen-toggle-${instanceId}" class="widget-button fullscreen-toggle" title="Plein écran" aria-label="Plein écran">⇱</button>
|
| 116 |
<button id="help-toggle-${instanceId}" class="widget-button help-toggle" title="Aide" aria-label="Aide">?</button>
|
| 117 |
<button id="reset-camera-btn-${instanceId}" class="widget-button reset-camera-btn" title="Réinitialiser la caméra" aria-label="Réinitialiser la caméra">
|
|
|
|
| 163 |
? '- Cliquez sur ⦿ pour afficher/masquer les tooltips.<br>'
|
| 164 |
: '';
|
| 165 |
|
| 166 |
+
// ==== MODIFIED HELP TEXT, with PNG palette image in helptext =====
|
| 167 |
+
const paletteHelpLine =
|
| 168 |
+
`- Cliquez sur <img src="${PALETTE_IMG_URL}" alt="palette" class="inline-palette" draggable="false"> pour ouvrir le menu de couleurs.<br>`;
|
| 169 |
const resetHelpLine = '- Cliquez sur ⟲ pour réinitialiser la caméra.<br>';
|
| 170 |
|
| 171 |
if (isMobile) {
|