-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add initial testimonials layout
- Loading branch information
Showing
20 changed files
with
299 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
--- | ||
import BaseLayout from '@components/templates/baseLayout/BaseLayout.astro'; | ||
import Welcome from '@components/molecules/welcome/Welcome.astro'; | ||
import Testimonials from '@components/molecules/testimonials/Testimonials.astro'; | ||
import Testimonials from 'src/ui/components/organisms/testimonials/Testimonials.astro'; | ||
// todo: add testimonial | ||
// current todo: refine testimonials (modules, css, grid, etc) | ||
// todo: reveal on enter viewport | ||
// todo: view transitions | ||
// todo: add vitest | ||
// todo: add CIs | ||
--- | ||
<BaseLayout title="" description=""> | ||
<Welcome /> | ||
<Testimonials /> | ||
<Welcome /> | ||
<Testimonials /> | ||
</BaseLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React, { type FC, type ReactNode } from 'react'; | ||
|
||
interface RenderChildrenProps { | ||
children: ReactNode; | ||
} | ||
|
||
type SlideProps = RenderChildrenProps; | ||
|
||
type ImageProps = Pick<HTMLImageElement, 'src' | 'alt'>; | ||
export const Slide: FC<SlideProps> & { | ||
Title: FC<RenderChildrenProps>; | ||
Quote: FC<RenderChildrenProps>; | ||
Role: FC<RenderChildrenProps>; | ||
Image: FC<ImageProps>; | ||
} = ({ children }) => { | ||
return ( | ||
<div className="slide-container"> | ||
<div className="slide-content">{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
const Title: FC<RenderChildrenProps> = ({ children }) => <h4>{children}</h4>; | ||
|
||
const Quote: FC<RenderChildrenProps> = ({ children }) => <blockquote className="quote">{children}</blockquote>; | ||
|
||
const Role: FC<RenderChildrenProps> = ({ children }) => <p className="role">{children}</p>; | ||
|
||
const Image: FC<ImageProps> = ({ src, alt }) => <img src={src} alt={alt} decoding="async" loading="lazy" />; | ||
|
||
Slide.Title = Title; | ||
Slide.Quote = Quote; | ||
Slide.Role = Role; | ||
Slide.Image = Image; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
@layer header.menu { | ||
.header__menu { | ||
display: flex; | ||
height: 100vh; | ||
position: fixed; | ||
top: 0; | ||
visibility: hidden; | ||
width: 100vw; | ||
|
||
& > div { | ||
height: 100%; | ||
} | ||
} | ||
|
||
.header__menu :is(a, span) { | ||
color: var(--white); | ||
line-height: 70%; | ||
position: relative; | ||
top: 150%; | ||
} | ||
|
||
.navigation__menu { | ||
align-items: center; | ||
display: flex; | ||
flex: 3; | ||
flex-direction: column; | ||
justify-content: center; | ||
background-color: var(--neutral-main); | ||
} | ||
|
||
.navigation__menu__inner { | ||
display: grid; | ||
grid-template-areas: 'HeaderQuote Divider Navigation'; | ||
grid-template-columns: 50% 1fr 50%; | ||
gap: 1rem; | ||
} | ||
|
||
.navigation__menu__nav { | ||
gap: 3rem 0; | ||
padding-left: 4rem; | ||
grid-area: Navigation; | ||
} | ||
|
||
.navigation__menu__item, | ||
.navigation__menu__quote { | ||
position: relative; | ||
|
||
&:after { | ||
background: var(--neutral-main); | ||
content: ''; | ||
height: 175%; | ||
left: -1.5rem; | ||
margin: 0 auto; | ||
position: absolute; | ||
width: 120%; | ||
} | ||
} | ||
|
||
.navigation__menu__item { | ||
span:first-child { | ||
margin-inline-end: 0.5rem; | ||
} | ||
|
||
&:after { | ||
top: 125%; | ||
} | ||
} | ||
|
||
.navigation__menu__quote { | ||
color: var(--white); | ||
grid-area: HeaderQuote; | ||
padding-inline-end: 4rem; | ||
text-align: end; | ||
font-size: clamp(2rem, 2rem, 2rem); | ||
position: relative; | ||
|
||
& span { | ||
line-height: 140%; | ||
} | ||
|
||
&:after { | ||
top: 220px; | ||
width: 100%; | ||
} | ||
} | ||
|
||
.navigation__menu__divider { | ||
grid-area: Divider; | ||
height: 150%; | ||
width: 1px; | ||
background-color: var(--white); | ||
transition: 0.3s opacity; | ||
opacity: 0; | ||
translate: 0 -3rem; | ||
|
||
&.--is-menu-open { | ||
transition-delay: 2.5s; | ||
opacity: 1; | ||
} | ||
} | ||
|
||
.navigation__menu__link { | ||
font-size: clamp(2rem, 5rem, 5rem); | ||
text-transform: uppercase; | ||
position: relative; | ||
display: inline-block; | ||
|
||
&:after { | ||
background-color: currentColor; | ||
width: 80%; | ||
height: 1px; | ||
margin: 0 auto; | ||
left: 0; | ||
right: 0; | ||
bottom: -1.25rem; | ||
transform: scaleX(0); | ||
transition: all 0.2s ease; | ||
position: absolute; | ||
content: ''; | ||
} | ||
|
||
&.--is-current-page { | ||
color: var(--primary-main); | ||
} | ||
|
||
&:hover, | ||
&:focus { | ||
opacity: 1; | ||
|
||
&:after { | ||
transform: scaleX(1); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './testimonial.tsx'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@layer testimonial { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { type FC, type ReactNode } from 'react'; | ||
import './testimonial.css'; | ||
|
||
interface RenderChildrenProps { | ||
children: ReactNode; | ||
} | ||
|
||
type TestimonialProps = RenderChildrenProps; | ||
|
||
type ImageProps = Pick<HTMLImageElement, 'src' | 'alt'>; | ||
export const Testimonial: FC<TestimonialProps> & { | ||
Name: FC<RenderChildrenProps>; | ||
Quote: FC<RenderChildrenProps>; | ||
Description: FC<RenderChildrenProps>; | ||
Image: FC<ImageProps>; | ||
} = ({ children }) => { | ||
return ( | ||
<div className="slide__wrapper"> | ||
<div className="slide__content">{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
const Image: FC<ImageProps> = ({ src, alt }) => <img src={src} alt={alt} decoding="async" loading="lazy" />; | ||
|
||
const Quote: FC<RenderChildrenProps> = ({ children }) => <blockquote className="quote">{children}</blockquote>; | ||
|
||
const Name: FC<RenderChildrenProps> = ({ children }) => <h4>{children}</h4>; | ||
|
||
const Description: FC<RenderChildrenProps> = ({ children }) => <p className="role">{children}</p>; | ||
|
||
Testimonial.Name = Name; | ||
Testimonial.Quote = Quote; | ||
Testimonial.Description = Description; | ||
Testimonial.Image = Image; |
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/ui/components/molecules/testimonialsSlider/TestimonialsSlider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react'; | ||
import { Swiper, SwiperSlide } from 'swiper/react'; | ||
import { Navigation } from 'swiper/modules'; | ||
import { Testimonial } from '@components/atoms/testimonial'; | ||
|
||
export const TestimonialsSlider = () => { | ||
return ( | ||
<Swiper navigation={true} modules={[Navigation]} className="mySwiper" slidesPerView={3}> | ||
<SwiperSlide> | ||
<Testimonial> | ||
<Testimonial.Name>Name</Testimonial.Name> | ||
<Testimonial.Quote>quote</Testimonial.Quote> | ||
<Testimonial.Image src="https://via.placeholder.com/50" alt="alt" /> | ||
<Testimonial.Description>role</Testimonial.Description> | ||
</Testimonial> | ||
</SwiperSlide> | ||
<SwiperSlide> | ||
<Testimonial> | ||
<Testimonial.Name>Name</Testimonial.Name> | ||
<Testimonial.Quote>quote</Testimonial.Quote> | ||
<Testimonial.Image src="https://via.placeholder.com/50" alt="alt" /> | ||
<Testimonial.Description>role</Testimonial.Description> | ||
</Testimonial> | ||
</SwiperSlide> | ||
<SwiperSlide> | ||
<Testimonial> | ||
<Testimonial.Name>Name</Testimonial.Name> | ||
<Testimonial.Quote>quote</Testimonial.Quote> | ||
<Testimonial.Image src="https://via.placeholder.com/50" alt="alt" /> | ||
<Testimonial.Description>role</Testimonial.Description> | ||
</Testimonial> | ||
</SwiperSlide> | ||
<SwiperSlide> | ||
<Testimonial> | ||
<Testimonial.Name>Name</Testimonial.Name> | ||
<Testimonial.Quote>quote</Testimonial.Quote> | ||
<Testimonial.Image src="https://via.placeholder.com/50" alt="alt" /> | ||
<Testimonial.Description>role</Testimonial.Description> | ||
</Testimonial> | ||
</SwiperSlide> | ||
</Swiper> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './TestimonialsSlider'; |
12 changes: 12 additions & 0 deletions
12
src/ui/components/organisms/testimonials/Testimonials.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
import '@components/organisms/testimonials/testimonials.css'; | ||
import { TestimonialsSlider } from '@components/molecules/testimonialsSlider/index'; | ||
--- | ||
<section class="testimonials__wrapper wrapper"> | ||
<h3 class="testimonials__title">Testimonials</h3> | ||
<p class="testimonials__body"> | ||
This template comes with a few integrations already configured in your | ||
astro.config.mjs file. You can customize your setup with Astro Integrations to add tools like Tailwind, React, | ||
or Vue to your project.</p> | ||
<TestimonialsSlider client:only="react" /> | ||
</section> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
@import url('vendor.css'); | ||
@import url('overrides.css'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@import url('swiper/css'); | ||
@import url('swiper/css/navigation'); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters