forked from Simnation/Main
Update script.js
This commit is contained in:
parent
dc9b07ba3d
commit
d20ebff48a
1 changed files with 32 additions and 0 deletions
|
@ -1259,11 +1259,43 @@ function showDJInterface() {
|
||||||
if (djInterfaceElement) {
|
if (djInterfaceElement) {
|
||||||
djInterfaceElement.classList.remove('hidden');
|
djInterfaceElement.classList.remove('hidden');
|
||||||
|
|
||||||
|
// Zentriere das Interface auf dem Bildschirm
|
||||||
|
interfacePosition = {
|
||||||
|
x: (window.innerWidth - interfaceSize.width) / 2,
|
||||||
|
y: (window.innerHeight - interfaceSize.height) / 2
|
||||||
|
};
|
||||||
|
|
||||||
// Wende gespeicherte Einstellungen an
|
// Wende gespeicherte Einstellungen an
|
||||||
applyInterfaceSettings();
|
applyInterfaceSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Aktualisiere den Message Handler
|
||||||
|
window.addEventListener('message', function(event) {
|
||||||
|
const data = event.data;
|
||||||
|
|
||||||
|
switch(data.type) {
|
||||||
|
case 'showDJInterface':
|
||||||
|
if (data.center) {
|
||||||
|
// Zentriere das Interface
|
||||||
|
interfacePosition = {
|
||||||
|
x: (window.innerWidth - interfaceSize.width) / 2,
|
||||||
|
y: (window.innerHeight - interfaceSize.height) / 2
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.reset) {
|
||||||
|
// Setze Größe zurück
|
||||||
|
interfaceSize = { width: 1000, height: 700 };
|
||||||
|
}
|
||||||
|
|
||||||
|
showDJInterface();
|
||||||
|
break;
|
||||||
|
// ... andere cases ...
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// Utility Functions
|
// Utility Functions
|
||||||
function showNotification(message, type = 'info') {
|
function showNotification(message, type = 'info') {
|
||||||
console.log(`DJ System [${type.toUpperCase()}]: ${message}`);
|
console.log(`DJ System [${type.toUpperCase()}]: ${message}`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue