feat: abstract buttons

This commit is contained in:
Lala, Shahd
2026-05-04 09:56:09 +02:00
parent 361ce1e817
commit d471eef7af
15 changed files with 103 additions and 144 deletions
@@ -20,9 +20,10 @@
}
.promotion-dialog {
background: white;
border-radius: 8px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
background: var(--dlg-bg, white);
border: 1.5px solid var(--dlg-border, #ddd);
border-radius: 4px;
box-shadow: var(--bb-glow, 0 4px 16px rgba(0, 0, 0, 0.2));
max-width: 400px;
width: 90%;
animation: slideUp 0.3s ease;
@@ -44,32 +45,14 @@
justify-content: space-between;
align-items: center;
padding: 20px;
border-bottom: 1px solid #e0e0e0;
border-bottom: 1px solid var(--bb-border, #e0e0e0);
h3 {
margin: 0;
font-family: 'Bebas Neue', sans-serif;
font-size: 18px;
font-weight: 600;
color: #333;
}
.close-btn {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: #999;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
transition: color 0.2s;
&:hover {
color: #333;
}
color: var(--bb-title, #333);
}
}
@@ -80,7 +63,8 @@
.promotion-prompt {
margin: 0 0 20px 0;
text-align: center;
color: #666;
color: var(--bb-title);
opacity: 0.8;
font-size: 14px;
}
@@ -90,42 +74,20 @@
gap: 12px;
}
.promotion-button {
display: flex;
@import '../../button-template.css';
.promotion-choice {
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
height: auto;
padding: 16px;
background: #f5f5f5;
border: 2px solid #ddd;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
font-family: inherit;
&:hover {
background: #e8e8e8;
border-color: #999;
transform: translateY(-2px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
&:active {
transform: translateY(0);
box-shadow: none;
}
.piece-symbol {
font-size: 32px;
line-height: 1;
}
.piece-label {
font-size: 12px;
font-weight: 500;
color: #666;
text-transform: uppercase;
letter-spacing: 0.5px;
}
gap: 8px;
}
.promotion-choice .piece-symbol {
font-size: 32px;
line-height: 1;
}
.promotion-choice .piece-label {
font-size: 11px;
}
@@ -2,7 +2,7 @@
<div class="promotion-dialog">
<div class="promotion-header">
<h3>Pawn Promotion</h3>
<button class="close-btn" (click)="close()" aria-label="Close">&times;</button>
<button class="app-btn" (click)="close()" aria-label="Close" style="padding:0.2rem 0.5rem;min-width:unset;">&times;</button>
</div>
<div class="promotion-body">
@@ -11,7 +11,8 @@
<div class="promotion-options">
@for (piece of promotionPieces; track piece.type) {
<button
class="promotion-button"
type="button"
class="app-btn promotion-choice"
[attr.data-piece]="piece.type"
(click)="selectPromotion(piece.type)"
[title]="piece.label"