diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-22 15:08:37 +0300 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2025-07-22 15:08:37 +0300 |
| commit | fcc2f4704e39b0e69b377cc138f75027721dac22 (patch) | |
| tree | 732fc94b354a26c08fba9cc9059f9c6c900182be /src/components/widgets/CallToActionImage.astro | |
Initial template
Diffstat (limited to 'src/components/widgets/CallToActionImage.astro')
| -rw-r--r-- | src/components/widgets/CallToActionImage.astro | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/components/widgets/CallToActionImage.astro b/src/components/widgets/CallToActionImage.astro new file mode 100644 index 0000000..df13145 --- /dev/null +++ b/src/components/widgets/CallToActionImage.astro @@ -0,0 +1,73 @@ +--- +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import type { Widget } from '~/types'; +import Headline from '~/components/ui/Headline.astro'; +import Image from '~/components/common/Image.astro'; + +interface Props extends Widget { + title?: string; + subtitle?: string; + tagline?: string; + image?: { + src: string; + alt: string; + href?: string; + target?: string; + }; +} + +const { + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), + tagline = await Astro.slots.render('tagline'), + image, + + id, + isDark = false, + classes = {}, + bg = await Astro.slots.render('bg'), +} = Astro.props; +--- + +<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-6xl mx-auto ${classes?.container ?? ''}`} bg={bg}> + <div + class="max-w-3xl mx-auto text-center p-6 rounded-md shadow-xl dark:shadow-none dark:border dark:border-slate-600" + > + <Headline + title={title} + subtitle={subtitle} + tagline={tagline} + classes={{ + container: 'mb-0 md:mb-0', + title: 'text-4xl md:text-4xl font-bold tracking-tighter mb-4 font-heading', + subtitle: 'text-xl text-muted dark:text-slate-400', + }} + /> + { + image && ( + <div class="flex justify-center mt-6 px-4"> + {image.href ? ( + <a + href={image.href} + target={image.target || '_self'} + rel={image.target === '_blank' ? 'noopener noreferrer' : ''} + class="inline-block hover:opacity-80 transition-opacity duration-200" + > + <Image + src={image.src} + alt={image.alt} + class="max-h-20 h-auto w-auto max-w-full object-contain" + /> + </a> + ) : ( + <Image + src={image.src} + alt={image.alt} + class="max-h-20 h-auto w-auto max-w-full object-contain" + /> + )} + </div> + ) + } + </div> +</WidgetWrapper>
\ No newline at end of file |
