mirror of
https://github.com/pupperpowell/bibdle.git
synced 2026-06-25 08:45:22 -04:00
feat: improve guesses collapse timing, win screen CTA, and progress page polish
- GuessesTable now accepts a `minimized` prop instead of deriving collapse from `isWon`, giving the parent control over timing - Delay collapsing guesses grid until win animations complete (1800ms), skipped for already-completed puzzles - Replace plain progress link on win screen with a styled green button matching other CTAs - Progress page: remove redundant subtitle and nav button from header, add book status legend, add axis labels to guess history chart Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,13 +5,17 @@
|
||||
let {
|
||||
guesses,
|
||||
correctBookId,
|
||||
isWon = false,
|
||||
}: { guesses: Guess[]; correctBookId: string; isWon?: boolean } = $props();
|
||||
minimized = false,
|
||||
}: { guesses: Guess[]; correctBookId: string; minimized?: boolean } = $props();
|
||||
|
||||
let hasGuesses = $derived(guesses.length > 0);
|
||||
let showMinimized = $derived(isWon && guesses.length > 3);
|
||||
let showMinimized = $derived(minimized);
|
||||
let expanded = $state(false);
|
||||
|
||||
$effect(() => {
|
||||
if (!minimized) expanded = false;
|
||||
});
|
||||
|
||||
function getBoxColor(isCorrect: boolean, isAdjacent?: boolean): string {
|
||||
if (isCorrect) return "bg-green-500 border-green-600";
|
||||
if (isAdjacent) return "bg-yellow-500 border-yellow-600";
|
||||
|
||||
@@ -330,12 +330,9 @@
|
||||
{/if}
|
||||
|
||||
{#if isLoggedIn}
|
||||
<a
|
||||
href="/progress"
|
||||
class="text-sm text-center text-gray-500 dark:text-gray-400 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors"
|
||||
>
|
||||
View your progress →
|
||||
</a>
|
||||
<div class="signin-prompt">
|
||||
<a href="/progress" class="progress-btn"> 📈 See your progress </a>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="signin-prompt">
|
||||
<p class="signin-text">
|
||||
@@ -712,4 +709,43 @@
|
||||
height: 1.1rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.progress-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.6rem 1rem;
|
||||
width: 100%;
|
||||
margin-bottom: 0.6rem;
|
||||
background: #059669;
|
||||
color: #fff;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
transition:
|
||||
background 150ms ease,
|
||||
transform 80ms ease;
|
||||
}
|
||||
.progress-btn:hover {
|
||||
background: #047857;
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
.progress-btn:active {
|
||||
background: #065f46;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.progress-btn {
|
||||
background: #10b981;
|
||||
color: #fff;
|
||||
}
|
||||
.progress-btn:hover {
|
||||
background: #059669;
|
||||
}
|
||||
.progress-btn:active {
|
||||
background: #047857;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user