-
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.
- Loading branch information
Showing
8 changed files
with
4,227 additions
and
142 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module "react-spring-carousel"; |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,77 @@ | ||
--- | ||
import FeedbackCarousel from "./FeedbackCarousel.tsx"; | ||
export type FeedbackItem = { | ||
id: number; | ||
name: string; | ||
role: string; | ||
company: string; | ||
image: string; | ||
feedback: string; | ||
}; | ||
const feedback: FeedbackItem[] = [ | ||
{ | ||
id: 1, | ||
name: "John Doe", | ||
role: "CEO", | ||
company: "ABC Inc.", | ||
image: "favicon.svg", | ||
feedback: "Scrumlr makes regular updates, making the tool even more intuitive.", | ||
}, | ||
{ | ||
id: 2, | ||
name: "Dohn Joe", | ||
role: "CFO", | ||
company: "ABC Inc.", | ||
image: "favicon.svg", | ||
feedback: "Amazing tool for planning our agendas in an cooperative way.", | ||
}, | ||
{ | ||
id: 3, | ||
name: "Hans Peter", | ||
role: "CXO", | ||
company: "ABC Inc.", | ||
image: "favicon.svg", | ||
feedback: "Our team loved this tool. It made the everything - especially the communication faster and easier 👏🏼", | ||
}, | ||
{ | ||
id: 4, | ||
name: "Peter Hans", | ||
role: "Praktikant", | ||
company: "ABC Inc.", | ||
image: "favicon.svg", | ||
feedback: "This Web-app has so many useful and cool features!", | ||
}, | ||
{ | ||
id: 5, | ||
name: "Peter Lusting", | ||
role: "CTO", | ||
company: "ABC Inc.", | ||
image: "favicon.svg", | ||
feedback: "Gumo zusammen, scruml ist supi", | ||
}, | ||
]; | ||
--- | ||
|
||
<section class="feedback"> | ||
<h2>Our satisfied Users:</h2> | ||
<p>Happy users are important to us. That's why we value every feedback.</p> | ||
<div class="feedback_carousel-container"> | ||
<FeedbackCarousel items={feedback} client:only="react" /> | ||
</div> | ||
</section> | ||
|
||
<style lang="scss"> | ||
.feedback { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin-bottom: 128px; | ||
} | ||
|
||
.feedback_carousel-container { | ||
width: 100%; | ||
overflow-x: clip; | ||
margin-top: 96px; | ||
} | ||
</style> |
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,46 @@ | ||
.feedback_card { | ||
width: 333px; | ||
height: 333px; | ||
filter: var(--shadow); | ||
background-color: var(--white); | ||
border-radius: 16px; | ||
margin: 0 16px; | ||
padding: 32px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
box-sizing: border-box; | ||
position: relative; | ||
|
||
&::before { | ||
content: ""; | ||
position: absolute; | ||
top: -1px; | ||
width: 70px; | ||
height: 3px; | ||
background-color: var(--lightmode-pink); | ||
border-radius: 2px; | ||
} | ||
|
||
.feedback_card-text { | ||
margin: 0; | ||
} | ||
|
||
.feedback_card-author { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 16px; | ||
|
||
img { | ||
width: 42px; | ||
height: 42px; | ||
border-radius: 50%; | ||
} | ||
|
||
.feedback_card-author-info { | ||
.feedback_card-author-name { | ||
margin: 0; | ||
} | ||
} | ||
} | ||
} |
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,46 @@ | ||
import { useSpringCarousel } from "react-spring-carousel"; | ||
import type { FeedbackItem } from "./Feedback.astro"; | ||
import "./FeedbackCarousel.scss"; | ||
|
||
type FeedbackCarouselProps = { | ||
items: FeedbackItem[]; | ||
}; | ||
|
||
const FeedbackCard = (item: FeedbackItem) => ( | ||
<div className="feedback_card"> | ||
<p className="feedback_card-text"> | ||
{item.feedback} | ||
</p> | ||
<div className="feedback_card-author"> | ||
<img src={item.image} alt={item.name} /> | ||
<div className="feedback_card-author-info"> | ||
<h4 className="feedback_card-author-name"> | ||
{item.name} | ||
</h4> | ||
<span className="feedback_card-author-position"> | ||
{item.role}, {item.company} | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
|
||
const FeedbackCarousel = ({ items }: FeedbackCarouselProps) => { | ||
const { | ||
carouselFragment, | ||
slideToPrevItem, | ||
slideToNextItem, | ||
useListenToCustomEvent | ||
} = useSpringCarousel({ | ||
withLoop: true, | ||
itemsPerSlide: 4, | ||
items: items.map((item) => ({ | ||
id: item.id, | ||
renderItem: <FeedbackCard {...item} />, | ||
})), | ||
}); | ||
|
||
return <div>{carouselFragment}</div>; | ||
}; | ||
|
||
export default FeedbackCarousel; |
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