forked from cms/tibi-svelte-starter
✨ feat: enhance HeroBlock with SPA navigation for anchor links and update feature card styles
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { reveal } from "../lib/actions/reveal"
|
||||
import { spaLink } from "../lib/navigation"
|
||||
|
||||
let { block }: { block: ContentBlockEntry } = $props()
|
||||
|
||||
const hasImage = $derived(block.heroImage?.externalUrl || block.heroImage?.image)
|
||||
const isAnchorLink = $derived(block.callToAction?.buttonLink?.startsWith("#"))
|
||||
</script>
|
||||
|
||||
<section
|
||||
@@ -53,6 +55,7 @@
|
||||
<a
|
||||
href={block.callToAction.buttonLink || "#"}
|
||||
target={block.callToAction.buttonTarget || undefined}
|
||||
use:spaLink={{ noScroll: isAnchorLink }}
|
||||
class="inline-flex items-center gap-2 bg-brand-500 hover:bg-brand-400 text-white font-bold px-8 py-4 rounded-xl text-lg transition-all duration-300 hover:shadow-lg hover:shadow-brand-500/25 hover:-translate-y-0.5"
|
||||
>
|
||||
{block.callToAction.buttonText}
|
||||
|
||||
Reference in New Issue
Block a user