Kaushik Rajan commited on
Commit
feb1933
·
1 Parent(s): a530f7b

Fix tic-tac-toe grid layout using flexbox and direct button targeting

Browse files
Files changed (1) hide show
  1. app.py +31 -11
app.py CHANGED
@@ -106,23 +106,43 @@ def create_interface():
106
  # Custom CSS to style the TicTacToe board
107
  css = """
108
  .ttt-board {
 
 
 
109
  max-width: 300px;
110
- margin: auto;
111
  }
112
- .ttt-board .gr-button {
113
- aspect-ratio: 1 / 1;
114
- font-size: 24px !important;
115
- font-weight: bold;
 
 
 
 
 
116
  height: 80px !important;
117
  min-width: 80px !important;
118
- margin: 2px !important;
 
 
 
 
 
 
 
 
 
 
 
119
  }
120
- .ttt-board .gr-row {
121
- justify-content: center;
122
- gap: 0px;
123
  }
124
- .ttt-board .gr-column {
125
- align-items: center;
 
126
  }
127
  """
128
 
 
106
  # Custom CSS to style the TicTacToe board
107
  css = """
108
  .ttt-board {
109
+ display: flex;
110
+ flex-direction: column;
111
+ align-items: center;
112
  max-width: 300px;
113
+ margin: 0 auto;
114
  }
115
+ .ttt-board > div {
116
+ display: flex;
117
+ flex-direction: row;
118
+ justify-content: center;
119
+ gap: 8px;
120
+ margin: 4px 0;
121
+ }
122
+ .ttt-board button {
123
+ width: 80px !important;
124
  height: 80px !important;
125
  min-width: 80px !important;
126
+ min-height: 80px !important;
127
+ max-width: 80px !important;
128
+ max-height: 80px !important;
129
+ font-size: 24px !important;
130
+ font-weight: bold !important;
131
+ border: 2px solid #374151 !important;
132
+ border-radius: 8px !important;
133
+ background: #1f2937 !important;
134
+ color: white !important;
135
+ display: flex !important;
136
+ align-items: center !important;
137
+ justify-content: center !important;
138
  }
139
+ .ttt-board button:hover {
140
+ background: #374151 !important;
141
+ border-color: #6b7280 !important;
142
  }
143
+ .ttt-board button:disabled {
144
+ opacity: 0.8 !important;
145
+ cursor: not-allowed !important;
146
  }
147
  """
148