@@ -87,7 +87,7 @@ export default function TwoZeroFourEight() {
8787 const handleTouchStart = ( e ) => {
8888 touchStartX = e . changedTouches [ 0 ] . screenX ;
8989 touchStartY = e . changedTouches [ 0 ] . screenY ;
90-
90+
9191 // Check if touch started on game board
9292 const target = e . target ;
9393 isGameBoardTouch = target . closest ( '.game-board-area' ) !== null ;
@@ -102,7 +102,7 @@ export default function TwoZeroFourEight() {
102102
103103 const handleTouchEnd = ( e ) => {
104104 if ( ! isGameBoardTouch ) return ; // Only handle swipes that started on game board
105-
105+
106106 touchEndX = e . changedTouches [ 0 ] . screenX ;
107107 touchEndY = e . changedTouches [ 0 ] . screenY ;
108108 handleSwipe ( ) ;
@@ -316,7 +316,7 @@ export default function TwoZeroFourEight() {
316316 { [ "maximizeScore" , "maximizeMerges" , "clusterTiles" , "monotonicity" , "expectiMax" , "neuralNet" , "pythonQ" ] . map ( model => (
317317 < button
318318 key = { model }
319- className = { `px-2 py-1 rounded ${ aiModel === model ? "bg-blue-600 text-white" : "bg-gray-200" } ` }
319+ className = { `px-2 py-1 ${ aiModel === model ? "bg-blue-600 text-white" : "bg-gray-700/30" } backdrop-blur-sm flex flex-wrap gap-2 justify-center rounded ` }
320320 onClick = { ( ) => {
321321 setAiModel ( model ) ;
322322 if ( model === "expectiMax" ) {
@@ -346,10 +346,10 @@ export default function TwoZeroFourEight() {
346346 < div className = "glassmorphic p-4" >
347347 < h3 className = "font-semibold mb-2" > ExpectiMax</ h3 >
348348 < div className = "flex flex-col gap-2" >
349- < label className = "text-sm" > ExpectiMax Depth</ label >
349+ < label className = "text-sm " > ExpectiMax Depth</ label >
350350 < input
351351 type = "number"
352- className = "border rounded p-1"
352+ className = "border rounded p-1 ml-2 text-black "
353353 value = { expectiMaxDepth }
354354 onChange = { ( e ) => setExpectiMaxDepth ( parseInt ( e . target . value ) ) }
355355 />
@@ -360,7 +360,7 @@ export default function TwoZeroFourEight() {
360360 < input
361361 type = "number"
362362 step = "0.1"
363- className = "border rounded p-1 ml-2"
363+ className = "text-black border rounded p-1 ml-2"
364364 value = { value }
365365 onChange = { ( e ) => {
366366 saveExpectiMaxWeights ( { ...expectiMaxWeights , [ key ] : parseFloat ( e . target . value ) } ) ;
@@ -393,65 +393,70 @@ export default function TwoZeroFourEight() {
393393 </ div >
394394
395395 { /* Mobile Layout - Hidden on desktop */ }
396- < div className = "md:hidden px-4 pb-4" >
397- { /* Stats at top on mobile */ }
398- < div className = "bg-white rounded-lg shadow-md p-4 mb-4" >
396+ < div className = "md:hidden px-4 pb-4 space-y-4" >
397+
398+ { /* Stats Panel */ }
399+ < div className = "glassmorphic p-4 border border-white/30 text-white" >
399400 < div className = "flex justify-between items-center" >
400401 < div >
401402 < p className = "text-sm" > Score: < span className = "font-semibold" > { score } </ span > </ p >
402403 < p className = "text-sm" > Moves: < span className = "font-semibold" > { moves } </ span > </ p >
403404 { isGameOver && < p className = "text-red-500 font-bold text-sm" > Game Over!</ p > }
404405 </ div >
405- < button onClick = { handleRestart } className = "px-3 py-1 bg-blue-500 text-white rounded hover:bg-blue-600" >
406+ < button
407+ onClick = { handleRestart }
408+ className = "px-3 py-1 bg-blue-500 text-white rounded hover:bg-blue-600"
409+ >
406410 Restart
407411 </ button >
408412 </ div >
409413 </ div >
410414
411- { /* Game board centered */ }
412- < div className = "flex justify-center mb-4 " >
413- < div className = "select-none game-board-area touch-none" > { /* Prevent text selection and default touch behaviors */ }
415+ { /* Game Board */ }
416+ < div className = "flex justify-center" >
417+ < div className = "select-none game-board-area touch-none" >
414418 < GameBoard board = { board } />
415419 </ div >
416420 </ div >
417421
418- { /* Controls below board */ }
419- < div className = "bg-white rounded-lg shadow-md p-4 mb-4 " >
422+ { /* Controls Panel */ }
423+ < div className = "glassmorphic p-4 border border-white/30 text-white flex flex-col gap-2 " >
420424 < h2 className = "font-bold mb-2" > Controls</ h2 >
421- < div className = "flex gap-2" >
422- < button
423- onClick = { handleAi }
424- className = "flex-1 px-3 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 text-sm"
425- >
426- Next AI Move
427- </ button >
428- < button
429- onClick = { ( ) => {
430- if ( isGameOver ) handleRestart ( ) ;
431- setIsAiRunning ( ! isAiRunning ) ;
432- } }
433- className = { `flex-1 px-3 py-2 text-sm ${ isAiRunning ? "bg-red-500 hover:bg-red-600" : "bg-green-500 hover:bg-green-600" } text-white rounded` }
434- >
435- { isAiRunning ? "Stop AI" : "Start AI" }
436- </ button >
437- </ div >
425+ < button
426+ onClick = { handleAi }
427+ className = "px-3 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 w-full text-sm"
428+ >
429+ Next AI Move
430+ </ button >
431+ < button
432+ onClick = { ( ) => {
433+ if ( isGameOver ) handleRestart ( ) ;
434+ setIsAiRunning ( ! isAiRunning ) ;
435+ } }
436+ className = { `px-3 py-2 w-full text-sm rounded text-white ${ isAiRunning ? "bg-red-500 hover:bg-red-600" : "bg-green-500 hover:bg-green-600"
437+ } `}
438+ >
439+ { isAiRunning ? "Stop AI" : "Start AI" }
440+ </ button >
438441 </ div >
439442
440- { /* AI Model Selector - Collapsible on mobile */ }
441- < div className = "bg-white rounded-lg shadow-md p-4 mb-4" >
442- < h3 className = "font-semibold mb-2 cursor-pointer select-none flex justify-between items-center"
443+ { /* AI Model Selector */ }
444+ < div className = "glassmorphic p-4 border border-white/30 text-white" >
445+ < h3
446+ className = "font-semibold mb-2 cursor-pointer select-none flex justify-between items-center"
443447 onClick = { ( ) => setIsHeuristicModelSelectorOpen ( ! isHeuristicModelSelectorOpen ) }
444448 >
445449 < span > AI Models</ span >
446450 < span > { isHeuristicModelSelectorOpen ? "−" : "+" } </ span >
447451 </ h3 >
448452
449453 { isHeuristicModelSelectorOpen && (
450- < div className = "grid grid-cols-2 gap-2" >
454+ < div className = "flex flex-col gap-2" >
451455 { [ "maximizeScore" , "maximizeMerges" , "clusterTiles" , "monotonicity" , "expectiMax" , "neuralNet" , "pythonQ" ] . map ( model => (
452456 < button
453457 key = { model }
454- className = { `px-2 py-1 rounded text-xs ${ aiModel === model ? "bg-blue-600 text-white" : "bg-gray-200" } ` }
458+ className = { `px-2 py-1 rounded text-sm w-full ${ aiModel === model ? "bg-blue-600 text-white" : "bg-gray-700/30"
459+ } backdrop-blur-sm flex justify-center`}
455460 onClick = { ( ) => {
456461 setAiModel ( model ) ;
457462 if ( model === "expectiMax" ) {
@@ -464,41 +469,42 @@ export default function TwoZeroFourEight() {
464469 }
465470 } }
466471 >
467- { model === "maximizeScore" ? "Max Score" :
468- model === "maximizeMerges" ? "Max Merges" :
469- model === "clusterTiles" ? "Cluster" :
470- model === "monotonicity" ? "Monotonic " :
472+ { model === "maximizeScore" ? "Maximize Score" :
473+ model === "maximizeMerges" ? "Maximize Merges" :
474+ model === "clusterTiles" ? "Cluster Tiles " :
475+ model === "monotonicity" ? "Monotonicity " :
471476 model === "expectiMax" ? "ExpectiMax" :
472- model === "neuralNet" ? "Neural Net " :
473- "Q- Learning" }
477+ model === "neuralNet" ? "Neural Network " :
478+ "Q Learning" }
474479 </ button >
475480 ) ) }
476481 </ div >
477482 ) }
478483 </ div >
479484
480- { /* ExpectiMax Weights - Show on mobile when ExpectiMax is selected */ }
485+ { /* ExpectiMax Weights */ }
481486 { ( aiModel === "expectiMax" || aiModel === "pythonQ" ) && (
482- < div className = "bg- white rounded-lg shadow-md p-4 " >
487+ < div className = "glassmorphic p-4 border border- white/30 text-white flex flex-col gap-2 " >
483488 < h3 className = "font-semibold mb-2" > ExpectiMax Settings</ h3 >
484- < div className = "space-y-3" >
485- < div >
486- < label className = "text-sm block mb-1" > Depth</ label >
489+
490+ < div className = "flex flex-col gap-2" >
491+ < div className = "flex flex-col" >
492+ < label className = "text-sm mb-1" > Depth</ label >
487493 < input
488494 type = "number"
489- className = "border rounded p-2 w-full"
495+ className = "border rounded p-2 w-full text-black "
490496 value = { expectiMaxDepth }
491497 onChange = { ( e ) => setExpectiMaxDepth ( parseInt ( e . target . value ) ) }
492498 />
493499 </ div >
494500
495501 { Object . entries ( expectiMaxWeights ) . map ( ( [ key , value ] ) => (
496- < div key = { key } >
497- < label className = "text-sm capitalize block mb-1" > { key } Weight</ label >
502+ < div key = { key } className = "flex flex-col" >
503+ < label className = "text-sm mb-1 capitalize " > { key } Weight</ label >
498504 < input
499505 type = "number"
500506 step = "0.1"
501- className = "border rounded p-2 w-full"
507+ className = "border rounded p-2 w-full text-black "
502508 value = { value }
503509 onChange = { ( e ) => {
504510 saveExpectiMaxWeights ( { ...expectiMaxWeights , [ key ] : parseFloat ( e . target . value ) } ) ;
0 commit comments