Compare commits

..

1 commit

Author SHA1 Message Date
8010174b3f feat(design): responsive 2026-06-07 14:50:45 +02:00
3 changed files with 7 additions and 23 deletions

View file

@ -2412,7 +2412,7 @@ a:hover { text-decoration: underline; }
} }
@media (min-width: 920px) { @media (min-width: 920px) {
.controls { .controls {
width: 200px; max-width: 200px;
} }
} }

View file

@ -327,16 +327,7 @@ fn free_mode_dests_for(
if dest >= 1 && dest <= 24 { if dest >= 1 && dest <= 24 {
let d = dest as u8; let d = dest as u8;
if !opp_present(d) { if !opp_present(d) {
if d == 13 && is_white && displayed_value(board, staged, is_white, 12) < 2 { dests.push(d);
// prise de coin par puissance for white
dests.push(12)
} else if d == 12 && !is_white && displayed_value(board, staged, is_white, 13) > -2
{
// prise de coin par puissance for black
dests.push(13)
} else {
dests.push(d);
}
} }
} else if all_in_exit { } else if all_in_exit {
dests.push(0); // exit dests.push(0); // exit

View file

@ -94,22 +94,19 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView {
cmd_tx_effect cmd_tx_effect
.unbounded_send(NetCommand::Action(PlayerAction::Move(m1, m2))) .unbounded_send(NetCommand::Action(PlayerAction::Move(m1, m2)))
.ok(); .ok();
staged_moves.set(vec![]);
selected_origin.set(None);
prev_staged_len.set(0);
} else { } else {
let specific_err = rules.moves_allowed(&(vm1, vm2)).err(); let specific_err = rules.moves_allowed(&(vm1, vm2)).err();
move_error.set(Some(specific_err)); move_error.set(Some(specific_err));
// Keep staged_moves intact so pieces stay in place until Retry is clicked.
} }
} else { } else {
cmd_tx_effect cmd_tx_effect
.unbounded_send(NetCommand::Action(PlayerAction::Move(m1, m2))) .unbounded_send(NetCommand::Action(PlayerAction::Move(m1, m2)))
.ok(); .ok();
staged_moves.set(vec![]);
selected_origin.set(None);
prev_staged_len.set(0);
} }
staged_moves.set(vec![]);
selected_origin.set(None);
prev_staged_len.set(0);
} }
}); });
@ -460,11 +457,7 @@ pub fn GameScreen(state: GameUiState) -> impl IntoView {
<span class="free-mode-error-msg">{msg}</span> <span class="free-mode-error-msg">{msg}</span>
<button <button
class="btn btn-secondary" class="btn btn-secondary"
on:click=move |_| { on:click=move |_| { move_error.set(None); }
staged_moves.set(vec![]);
selected_origin.set(None);
move_error.set(None);
}
>{t!(i18n, reset_move)}</button> >{t!(i18n, reset_move)}</button>
</div> </div>
} }