Merge pull request #206 from widgeter/main

Add a Features3 widget
This commit is contained in:
André B
2023-08-04 20:53:36 -04:00
committed by GitHub
4 changed files with 99 additions and 3 deletions

View File

@ -25,13 +25,17 @@ const {
--- ---
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-6xl mx-auto ${classes?.container ?? ''}`} bg={bg}> <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"> <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 <Headline
title={title} title={title}
subtitle={subtitle} subtitle={subtitle}
tagline={tagline} tagline={tagline}
classes={{ classes={{
container: 'mb-0 md:mb-0 dark:shadow-none dark:border dark:border-slate-600', container: 'mb-0 md:mb-0',
title: 'text-4xl md:text-4xl font-bold leading-tighter tracking-tighter mb-4 font-heading',
subtitle: 'text-xl text-muted dark:text-slate-400',
}} }}
/> />
{ {

View File

@ -0,0 +1,40 @@
---
import Headline from '~/components/ui/Headline.astro';
import ItemGrid from '~/components/ui/ItemGrid.astro';
import WidgetWrapper from '~/components/ui/WidgetWrapper.astro';
import type { Features } from '~/types';
const {
title = await Astro.slots.render('title'),
subtitle = await Astro.slots.render('subtitle'),
tagline = await Astro.slots.render('tagline'),
image,
items = [],
columns,
id,
isDark = false,
classes = {},
bg = await Astro.slots.render('bg'),
} = Astro.props as Features;
---
<WidgetWrapper id={id} isDark={isDark} containerClass={classes?.container} bg={bg}>
<Headline title={title} subtitle={subtitle} tagline={tagline} classes={classes?.headline} />
<div class="aspect-w-16 aspect-h-7">
{image && image.src && <img src={image.src} alt={image.alt || ''} class="w-full h-80 object-cover rounded-xl" />}
</div>
<ItemGrid
items={items}
columns={columns}
classes={{
container: 'mt-5 lg:mt-16',
panel: 'max-w-full sm:max-w-md',
title: 'text-lg font-semibold',
icon: 'flex-shrink-0 mt-1 text-primary w-6 h-6',
...((classes?.items as {}) ?? {}),
}}
/>
</WidgetWrapper>

View File

@ -9,6 +9,7 @@ import { headerData } from '~/navigation';
import Features2 from '~/components/widgets/Features2.astro'; import Features2 from '~/components/widgets/Features2.astro';
import Features from '~/components/widgets/Features.astro'; import Features from '~/components/widgets/Features.astro';
import Stats from '~/components/widgets/Stats.astro'; import Stats from '~/components/widgets/Stats.astro';
import Features3 from '~/components/widgets/Features3.astro';
const metadata = { const metadata = {
title: 'Startup Landing Page', title: 'Startup Landing Page',
@ -142,6 +143,7 @@ const metadata = {
<CallToAction <CallToAction
callToAction={{ callToAction={{
targetBlank: true,
text: 'Get template', text: 'Get template',
href: 'https://github.com/onwidget/astrowind', href: 'https://github.com/onwidget/astrowind',
icon: 'tabler:download', icon: 'tabler:download',
@ -156,4 +158,54 @@ const metadata = {
waste more time! :P waste more time! :P
</Fragment> </Fragment>
</CallToAction> </CallToAction>
<!-- Features3 Widget ************** -->
<Features3
title="Let us know how we can help"
subtitle="Were here to help and answer any question you might have."
columns={4}
items={[
{
title: 'Phone',
icon: 'tabler:phone',
callToAction: {
targetBlank: true,
text: 'Call us',
href: '/',
},
},
{
title: 'Email',
icon: 'tabler:mail',
callToAction: {
targetBlank: true,
text: 'Write to us',
href: '/',
},
},
{
title: 'Chat with sales',
icon: 'tabler:message-circle',
callToAction: {
targetBlank: true,
text: 'Start chatting',
href: '/',
},
},
{
title: 'Chat with support',
icon: 'tabler:message-circle',
callToAction: {
targetBlank: true,
text: 'Start chatting',
href: '/',
},
},
]}
>
<Fragment slot="bg">
<div class="absolute inset-0 bg-blue-50 dark:bg-transparent"></div>
</Fragment>
</Features3>
</Layout> </Layout>

2
src/types.d.ts vendored
View File

@ -154,7 +154,7 @@ export interface Testimonial {
// COMPONENTS // COMPONENTS
export interface CallToAction { export interface CallToAction {
targetBlank: boolean; targetBlank?: boolean;
text?: string; text?: string;
icon?: string; icon?: string;
href?: string; href?: string;