Spaces:
Running
Running
alperugurcan
commited on
Commit
•
d3b026f
1
Parent(s):
5c2bd98
Update app.py
Browse files
app.py
CHANGED
@@ -95,6 +95,43 @@ css = """
|
|
95 |
border-collapse: separate;
|
96 |
border-spacing: 4px;
|
97 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
#board td {
|
99 |
text-align: center;
|
100 |
font-size: 28px;
|
@@ -127,11 +164,12 @@ def create_ui():
|
|
127 |
|
128 |
state = gr.State({"game_over": False})
|
129 |
|
130 |
-
#
|
131 |
with gr.Row(elem_classes="button-container"):
|
132 |
with gr.Row(elem_classes="button-row"):
|
133 |
buttons = [gr.Button(str(i), size="sm") for i in range(BOARD_SIZE[1])]
|
134 |
|
|
|
135 |
board = gr.Dataframe(
|
136 |
value=format_board(initialize_game()),
|
137 |
interactive=False,
|
@@ -140,8 +178,7 @@ def create_ui():
|
|
140 |
wrap=True,
|
141 |
elem_id="board",
|
142 |
row_count=BOARD_SIZE[0],
|
143 |
-
col_count=BOARD_SIZE[1]
|
144 |
-
max_rows=BOARD_SIZE[0]
|
145 |
)
|
146 |
|
147 |
message = gr.Textbox(value="Your turn!", label="Status")
|
|
|
95 |
border-collapse: separate;
|
96 |
border-spacing: 4px;
|
97 |
}
|
98 |
+
#board td {
|
99 |
+
text-align: center;
|
100 |
+
font-size: 28px;
|
101 |
+
padding: 8px;
|
102 |
+
width: 14.28%;
|
103 |
+
height: 40px;
|
104 |
+
vertical-align: middle;
|
105 |
+
background: #f0f0f0; /* Light background for cells */
|
106 |
+
border-radius: 4px; /* Rounded corners */
|
107 |
+
}
|
108 |
+
.button-container {
|
109 |
+
max-width: 400px;
|
110 |
+
margin: 0 auto 20px auto;
|
111 |
+
padding: 10px;
|
112 |
+
}
|
113 |
+
.button-row {
|
114 |
+
display: flex;
|
115 |
+
justify-content: space-between;
|
116 |
+
gap: 10px;
|
117 |
+
}
|
118 |
+
.button-row button {
|
119 |
+
flex: 1;
|
120 |
+
min-width: 40px;
|
121 |
+
height: 40px;
|
122 |
+
}
|
123 |
+
"""
|
124 |
+
#board {
|
125 |
+
max-width: 400px;
|
126 |
+
margin: 20px auto;
|
127 |
+
overflow: visible !important;
|
128 |
+
}
|
129 |
+
#board table {
|
130 |
+
width: 100%;
|
131 |
+
table-layout: fixed;
|
132 |
+
border-collapse: separate;
|
133 |
+
border-spacing: 4px;
|
134 |
+
}
|
135 |
#board td {
|
136 |
text-align: center;
|
137 |
font-size: 28px;
|
|
|
164 |
|
165 |
state = gr.State({"game_over": False})
|
166 |
|
167 |
+
# Button container
|
168 |
with gr.Row(elem_classes="button-container"):
|
169 |
with gr.Row(elem_classes="button-row"):
|
170 |
buttons = [gr.Button(str(i), size="sm") for i in range(BOARD_SIZE[1])]
|
171 |
|
172 |
+
# Updated Dataframe configuration
|
173 |
board = gr.Dataframe(
|
174 |
value=format_board(initialize_game()),
|
175 |
interactive=False,
|
|
|
178 |
wrap=True,
|
179 |
elem_id="board",
|
180 |
row_count=BOARD_SIZE[0],
|
181 |
+
col_count=BOARD_SIZE[1]
|
|
|
182 |
)
|
183 |
|
184 |
message = gr.Textbox(value="Your turn!", label="Status")
|