7676 color : red;
7777 font-family : monospace;
7878 }
79- # themeToggle {
80- position : absolute;
81- top : 10px ;
82- right : 10px ;
83- z-index : 1000 ;
84- background : # eee ;
85- border : 1px solid # 999 ;
86- border-radius : 4px ;
87- padding : 5px 10px ;
79+ # settingsPanel {
80+ display : none;
81+ justify-content : center;
82+ gap : 10px ;
83+ margin : 10px ;
8884 }
8985 # loopControls {
9086 display : flex;
9894 </ style >
9995</ head >
10096< body >
101- < button id ="themeToggle "> 🎨 Toggle Theme</ button >
97+
98+ <!-- Header and Settings Button -->
10299 < div style ="display: flex; justify-content: center; align-items: center; gap: 15px; margin: 10px; ">
103100 < h2 style ="margin: 0; "> Blockly JavaScript Builder</ h2 >
101+ < button id ="settingsButton "> ⚙️ Settings</ button >
102+ </ div >
103+
104+ <!-- Settings Panel -->
105+ < div id ="settingsPanel ">
106+ < button id ="themeToggle "> 🎨 Toggle Theme</ button >
104107 < button onclick ="saveWorkspace() "> 💾 Save</ button >
105108 < label for ="loadFile "> 📂 Load</ label >
106109 < input type ="file " id ="loadFile " accept =".xml " style ="display: none; " />
@@ -130,7 +133,7 @@ <h4 style="margin: 0;">📄 JavaScript Code</h4>
130133 </ div >
131134 </ div >
132135
133- <!-- ✅ TOOLBOX WITH ENHANCED LOOP CATEGORY -->
136+ <!-- Toolbox -->
134137 < xml id ="toolbox " style ="display: none ">
135138 < category name ="Logic " colour ="%{BKY_LOGIC_HUE} ">
136139 < block type ="controls_if "> </ block >
@@ -169,8 +172,6 @@ <h4 style="margin: 0;">📄 JavaScript Code</h4>
169172 < block type ="text_isEmpty "> </ block >
170173 < block type ="text_join "> </ block >
171174 </ category >
172-
173- <!-- 🔁 Enhanced Loop Category -->
174175 < category name ="Loops " colour ="%{BKY_LOOPS_HUE} ">
175176 < block type ="controls_repeat_ext ">
176177 < value name ="TIMES ">
@@ -183,7 +184,6 @@ <h4 style="margin: 0;">📄 JavaScript Code</h4>
183184 < field name ="MODE "> WHILE</ field >
184185 </ block >
185186 </ category >
186-
187187 < category name ="Variables " custom ="VARIABLE " colour ="%{BKY_VARIABLES_HUE} "> </ category >
188188 < category name ="Functions " custom ="PROCEDURE " colour ="%{BKY_PROCEDURES_HUE} "> </ category >
189189 </ xml >
@@ -244,6 +244,11 @@ <h4 style="margin: 0;">📄 JavaScript Code</h4>
244244 }
245245 } ) ;
246246
247+ document . getElementById ( 'settingsButton' ) . addEventListener ( 'click' , ( ) => {
248+ const panel = document . getElementById ( 'settingsPanel' ) ;
249+ panel . style . display = panel . style . display === 'none' ? 'flex' : 'none' ;
250+ } ) ;
251+
247252 function updateCode ( ) {
248253 const code = Blockly . JavaScript . workspaceToCode ( workspace ) ;
249254 document . getElementById ( 'code' ) . textContent = code ;
0 commit comments