feat(web): WelcomePage landing component
Add the public landing page: a static Charm-box tapir mascot (reusing the shared tapirLine helpers and charm palette), a tagline, and a single 'Get Started' CTA into the shared Dex flow — sign-in and sign-up are the same URL (ADR-012). Logged-in visitors get a greeting plus links back into the app and to log out. Regenerated views_templ.go committed alongside. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,40 @@ templ Layout(title string) {
|
||||
</html>
|
||||
}
|
||||
|
||||
// WelcomePage is the public landing page (served at /welcome, outside the auth
|
||||
// guard — ADR-012). Logged out: the tapir mascot, a one-line tagline, and a
|
||||
// single "Get Started" CTA into the shared Dex flow (sign-in and sign-up are the
|
||||
// same URL). Logged in: a greeting plus links back into the app and to log out.
|
||||
templ WelcomePage(user User, loggedIn bool) {
|
||||
@Layout("Tapir — Watch less, know more") {
|
||||
<section class="welcome">
|
||||
<div class="welcome-hero">
|
||||
<pre aria-hidden="true">@templ.Raw(welcomeHero)</pre>
|
||||
</div>
|
||||
if loggedIn {
|
||||
<h1 class="welcome-title">Welcome back</h1>
|
||||
if user.Email != "" {
|
||||
<p class="welcome-tagline">Signed in as { user.Email }.</p>
|
||||
}
|
||||
<div class="welcome-cta">
|
||||
<a class="btn btn-lg" href="/">Go to my Tapir</a>
|
||||
<a class="btn-secondary" href="/auth/logout">Log Out</a>
|
||||
</div>
|
||||
} else {
|
||||
<h1 class="welcome-title">Watch less, know more</h1>
|
||||
<p class="welcome-tagline">
|
||||
Tapir summarizes the videos your subscriptions publish, so you can
|
||||
skim the gist and decide what is worth your time.
|
||||
</p>
|
||||
<div class="welcome-cta">
|
||||
<a class="btn btn-lg" href="/auth/login">Get Started</a>
|
||||
</div>
|
||||
<p class="welcome-sub">Already have an account? You'll go straight through.</p>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
}
|
||||
|
||||
// flashBanner renders a one-shot notification for a flash code (connect success/
|
||||
// failure, disconnect, delete, registration). An empty or unknown code renders
|
||||
// nothing, so it is safe to drop into any page unconditionally. Reused across the
|
||||
|
||||
Reference in New Issue
Block a user