Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include some widgets in about-us page #214

Merged
merged 4 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/components/widgets/Features3.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const {
image,
items = [],
columns,
isBeforeContent,
isAfterContent,

id,
isDark = false,
Expand All @@ -20,7 +22,14 @@ const {
} = Astro.props as Features;
---

<WidgetWrapper id={id} isDark={isDark} containerClass={classes?.container} bg={bg}>
<WidgetWrapper
id={id}
isDark={isDark}
containerClass={`${isBeforeContent ? 'md:pb-8 lg:pb-12' : ''} ${isAfterContent ? 'pt-0 md:pt-0 lg:pt-0' : ''} ${
classes?.container ?? ''
}`}
bg={bg}
>
<Headline title={title} subtitle={subtitle} tagline={tagline} classes={classes?.headline} />

<div aria-hidden="true" class="aspect-w-16 aspect-h-7">
Expand Down Expand Up @@ -48,7 +57,7 @@ const {
items={items}
columns={columns}
classes={{
container: 'mt-5 lg:mt-16',
container: 'mt-12',
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',
Expand Down
10 changes: 0 additions & 10 deletions src/components/widgets/Hero.astro
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
---
import { Icon } from 'astro-icon/components';
import { Picture } from '@astrojs/image/components';
import { CallToAction } from '~/types';

export interface Props {
title?: string;
subtitle?: string;
content?: string;
callToAction?: string | CallToAction;
callToAction2?: string | CallToAction;
image?: string | any; // TODO: find HTMLElementProps
}

const {
title = await Astro.slots.render('title'),
Expand Down
167 changes: 61 additions & 106 deletions src/components/widgets/Steps2.astro
Original file line number Diff line number Diff line change
@@ -1,122 +1,77 @@
---
import { Icon } from 'astro-icon/components';
import type { CallToAction } from '~/components/widgets/CallToAction.astro';

interface Item {
title: string;
description: string;
icon?: string;
}

export interface Props {
title?: string;
subtitle?: string;
tagline?: string;
callToAction?: string | CallToAction;
items: Array<Item>;
}
import Headline from '../ui/Headline.astro';
import { Steps } from '~/types';
import WidgetWrapper from '../ui/WidgetWrapper.astro';

const {
title = await Astro.slots.render('title'),
subtitle = await Astro.slots.render('subtitle'),
tagline,
callToAction = await Astro.slots.render('callToAction'),
items = [],
} = Astro.props;
isReversed = false,

/**
*

<!-- Steps2 Widget Example ***************** -->

<Steps2
title="Sed ac magna sit amet risus tristique interdum, at vel velit in hac habitasse platea dictumst."
subtitle="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla, sed porttitor est nibh at nulla. Praesent placerat enim ut ex tincidunt vehicula. Fusce sit amet dui tellus."
callToAction={{
text: 'Get template',
href: 'https://github.com/onwidget/astrowind',
icon: 'tabler:download',
}}
items={[
{
title: 'Responsive Elements',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
},
{
title: 'Flexible Team',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
},
{
title: 'Ecologic Software',
description:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
},
]}
/>
*/
id,
isDark = false,
classes = {},
bg = await Astro.slots.render('bg'),
} = Astro.props as Steps;
---

<section>
<div class="max-w-7xl mx-auto px-4 sm:px-6 overflow-hidden not-prose">
<div class="py-12 md:py-20">
<div class="py-4 sm:py-6 lg:py-8">
<div class="flex flex-wrap md:-mx-8">
<div class="w-full lg:w-1/2 px-0 sm:px-8 mb-12">
<div>
{
tagline && (
<p
class="text-base text-primary dark:text-blue-200 font-semibold tracking-wide uppercase"
set:html={tagline}
/>
)
}
{title && <h2 class="mb-4 text-3xl lg:text-4xl font-bold font-heading" set:html={title} />}
{subtitle && <p class="mb-8 text-xl text-muted dark:text-slate-400" set:html={subtitle} />}
<WidgetWrapper id={id} isDark={isDark} containerClass={`max-w-screen-xl mx-auto ${classes?.container ?? ''}`} bg={bg}>
<div class={`flex flex-col gap-8 md:gap-12 md:flex-row ${isReversed ? 'md:flex-row-reverse' : ''}`}>
<div class={`w-full lg:w-1/2 gap-8 md:gap-12 ${isReversed ? 'lg:ml-16 md:ml-8 ml-0' : 'lg:mr-16 md:mr-8 mr-0'}`}>
<Headline
title={title}
subtitle={subtitle}
tagline={tagline}
callToAction={callToAction}
classes={{
container: 'text-left mb-4 md:mb-8',
title: 'mb-4 text-3xl lg:text-4xl font-bold font-heading',
subtitle: 'mb-8 text-xl text-muted dark:text-slate-400',
// ...((classes?.headline as {}) ?? {}),
}}
/>

<div class="w-full">
{
typeof callToAction === 'string' ? (
<Fragment set:html={callToAction} />
) : (
callToAction &&
callToAction.text &&
callToAction.href && (
<a class="btn btn-primary mb-4 sm:mb-0" href={callToAction.href} target="_blank" rel="noopener">
{callToAction.icon && <Icon name={callToAction.icon} class="w-5 h-5 mr-1 -ml-1.5" />}
{callToAction.text}
</a>
)
)
}
</div>
</div>
</div>
<div class="w-full lg:w-1/2 px-0 sm:px-8">
<ul class="space-y-10">
{
items && items.length
? items.map(({ title: title2, description, icon }, index) => (
<li class="flex md:-mx-4">
<div class="pr-4 sm:pl-4">
<span class="flex w-16 h-16 mx-auto items-center justify-center text-2xl font-bold rounded-full bg-blue-100 text-primary">
{icon ? <Icon name={icon} class="w-6 h-6 icon-bold" /> : index + 1}
</span>
</div>
<div class="pl-4">
<h3 class="mb-4 text-xl font-semibold font-heading" set:html={title2} />
<p class="text-muted dark:text-gray-400" set:html={description} />
</div>
</li>
))
: ''
}
</ul>
</div>
</div>
<div class="w-full">
{
typeof callToAction === 'string' ? (
<Fragment set:html={callToAction} />
) : (
callToAction &&
callToAction.text &&
callToAction.href && (
<a class="btn btn-primary mb-12" href={callToAction.href} target="_blank" rel="noopener">
{callToAction.icon && <Icon name={callToAction.icon} class="w-5 h-5 mr-1 -ml-1.5" />}
{callToAction.text}
</a>
)
)
}
</div>
</div>
<div class="w-full lg:w-1/2 px-8 sm:px-0">
<ul class="space-y-10">
{
items && items.length
? items.map(({ title: title2, description, icon }, index) => (
<li class="flex md:-mx-4">
<div class="pr-4 sm:pl-4">
<span class="flex w-16 h-16 mx-auto items-center justify-center text-2xl font-bold rounded-full bg-blue-100 text-primary">
{icon ? <Icon name={icon} class="w-6 h-6 icon-bold" /> : index + 1}
</span>
</div>
<div class="pl-4">
<h3 class="mb-4 text-xl font-semibold font-heading" set:html={title2} />
<p class="text-muted dark:text-gray-400" set:html={description} />
</div>
</li>
))
: ''
}
</ul>
</div>
</div>
</section>
</WidgetWrapper>
Loading