Added burger button for mobile - to hide the Quit/Menu (and future) UI buttons, giving more room for UI elements
This commit is contained in:
parent
ef7a0f06ed
commit
ef77fe7259
@ -16,9 +16,12 @@
|
||||
<body>
|
||||
|
||||
<div id="ui" style="display: none;">
|
||||
<button id="burgerButton" class="mobile-only">☰</button>
|
||||
<div id="menuButtons">
|
||||
<button id="quitButton" class="button">Quit</button>
|
||||
<button id="uiButton" class="button">Menu</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="uiWidget" class="hidden">
|
||||
<div class="widget-tabs">
|
||||
<button class="tab-button" data-tab="settings">Settings</button>
|
||||
|
||||
@ -3850,5 +3850,22 @@ function hideSongDurationBar() {
|
||||
document.getElementById('songDurationBar').style.display = 'none';
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const burgerButton = document.getElementById('burgerButton');
|
||||
const menuButtons = document.getElementById('menuButtons');
|
||||
|
||||
burgerButton.addEventListener('click', () => {
|
||||
menuButtons.classList.toggle('show');
|
||||
});
|
||||
|
||||
// Close the menu when clicking outside
|
||||
document.addEventListener('click', (event) => {
|
||||
if (!burgerButton.contains(event.target) && !menuButtons.contains(event.target)) {
|
||||
menuButtons.classList.remove('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
init();
|
||||
|
||||
@ -548,6 +548,49 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
#burgerButton {
|
||||
display: none;
|
||||
background-color: #ff00ff;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 10px;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#menuButtons {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
#menuButtons button {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
#burgerButton {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#menuButtons {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
background-color: rgba(18, 4, 88, 0.9);
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#menuButtons.show {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.song-duration-bar {
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
@ -620,14 +663,12 @@ body {
|
||||
right: 10px;
|
||||
transform: none;
|
||||
width: calc(100% - 130px); /* Full width minus space for buttons and buffer */
|
||||
max-width: 200px; /* Limit maximum width */
|
||||
max-width: auto; /* Limit maximum width */
|
||||
height: 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#ui {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user