|
678 | 678 | ></a |
679 | 679 | > |
680 | 680 | </li> |
| 681 | + <!-- Dropdown menu for Play-Only Mode --> |
| 682 | + <ul id="aux-dropdown" class="dropdown-content"> |
| 683 | + <li> |
| 684 | + <a id="themeSelectIcon" class="tooltipped dropdown-trigger" data-position="left" data-activates="themedropdown"> |
| 685 | + <i class="material-icons md-48">brightness_7</i> |
| 686 | + </a> |
| 687 | + </li> |
| 688 | + <li> |
| 689 | + <a id="restoreIcon" class="tooltipped" data-position="bottom"> |
| 690 | + <i class="material-icons md-48">restore_from_trash</i> |
| 691 | + </a> |
| 692 | + </li> |
| 693 | + <li> |
| 694 | + <a id="languageSelectIcon" class="tooltipped dropdown-trigger" data-position="left" data-activates="languagedropdown"> |
| 695 | + <i class="material-icons md-48">translate</i> |
| 696 | + </a> |
| 697 | + </li> |
| 698 | + </ul> |
| 699 | + |
681 | 700 | <li> |
682 | 701 | <a |
683 | 702 | id="helpIcon" |
|
988 | 1007 | </div> |
989 | 1008 | </div> |
990 | 1009 | <script> |
991 | | - let persistentNotification = null; |
| 1010 | + let persistentNotification = null; |
992 | 1011 |
|
993 | 1012 | function togglePlayOnlyMode() { |
994 | 1013 | const isSmallScreen = window.innerWidth < 768 || window.innerHeight < 600; |
995 | 1014 | const body = document.body; |
996 | | - const homeButton = document.getElementById("Home [HOME]"); |
997 | | - const buttonContainer = document.getElementById("buttoncontainerBOTTOM"); |
| 1015 | + const auxToolbar = document.getElementById("aux-toolbar"); |
| 1016 | + const toggleAuxBtn = document.getElementById("toggleAuxBtn"); |
998 | 1017 |
|
999 | 1018 | if (isSmallScreen) { |
| 1019 | + // Enable Play-Only Mode |
1000 | 1020 | body.classList.add("play-only"); |
1001 | 1021 | showPersistentNotification(); |
1002 | 1022 |
|
1003 | | - if (buttonContainer) { |
1004 | | - buttonContainer.style.display = "flex"; |
1005 | | - buttonContainer.style.justifyContent = "flex-end"; |
1006 | | - buttonContainer.style.alignItems = "center"; |
| 1023 | + if (auxToolbar) { |
| 1024 | + auxToolbar.style.display = "none"; |
1007 | 1025 | } |
1008 | | - |
1009 | | - if (homeButton) { |
1010 | | - homeButton.style.display = "flex"; |
1011 | | - homeButton.style.position = "fixed"; |
1012 | | - homeButton.style.right = "15px"; |
1013 | | - homeButton.style.bottom = "15px"; |
1014 | | - homeButton.style.zIndex = "10000"; |
1015 | | - } |
1016 | | - |
1017 | | - hideElementById("Show/hide blocks"); |
1018 | | - hideElementById("Expand/collapse blocks"); |
1019 | | - hideElementById("Decrease block size"); |
1020 | | - hideElementById("Increase block size"); |
1021 | | - hideElementById("grid"); |
1022 | | - hideElementById("palette"); |
| 1026 | + |
| 1027 | + enableAuxDropdown(); |
1023 | 1028 |
|
1024 | 1029 | } else { |
1025 | 1030 | body.classList.remove("play-only"); |
1026 | 1031 | removePersistentNotification(); |
1027 | 1032 |
|
1028 | | - if (homeButton) homeButton.style = ""; |
1029 | | - if (buttonContainer) buttonContainer.style = ""; |
1030 | | - |
1031 | | - showElementById("Show/hide blocks"); |
1032 | | - showElementById("Expand/collapse blocks"); |
1033 | | - showElementById("Decrease block size"); |
1034 | | - showElementById("Increase block size"); |
1035 | | - showElementById("grid"); |
1036 | | - showElementById("palette"); |
1037 | | - } |
1038 | | - } |
1039 | | - |
1040 | | - function hideElementById(elementId) { |
1041 | | - const elem = document.getElementById(elementId); |
1042 | | - if (elem) { |
1043 | | - elem.style.display = "none"; |
1044 | | - } |
1045 | | - } |
| 1033 | + if (auxToolbar) { |
| 1034 | + auxToolbar.style.display = ""; |
| 1035 | + } |
1046 | 1036 |
|
1047 | | - function showElementById(elementId) { |
1048 | | - const elem = document.getElementById(elementId); |
1049 | | - if (elem) { |
1050 | | - elem.style.display = ""; |
| 1037 | + disableAuxDropdown(); |
1051 | 1038 | } |
1052 | 1039 | } |
1053 | 1040 |
|
1054 | 1041 | function showPersistentNotification() { |
1055 | 1042 | if (!persistentNotification) { |
1056 | 1043 | persistentNotification = document.createElement("div"); |
1057 | 1044 | persistentNotification.id = "persistentNotification"; |
1058 | | - persistentNotification.innerHTML = "Play only mode enabled. For full Music Blocks experience, use a larger display."; |
| 1045 | + persistentNotification.innerHTML = |
| 1046 | + "Play only mode enabled. For full Music Blocks experience, use a larger display."; |
1059 | 1047 | document.body.appendChild(persistentNotification); |
1060 | 1048 | } |
1061 | 1049 | } |
|
1067 | 1055 | } |
1068 | 1056 | } |
1069 | 1057 |
|
| 1058 | + function enableAuxDropdown() { |
| 1059 | + const toggleAuxBtn = document.getElementById("toggleAuxBtn"); |
| 1060 | + if (toggleAuxBtn) { |
| 1061 | + toggleAuxBtn.addEventListener("click", function (event) { |
| 1062 | + event.preventDefault(); |
| 1063 | + event.stopPropagation(); |
| 1064 | + |
| 1065 | + const auxDropdown = document.getElementById("aux-dropdown"); |
| 1066 | + if (auxDropdown) { |
| 1067 | + auxDropdown.classList.toggle("show-dropdown"); |
| 1068 | + } |
| 1069 | + }); |
| 1070 | + } |
| 1071 | + } |
| 1072 | + |
| 1073 | + function disableAuxDropdown() { |
| 1074 | + const auxDropdown = document.getElementById("aux-dropdown"); |
| 1075 | + if (auxDropdown) { |
| 1076 | + auxDropdown.classList.remove("show-dropdown"); |
| 1077 | + } |
| 1078 | + } |
| 1079 | + |
1070 | 1080 | togglePlayOnlyMode(); |
1071 | | - |
1072 | 1081 | window.addEventListener("resize", togglePlayOnlyMode); |
1073 | 1082 | </script> |
1074 | 1083 |
|
1075 | 1084 |
|
1076 | | - |
1077 | 1085 | <div id="searchBar" tabindex="-1"> |
1078 | 1086 | <input |
1079 | 1087 | type="text" |
|
0 commit comments