Commit c02ab0f8 authored by Tomi6545's avatar Tomi6545
Browse files

Merge branch 'master' into thomas

parents b2f6e8e0 67471e62
Showing with 27 additions and 0 deletions
+27 -0
......@@ -334,6 +334,10 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script> <!-- Leaflet einbinden -->
<script src="ar_overviewmap.js"></script>
<!-- Audio-Element für Button-Klick -->
<audio id="button-sound" src="sounds/button-sound.mp3" preload="auto"></audio>
<script>
// Variablen
let selectedModel = 'robot';
......@@ -367,6 +371,12 @@
window.onload = () => {
initializeAddMenu();
// Fügt Sound zu allen Buttons hinzu
const buttons = document.querySelectorAll("button, .menu-item");
buttons.forEach(button => {
button.addEventListener("click", playButtonSound);
});
};
function initializeAddMenu() {
......@@ -493,6 +503,7 @@
function completeEditing() {
removeHighlightFromSelectedModel();
closeDynamicMenu();
selectedPlacedModel = null;
document.getElementById('edit-menu').style.display = 'none';
document.getElementById('menu-bar').style.display = 'flex';
......@@ -695,6 +706,22 @@
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) {
const startButton = document.createElement('button');
startButton.textContent = 'Start AR';
......
File added
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