Commit 0212145e authored by Cantuerk's avatar Cantuerk
Browse files

Merge branch '21caog1bif-master-patch-29998' into 'master'

Update public/index.html, public/sounds/click.mp3

See merge request geovistoogsi/ar!131
parents a9016817 db48630a
Pipeline #10690 passed with stage
in 9 seconds
...@@ -285,6 +285,9 @@ ...@@ -285,6 +285,9 @@
</div> </div>
</div> </div>
<!-- Audio-Element für Button-Klick -->
<audio id="button-sound" src="click.mp3" preload="auto"></audio>
<script> <script>
// Variablen // Variablen
let selectedModel = 'robot'; let selectedModel = 'robot';
...@@ -318,6 +321,12 @@ ...@@ -318,6 +321,12 @@
window.onload = () => { window.onload = () => {
initializeAddMenu(); initializeAddMenu();
// Fügt Sound zu allen Buttons hinzu
const buttons = document.querySelectorAll("button, .menu-item");
buttons.forEach(button => {
button.addEventListener("click", playButtonSound);
});
}; };
function initializeAddMenu() { function initializeAddMenu() {
...@@ -443,6 +452,7 @@ ...@@ -443,6 +452,7 @@
function completeEditing() { function completeEditing() {
removeHighlightFromSelectedModel(); removeHighlightFromSelectedModel();
closeDynamicMenu();
selectedPlacedModel = null; selectedPlacedModel = null;
document.getElementById('edit-menu').style.display = 'none'; document.getElementById('edit-menu').style.display = 'none';
document.getElementById('menu-bar').style.display = 'flex'; document.getElementById('menu-bar').style.display = 'flex';
...@@ -636,6 +646,22 @@ ...@@ -636,6 +646,22 @@
document.getElementById('confirmation-dialog').style.display = 'none'; document.getElementById('confirmation-dialog').style.display = 'none';
} }
let soundTimeout = false;
function playButtonSound() {
if (!soundTimeout) {
const sound = document.getElementById("button-sound");
sound.currentTime = 0;
sound.play();
soundTimeout = true;
setTimeout(() => {
soundTimeout = false;
}, 200); // Verzögerung von 200ms
}
}
if (navigator.xr) { if (navigator.xr) {
const startButton = document.createElement('button'); const startButton = document.createElement('button');
startButton.textContent = 'Start AR'; startButton.textContent = 'Start AR';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment