Added umami event to Apple signin and fixed spacing

This commit is contained in:
George Powell
2026-03-14 18:40:57 -04:00
parent ae4482a551
commit 1eb8eb2f04
2 changed files with 20 additions and 7 deletions

View File

@@ -96,6 +96,7 @@
<button
type="submit"
class="w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-white text-black rounded-md hover:bg-gray-100 transition-colors font-medium"
data-umami-event="Sign in with Apple"
>
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
<path d="M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/>

View File

@@ -40,7 +40,7 @@
streak = 0,
streakPercentile = null,
isLoggedIn = false,
anonymousId = '',
anonymousId = "",
}: {
statsData: StatsData | null;
correctBookId: string;
@@ -326,15 +326,24 @@
{#if !isLoggedIn}
<div class="signin-prompt">
<p class="signin-text">Sign in to save your streak &amp; see your stats</p>
<p class="signin-text">
Sign in to save your streak &amp; track your progress
</p>
<form method="POST" action="/auth/apple">
<input type="hidden" name="anonymousId" value={anonymousId} />
<button
type="submit"
class="apple-signin-btn"
data-umami-event="Sign in with Apple"
>
<svg class="apple-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/>
<svg
class="apple-icon"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"
/>
</svg>
Sign in with Apple
</button>
@@ -627,7 +636,7 @@
flex-direction: column;
align-items: center;
gap: 0.75rem;
padding: 1rem 0 0.25rem;
/*padding: 1rem 0 0.25rem;*/
}
.signin-text {
@@ -648,7 +657,8 @@
align-items: center;
justify-content: center;
gap: 0.5rem;
padding: 0.6rem 1.5rem;
padding: 0.6rem 4rem;
margin-bottom: 0.6rem;
background: #000;
color: #fff;
border-radius: 0.5rem;
@@ -656,7 +666,9 @@
font-weight: 600;
border: none;
cursor: pointer;
transition: background 150ms ease, transform 80ms ease;
transition:
background 150ms ease,
transform 80ms ease;
}
.apple-signin-btn:hover {