|
677 | 677 | class="animated-icon material-icons md-48 " |
678 | 678 | >menu</i |
679 | 679 | ></a> |
680 | | - <!-- Dropdown menu for Play-Only Mode --> |
681 | | - <!-- Dropdown menu for Play-Only Mode (outside the <a>) --> |
682 | | -<ul id="aux-dropdown" class="dropdown-content"> |
683 | | - <li> |
684 | | - <a |
685 | | - id="themeSelectIcon" |
686 | | - class="tooltipped dropdown-trigger" |
687 | | - data-position="left" |
688 | | - data-activates="themedropdown" |
689 | | - > |
690 | | - <i class="material-icons md-48">brightness_7</i> |
691 | | - </a> |
692 | | - </li> |
693 | | - <li> |
694 | | - <a |
695 | | - id="restoreIcon" |
696 | | - class="tooltipped" |
697 | | - data-position="bottom" |
698 | | - > |
699 | | - <i class="material-icons md-48">restore_from_trash</i> |
700 | | - </a> |
701 | | - </li> |
702 | | - <li> |
703 | | - <a |
704 | | - id="languageSelectIcon" |
705 | | - class="tooltipped dropdown-trigger" |
706 | | - data-position="left" |
707 | | - data-activates="languagedropdown" |
708 | | - > |
709 | | - <i class="material-icons md-48">translate</i> |
710 | | - </a> |
711 | | - </li> |
712 | | - </ul> |
713 | | - </li> |
714 | | - |
| 680 | + </li> |
715 | 681 | <li> |
716 | 682 | <a |
717 | 683 | id="helpIcon" |
|
814 | 780 | class="tooltipped dropdown-trigger" |
815 | 781 | data-position="left" |
816 | 782 | data-activates="themedropdown" |
| 783 | + data-tooltip="Select Theme" |
817 | 784 | ><i class="material-icons md-48">brightness_7</i></a |
818 | 785 | > |
819 | 786 | </li> |
|
870 | 837 | id="restoreIcon" |
871 | 838 | class="tooltipped" |
872 | 839 | data-position="bottom" |
| 840 | + data-tooltip="Restore" |
873 | 841 | ><i class="material-icons md-48" |
874 | 842 | >restore_from_trash</i |
875 | 843 | ></a |
|
906 | 874 | class="tooltipped dropdown-trigger" |
907 | 875 | data-position="left" |
908 | 876 | data-activates="languagedropdown" |
| 877 | + data-tooltip="Select Language" |
909 | 878 | ><i class="material-icons md-48" |
910 | 879 | >translate</i |
911 | 880 | ></a |
|
1022 | 991 | </script> |
1023 | 992 | </div> |
1024 | 993 | </div> |
| 994 | + |
1025 | 995 | <script> |
1026 | | - document.addEventListener('DOMContentLoaded', function() { |
1027 | | - // ------------------------------------- |
1028 | | - // 1) Initialize Materialize dropdowns |
1029 | | - // (Older Materialize 0.100.x w/ jQuery) |
1030 | | - // ------------------------------------- |
1031 | | - $('.dropdown-trigger').dropdown({ |
1032 | | - // You can add options if needed |
1033 | | - // inDuration: 300, |
1034 | | - // outDuration: 225, |
1035 | | - // hover: false, |
1036 | | - // coverTrigger: false, |
1037 | | - // alignment: 'right', |
1038 | | - }); |
1039 | | - |
1040 | | - // ------------------------------------- |
1041 | | - // 2) Play-Only Mode logic |
1042 | | - // ------------------------------------- |
1043 | | - const body = document.body; |
1044 | | - let persistentNotification = null; |
1045 | | - |
1046 | | - function showPersistentNotification() { |
1047 | | - if (!persistentNotification) { |
1048 | | - persistentNotification = document.createElement('div'); |
1049 | | - persistentNotification.id = 'persistentNotification'; |
1050 | | - persistentNotification.innerHTML = |
1051 | | - 'Play only mode enabled. For full Music Blocks experience, use a larger display.'; |
1052 | | - document.body.appendChild(persistentNotification); |
1053 | | - } |
1054 | | - } |
1055 | | - |
1056 | | - function removePersistentNotification() { |
1057 | | - if (persistentNotification) { |
1058 | | - persistentNotification.remove(); |
1059 | | - persistentNotification = null; |
1060 | | - } |
1061 | | - } |
1062 | | - |
1063 | | - function togglePlayOnlyMode() { |
1064 | | - const isSmallScreen = window.innerWidth < 768 || window.innerHeight < 600; |
1065 | | - |
1066 | | - if (isSmallScreen) { |
1067 | | - // Enable Play-Only Mode |
1068 | | - body.classList.add('play-only'); |
1069 | | - showPersistentNotification(); |
1070 | | - // Hide or disable any full aux toolbar if you want: |
1071 | | - // document.getElementById('aux-toolbar').style.display = 'none'; |
1072 | | - } else { |
1073 | | - // Disable Play-Only Mode |
1074 | | - body.classList.remove('play-only'); |
1075 | | - removePersistentNotification(); |
1076 | | - // Re-enable your normal toolbar if needed: |
1077 | | - // document.getElementById('aux-toolbar').style.display = 'block'; |
1078 | | - } |
1079 | | - } |
1080 | | - |
1081 | | - // Run once on load, and again on resize |
1082 | | - togglePlayOnlyMode(); |
1083 | | - window.addEventListener('resize', togglePlayOnlyMode); |
1084 | | - |
1085 | | - // ------------------------------------- |
1086 | | - // 3) Main menu button click |
1087 | | - // ------------------------------------- |
1088 | | - const toggleAuxBtn = document.getElementById('toggleAuxBtn'); |
1089 | | - const auxDropdown = document.getElementById('aux-dropdown'); |
1090 | | - |
1091 | | - // Optional: If you want a custom toggle on small screens only |
1092 | | - toggleAuxBtn.addEventListener('click', function(event) { |
1093 | | - const isSmallScreen = window.innerWidth < 768 || window.innerHeight < 600; |
1094 | | - |
1095 | | - if (isSmallScreen) { |
1096 | | - // Prevent the default Materialize dropdown from opening |
1097 | | - // because we want our custom "play-only" dropdown |
1098 | | - event.preventDefault(); |
1099 | | - event.stopPropagation(); |
1100 | | - |
1101 | | - // Manually toggle the #aux-dropdown |
1102 | | - auxDropdown.classList.toggle('show-dropdown'); |
1103 | | - } else { |
1104 | | - // On larger screens, let Materialize handle it |
1105 | | - // Or do something else, like open #aux-toolbar |
1106 | | - // event.preventDefault(); // remove this if you want default dropdown |
1107 | | - // ... |
1108 | | - } |
1109 | | - }); |
1110 | | - }); |
1111 | | -</script> |
1112 | | - |
| 996 | + document.addEventListener('DOMContentLoaded', function() { |
| 997 | + let persistentNotification = null; |
| 998 | + |
| 999 | + function showPersistentNotification() { |
| 1000 | + if (!persistentNotification) { |
| 1001 | + persistentNotification = document.createElement("div"); |
| 1002 | + persistentNotification.id = "persistentNotification"; |
| 1003 | + persistentNotification.innerHTML = "Play only mode enabled. For full Music Blocks experience, use a larger display."; |
| 1004 | + document.body.appendChild(persistentNotification); |
| 1005 | + } |
| 1006 | + } |
| 1007 | + |
| 1008 | + function removePersistentNotification() { |
| 1009 | + if (persistentNotification) { |
| 1010 | + persistentNotification.remove(); |
| 1011 | + persistentNotification = null; |
| 1012 | + } |
| 1013 | + } |
| 1014 | + |
| 1015 | + function hideElementById(elementId) { |
| 1016 | + const elem = document.getElementById(elementId); |
| 1017 | + if (elem) { |
| 1018 | + elem.style.display = "none"; |
| 1019 | + } |
| 1020 | + } |
| 1021 | + |
| 1022 | + function showElementById(elementId) { |
| 1023 | + const elem = document.getElementById(elementId); |
| 1024 | + if (elem) { |
| 1025 | + elem.style.display = ""; |
| 1026 | + } |
| 1027 | + } |
| 1028 | + |
| 1029 | + function togglePlayOnlyMode() { |
| 1030 | + const isSmallScreen = (window.innerWidth < 768) || (window.innerHeight < 600); |
| 1031 | + const body = document.body; |
| 1032 | + const homeButton = document.getElementById("Home [HOME]"); |
| 1033 | + const buttonContainer = document.getElementById("buttoncontainerBOTTOM"); |
| 1034 | + |
| 1035 | + if (isSmallScreen) { |
| 1036 | + // Enable play-only mode |
| 1037 | + body.classList.add("play-only"); |
| 1038 | + showPersistentNotification(); |
| 1039 | + |
| 1040 | + if (buttonContainer) { |
| 1041 | + buttonContainer.style.display = "flex"; |
| 1042 | + buttonContainer.style.justifyContent = "flex-end"; |
| 1043 | + buttonContainer.style.alignItems = "center"; |
| 1044 | + } |
| 1045 | + if (homeButton) { |
| 1046 | + homeButton.style.display = "flex"; |
| 1047 | + homeButton.style.position = "fixed"; |
| 1048 | + homeButton.style.right = "15px"; |
| 1049 | + homeButton.style.bottom = "15px"; |
| 1050 | + homeButton.style.zIndex = "10000"; |
| 1051 | + } |
| 1052 | + |
| 1053 | + // Hide certain elements |
| 1054 | + hideElementById("Show/hide blocks"); |
| 1055 | + hideElementById("Expand/collapse blocks"); |
| 1056 | + hideElementById("Decrease block size"); |
| 1057 | + hideElementById("Increase block size"); |
| 1058 | + hideElementById("grid"); |
| 1059 | + hideElementById("palette"); |
| 1060 | + |
| 1061 | + } else { |
| 1062 | + // Disable play-only mode |
| 1063 | + body.classList.remove("play-only"); |
| 1064 | + removePersistentNotification(); |
| 1065 | + |
| 1066 | + if (homeButton) homeButton.style = ""; |
| 1067 | + if (buttonContainer) buttonContainer.style = ""; |
| 1068 | + |
| 1069 | + showElementById("Show/hide blocks"); |
| 1070 | + showElementById("Expand/collapse blocks"); |
| 1071 | + showElementById("Decrease block size"); |
| 1072 | + showElementById("Increase block size"); |
| 1073 | + showElementById("grid"); |
| 1074 | + showElementById("palette"); |
| 1075 | + } |
| 1076 | + } |
| 1077 | + |
| 1078 | + togglePlayOnlyMode(); |
| 1079 | + |
| 1080 | + window.addEventListener("resize", togglePlayOnlyMode); |
| 1081 | + }); |
| 1082 | + </script> |
| 1083 | + |
1113 | 1084 | <div id="searchBar" tabindex="-1"> |
1114 | 1085 | <input |
1115 | 1086 | type="text" |
|
0 commit comments