Commit c02ab0f8 authored by Tomi6545's avatar Tomi6545
Browse files

Merge branch 'master' into thomas

1 merge request!135first map implementation
Showing with 27 additions and 0 deletions
+27 -0
...@@ -334,6 +334,10 @@ ...@@ -334,6 +334,10 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" /> <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="https://unpkg.com/leaflet/dist/leaflet.js"></script> <!-- Leaflet einbinden -->
<script src="ar_overviewmap.js"></script> <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> <script>
// Variablen // Variablen
let selectedModel = 'robot'; let selectedModel = 'robot';
...@@ -367,6 +371,12 @@ ...@@ -367,6 +371,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() {
...@@ -493,6 +503,7 @@ ...@@ -493,6 +503,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';
...@@ -695,6 +706,22 @@ ...@@ -695,6 +706,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';
......
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