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

Use actual grids #17

Merged
merged 3 commits into from
Oct 9, 2024
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
210 changes: 100 additions & 110 deletions app/routes/_index/sections/featured-products.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { AddToCartButton } from '@h2/new/Button'
import { Heading, Text } from '@h2/new/Text'
import {
Background,
Column,
Grid,
Section,
HalfAndHalf,
} from '@h2/new/Layout'
import { Background, Column, Section } from '@h2/new/Layout'
import { Image } from '@shopify/hydrogen'
import { Price, PriceCompareAt } from '@h2/Price'
import { cx } from '@h2/new/utils'
Expand Down Expand Up @@ -71,109 +65,105 @@ export function SaleBadge({ price, compareAtPrice }) {
export default function FeaturedProducts() {
return (
<Section>
<HalfAndHalf
left={
<SaleCard className='bg-lightGray'>
<div className='relative'>
<SaleBadge
price={{
amount: '39.00',
currencyCode: 'CAD',
}}
compareAtPrice={{
amount: '42.00',
currencyCode: 'CAD',
}}
/>
<Image
crop='center'
width={450}
height={380}
src='https://cdn.shopify.com/s/files/1/0657/3811/3197/files/01-DevMode-Buildertote_PDP_3_fa8b6520-484a-47e7-818d-b217b04d31e6.png'
/>
</div>
<Column gap={4} align='center' justify='center'>
<Heading font='text' weight='medium' size='l'>
Builders Tote
</Heading>
<Text
width='narrow'
color='black'
className='opacity-60'
>
Sofie Pavitt Face is an intentional edit of
skincare essentials designed for acne-prone
skin.
</Text>
</Column>
<Column style={{ height: 120 }}>
<AddToCartButton color='accent'>
Add to cart
</AddToCartButton>
</Column>
</SaleCard>
}
right={
<Image
className='object-cover w-full h-full'
width={633}
height={555}
src='https://cdn.shopify.com/s/files/1/0657/3811/3197/files/spotlight-image-home-1.jpg?v=1716832099'
/>
}
/>
<HalfAndHalf
left={
<Image
className='object-cover w-full h-full'
width={633}
height={555}
src='https://cdn.shopify.com/s/files/1/0657/3811/3197/files/spotlight-image-home-2.jpg?v=1716832296'
/>
}
right={
<SaleCard className='bg-accent'>
<div className='relative'>
<SaleBadge
price={{
amount: '39.00',
currencyCode: 'CAD',
}}
compareAtPrice={{
amount: '42.00',
currencyCode: 'CAD',
}}
/>
<Image
crop='center'
width={450}
height={380}
className='translate-y-12'
src='https://cdn.shopify.com/s/files/1/0657/3811/3197/files/01-GSD-Hat-PDP.webp'
/>
</div>
<Column gap={4} align='center' justify='center'>
<Heading font='text' weight='medium' size='l'>
Get Ship Done Hat 2.0
</Heading>
<Text
width='narrow'
color='black'
className='opacity-60'
>
Sofie Pavitt Face is an intentional edit of
skincare essentials designed for acne-prone
skin.
</Text>
</Column>
<Column style={{ height: 120 }}>
<AddToCartButton color='white'>
Add to cart
</AddToCartButton>
</Column>
</SaleCard>
}
/>
<div
style={{
display: 'grid',
gridTemplateColumns: 'repeat(2, 1fr)',
gridTemplateRows: 'repeat(2, 1fr)',
}}
ruggi marked this conversation as resolved.
Show resolved Hide resolved
>
<SaleCard className='bg-lightGray'>
<div className='relative'>
<SaleBadge
price={{
amount: '39.00',
currencyCode: 'CAD',
}}
compareAtPrice={{
amount: '42.00',
currencyCode: 'CAD',
}}
/>
<Image
crop='center'
width={450}
height={380}
src='https://cdn.shopify.com/s/files/1/0657/3811/3197/files/01-DevMode-Buildertote_PDP_3_fa8b6520-484a-47e7-818d-b217b04d31e6.png'
/>
</div>
<Column gap={4} align='center' justify='center'>
<Heading font='text' weight='medium' size='l'>
Builders Tote
</Heading>
<Text
width='narrow'
color='black'
className='opacity-60'
>
Sofie Pavitt Face is an intentional edit of
skincare essentials designed for acne-prone
skin.
</Text>
</Column>
<Column style={{ height: 120 }}>
<AddToCartButton color='accent'>
Add to cart
</AddToCartButton>
</Column>
</SaleCard>
<Image
className='object-cover w-full h-full'
width={633}
height={555}
src='https://cdn.shopify.com/s/files/1/0657/3811/3197/files/spotlight-image-home-1.jpg?v=1716832099'
/>
<Image
className='object-cover w-full h-full'
width={633}
height={555}
src='https://cdn.shopify.com/s/files/1/0657/3811/3197/files/spotlight-image-home-2.jpg?v=1716832296'
/>
<SaleCard className='bg-accent'>
<div className='relative'>
<SaleBadge
price={{
amount: '39.00',
currencyCode: 'CAD',
}}
compareAtPrice={{
amount: '42.00',
currencyCode: 'CAD',
}}
/>
<Image
crop='center'
width={450}
height={380}
className='translate-y-12'
src='https://cdn.shopify.com/s/files/1/0657/3811/3197/files/01-GSD-Hat-PDP.webp'
/>
</div>
<Column gap={4} align='center' justify='center'>
<Heading font='text' weight='medium' size='l'>
Get Ship Done Hat 2.0
</Heading>
<Text
width='narrow'
color='black'
className='opacity-60'
>
Sofie Pavitt Face is an intentional edit of
skincare essentials designed for acne-prone
skin.
</Text>
</Column>
<Column style={{ height: 120 }}>
<AddToCartButton color='white'>
Add to cart
</AddToCartButton>
</Column>
</SaleCard>
</div>
</Section>
)
}
8 changes: 7 additions & 1 deletion app/routes/_index/sections/hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ export default function Hero() {
</Button>
</div>
</div>
<div className='grid absolute z-0 inset-0 pointer-events-none grid-cols-2'>
<div
className='z-0 absolute inset-0 pointer-events-none'
style={{
display: 'grid',
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
}}
>
<div />
<div className='relative'>
<div className='absolute inset-0 bg-gradient-to-r from-darkGray to-transparent to-50% z-0' />
Expand Down
72 changes: 47 additions & 25 deletions app/routes/_index/sections/our-promise.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,53 @@ export default function OurPromise() {
Promise
</Heading>
</Container>
<div className='h-auto mx-auto px-4 md:px-8 lg:px-10 w-full relative z-10 max-w-7xl pb-36'>
<div style={{ display: 'flex', gap: 50 }}>
<PromiseCard
heading='Guaranteed For Life'
description='Every one of our products comes with a limited lifetime warranty.'
color='accent'
icon='guarantee'
borderRadius={0}
rotation={0}
offset={[0, 0]}
style={{ opacity: '100%' }}
/>
<PromiseCard
heading='100 days to try'
description='Try it out for 100 days. If you don’t love it, send it back.'
color='gray'
icon='trial'
/>
<PromiseCard
heading='Free shipping'
description='We’ll cover shipping on all orders to the contiguous US and Canada.'
color='black'
icon='shipping'
/>
</div>
<div
style={{
display: 'grid',
gridTemplateColumns:
'repeat(auto-fit, minmax(350px, 1fr))',
gap: 30,
justifyItems: 'center',
paddingBottom: '9rem',
justifyContent: 'center',
alignItems: 'center',
alignContent: 'center',
margin: '0 9rem',
}}
>
<PromiseCard
heading='Guaranteed For Life'
description='Every one of our products comes with a limited lifetime warranty.'
color='accent'
icon='guarantee'
borderRadius={0}
rotation={0}
offset={[0, 0]}
style={{
alignSelf: 'stretch',
justifySelf: 'stretch',
}}
/>
<PromiseCard
heading='100 days to try'
description='Try it out for 100 days. If you don’t love it, send it back.'
color='gray'
icon='trial'
style={{
alignSelf: 'stretch',
justifySelf: 'stretch',
}}
/>
<PromiseCard
heading='Free shipping'
description='We’ll cover shipping on all orders to the contiguous US and Canada.'
color='black'
icon='shipping'
style={{
alignSelf: 'stretch',
justifySelf: 'stretch',
}}
/>
</div>
</section>
)
Expand Down
Loading