Spaces:
Build error
Build error
Kaushik Rajan
commited on
Commit
·
feb1933
1
Parent(s):
a530f7b
Fix tic-tac-toe grid layout using flexbox and direct button targeting
Browse files
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
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
height: 80px !important;
|
| 117 |
min-width: 80px !important;
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
}
|
| 120 |
-
.ttt-board
|
| 121 |
-
|
| 122 |
-
|
| 123 |
}
|
| 124 |
-
.ttt-board
|
| 125 |
-
|
|
|
|
| 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 |
|