added step wise solution and an animation.
This commit is contained in:
@@ -44,6 +44,12 @@ body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#statusMessage {
|
||||
min-height: 24px;
|
||||
margin: 0 0 8px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.board {
|
||||
overflow-x: auto;
|
||||
padding-bottom: 8px;
|
||||
@@ -91,6 +97,21 @@ body {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.cell.solver-place {
|
||||
box-shadow: inset 0 0 0 4px #22c55e;
|
||||
animation: solverPulse 0.35s ease;
|
||||
}
|
||||
|
||||
.cell.solver-remove {
|
||||
box-shadow: inset 0 0 0 4px #f59e0b;
|
||||
animation: solverPulse 0.35s ease;
|
||||
}
|
||||
|
||||
.cell.solver-solution {
|
||||
box-shadow: inset 0 0 0 4px #2563eb;
|
||||
animation: solverPulse 0.35s ease;
|
||||
}
|
||||
|
||||
.white {
|
||||
background: #e2e8f0;
|
||||
}
|
||||
@@ -107,6 +128,10 @@ body {
|
||||
/* 🎛️ Buttons */
|
||||
.controls {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
@@ -123,6 +148,12 @@ body {
|
||||
background: #2563eb;
|
||||
}
|
||||
|
||||
.btn:disabled,
|
||||
.btn:disabled:hover {
|
||||
background: #94a3b8;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn.secondary {
|
||||
background: #64748b;
|
||||
}
|
||||
@@ -163,6 +194,79 @@ body {
|
||||
background: #22c55e;
|
||||
}
|
||||
|
||||
.solver-panel {
|
||||
margin-top: 12px;
|
||||
padding: 16px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #dbe4ee;
|
||||
background: #f8fafc;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.solver-panel-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.solver-panel h3 {
|
||||
margin: 0 0 6px;
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
.solver-message {
|
||||
margin: 0;
|
||||
color: #475569;
|
||||
}
|
||||
|
||||
.solver-step-info {
|
||||
margin: 0;
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
background: #dbeafe;
|
||||
color: #1d4ed8;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.solver-controls {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.solver-controls .btn,
|
||||
.controls .btn {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.solver-speed {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.solver-speed input[type="range"] {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.solver-speed-label {
|
||||
font-weight: bold;
|
||||
color: #334155;
|
||||
}
|
||||
|
||||
.solver-speed-value {
|
||||
min-width: 62px;
|
||||
text-align: right;
|
||||
color: #475569;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.board-size-info {
|
||||
margin: 0 0 10px;
|
||||
color: #475569;
|
||||
@@ -175,10 +279,14 @@ body {
|
||||
width: min(320px, 85vw);
|
||||
height: 100vh;
|
||||
padding: 24px;
|
||||
box-sizing: border-box;
|
||||
background: white;
|
||||
box-shadow: -10px 0 24px rgba(15, 23, 42, 0.18);
|
||||
transform: translateX(100%);
|
||||
transition: transform 0.25s ease;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overscroll-behavior: contain;
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
@@ -329,6 +437,20 @@ body {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
@keyframes solverPulse {
|
||||
0% {
|
||||
transform: scale(0.97);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(1.03);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.container {
|
||||
padding: 12px;
|
||||
@@ -337,4 +459,15 @@ body {
|
||||
.navbar {
|
||||
padding: 15px 18px;
|
||||
}
|
||||
|
||||
.solver-panel-header,
|
||||
.solver-speed {
|
||||
grid-template-columns: 1fr;
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.solver-step-info,
|
||||
.solver-speed-value {
|
||||
justify-self: start;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user