Files
palina-theme/author.hbs
Sebastian Krüger c0a280bca8
All checks were successful
Deploy Theme / deploy (push) Successful in 12s
feat: implement infinite scroll on the author page
2026-02-20 17:58:40 +01:00

87 lines
5.3 KiB
Handlebars

{{!< default}}
{{#author}}
<header class="author-header relative w-full mb-12 animate-fadeInUp">
{{#if cover_image}}
<div class="w-full h-64 md:h-96 relative overflow-hidden">
<img class="w-full h-full object-cover opacity-40 grayscale hover:grayscale-0 transition-all duration-700" src="{{img_url cover_image size="xl"}}" alt="{{name}}'s cover image">
<div class="absolute inset-0 bg-gradient-to-b from-transparent to-[var(--bg-primary)]"></div>
</div>
{{/if}}
<div class="container mx-auto px-4 relative {{#if cover_image}}-mt-20 md:-mt-32{{else}}pt-12{{/if}} flex flex-col items-center">
{{#if profile_image}}
<div class="relative inline-block p-1 rounded-full bg-gradient-to-tr from-[var(--brand-primary)] to-[var(--bg-secondary)] mb-6 shadow-2xl">
<img class="w-32 h-32 md:w-48 md:h-48 rounded-full object-cover border-4 border-[var(--bg-primary)] shadow-inner" src="{{img_url profile_image size="s"}}" alt="{{name}}'s avatar">
</div>
{{/if}}
<h1 class="text-5xl md:text-7xl font-bold tracking-tighter text-[var(--text-primary)] mb-4">{{name}}</h1>
<div class="flex flex-wrap items-center justify-center gap-4 mb-6 text-[var(--text-secondary)] font-medium">
{{#if location}}
<span class="flex items-center">
<svg class="w-4 h-4 mr-1 text-[var(--brand-primary)]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
{{location}}
</span>
{{/if}}
{{#if website}}
<a href="{{website}}" target="_blank" rel="noopener" class="fancy-link flex items-center">
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"/></svg>
Website
</a>
{{/if}}
{{#if twitter}}
<a href="{{twitter_url}}" target="_blank" rel="noopener" class="fancy-link flex items-center">
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 24 24"><path d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.84 4.996 4.904 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"/></svg>
Twitter
</a>
{{/if}}
{{#if facebook}}
<a href="{{facebook_url}}" target="_blank" rel="noopener" class="fancy-link flex items-center">
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 24 24"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>
Facebook
</a>
{{/if}}
</div>
{{#if bio}}
<p class="text-xl md:text-2xl text-[var(--text-secondary)] text-center max-w-2xl font-serif italic italic leading-relaxed opacity-90 mb-8">
{{bio}}
</p>
{{/if}}
<div class="flex items-center text-sm font-medium uppercase tracking-[0.2em] text-[var(--text-tertiary)]">
<span class="inline-block w-8 h-px bg-[var(--bg-tertiary)] mr-4"></span>
{{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}}
<span class="inline-block w-8 h-px bg-[var(--bg-tertiary)] ml-4"></span>
</div>
</div>
</header>
{{/author}}
<div class="container mx-auto px-4 pb-20">
<div id="posts-container" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-10">
{{#foreach posts}}
{{> "post-card"}}
{{/foreach}}
{{#if pagination.next}}
<div id="pagination-trigger"
hx-get="{{page_url pagination.next}}"
hx-trigger="revealed"
hx-select="#posts-container > *"
hx-target="this"
hx-swap="outerHTML"
hx-indicator="#loading-spinner"
class="col-span-full h-1">
</div>
{{/if}}
</div>
<div id="loading-spinner" class="htmx-indicator text-center py-12">
<div class="inline-block animate-spin rounded-full h-10 w-10 border-4 border-[var(--brand-primary)] border-t-transparent"></div>
<p class="text-[var(--text-secondary)] mt-4 font-medium tracking-wide">Loading more posts...</p>
</div>
</div>