Surn commited on
Commit
a749bc0
·
1 Parent(s): c79e706

UI, css updates

Browse files
Files changed (1) hide show
  1. battlewords/ui.py +12 -4
battlewords/ui.py CHANGED
@@ -87,8 +87,7 @@ def inject_styles() -> None:
87
  text-align: center;
88
  }
89
  div[data-testid="stButton"] button {
90
- max-width: 100%;
91
- width: auto;
92
  aspect-ratio: 1 / 1;
93
  border-radius: 0;
94
  #border: 1px solid #1d64c8;
@@ -98,6 +97,15 @@ def inject_styles() -> None:
98
  padding: 0.25rem 0.75rem;
99
  min-height: 2.5rem;
100
  }
 
 
 
 
 
 
 
 
 
101
 
102
  /* Ensure grid cell columns expand equally for both buttons and revealed cells */
103
  div[data-testid="column"], .st-emotion-cache-zh2fnc {
@@ -332,7 +340,7 @@ def _render_sidebar():
332
  on_change=_new_game, # immediately start a new game with the selected list
333
  )
334
 
335
- if st.button("Sort Wordlist", width="content"):
336
  _sort_wordlist(st.session_state.selected_wordlist)
337
  else:
338
  st.info("No word lists found in words/ directory. Using built-in fallback.")
@@ -768,7 +776,7 @@ def run_app():
768
  left, right = st.columns([2, 2], gap="medium")
769
  with left:
770
  _render_grid(state, st.session_state.letter_map)
771
- st.button("New Game", width="content", on_click=_new_game)
772
 
773
  with right:
774
  _render_radar(state.puzzle, size=state.grid_size, r_max=1.6, max_frames=60, sinusoid_expand=False, stagger_radar=True)
 
87
  text-align: center;
88
  }
89
  div[data-testid="stButton"] button {
90
+ max-width: 100%;
 
91
  aspect-ratio: 1 / 1;
92
  border-radius: 0;
93
  #border: 1px solid #1d64c8;
 
97
  padding: 0.25rem 0.75rem;
98
  min-height: 2.5rem;
99
  }
100
+ .st-key-new_game_btn, .st-key-sort_wordlist_btn {
101
+ margin: 0 auto;
102
+ aspect-ratio: unset;
103
+ }
104
+ .st-key-new_game_btn > div[data-testid="stButton"] button, .st-key-sort_wordlist_btn > div[data-testid="stButton"] button {
105
+ aspect-ratio: unset;
106
+ text-align:center;
107
+ height: auto;
108
+ }
109
 
110
  /* Ensure grid cell columns expand equally for both buttons and revealed cells */
111
  div[data-testid="column"], .st-emotion-cache-zh2fnc {
 
340
  on_change=_new_game, # immediately start a new game with the selected list
341
  )
342
 
343
+ if st.button("Sort Wordlist", width=125, key="sort_wordlist_btn"):
344
  _sort_wordlist(st.session_state.selected_wordlist)
345
  else:
346
  st.info("No word lists found in words/ directory. Using built-in fallback.")
 
776
  left, right = st.columns([2, 2], gap="medium")
777
  with left:
778
  _render_grid(state, st.session_state.letter_map)
779
+ st.button("New Game", width=125, on_click=_new_game, key="new_game_btn")
780
 
781
  with right:
782
  _render_radar(state.puzzle, size=state.grid_size, r_max=1.6, max_frames=60, sinusoid_expand=False, stagger_radar=True)