-
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.
Merge pull request #36 from SmartCityFlensburg/feature/add-current-pr…
…ocess-section feat: add current process section
- Loading branch information
Showing
9 changed files
with
153 additions
and
8 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
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react'; | ||
|
||
interface ProcessCardProps { | ||
label: string; | ||
shortName: string; | ||
index: number; | ||
activeStep: number; | ||
maxIndex: number; | ||
description: string; | ||
isCurrent?: boolean; | ||
isCompleted?: boolean; | ||
} | ||
|
||
const ProcessCard: React.FC<ProcessCardProps> = ({ label, shortName, index, activeStep, maxIndex, description, isCurrent = false, isCompleted = false }) => { | ||
return ( | ||
<div className="relative"> | ||
<article className={`h-full p-6 mb-6 cursor-pointer shadow-md rounded-2xl mx-4 border md:mx-6 lg:max-w-[32rem] lg:h-auto lg:cursor-default | ||
${isCurrent && !isCompleted ? 'bg-green-light-900/10 border-green-light-900' : ''} | ||
${isCompleted && !isCurrent ? 'border-green-dark-900 bg-white' : ''} | ||
${!isCompleted && !isCurrent ? 'border-grey-100 bg-white' : ''} | ||
${index % 2 !== 0 ? 'xl:ml-auto' : ''} | ||
${index + 1 === maxIndex ? 'lg:mb-2' : 'lg:mb-0'}`} | ||
> | ||
<span className="text-sm"> | ||
Schritt {index + 1} von {maxIndex}: {shortName} | ||
</span> | ||
<h3 className="my-4 font-lato font-semibold text-lg lg:my-5">{label}</h3> | ||
<p>{description}</p> | ||
</article> | ||
|
||
<div className={`relative lg:static lg:before:w-0.5 lg:before:h-1/2 lg:after:w-0.5 lg:after:h-1/2 | ||
${index !== 0 ? 'before:w-1/2 before:h-0.5 before:absolute before:left-0 before:top-1/2 before:-z-10' : ''} | ||
${index + 1 < maxIndex ? 'after:w-1/2 after:h-0.5 after:absolute after:right-0 after:top-1/2 after:-z-10 ' : ''} | ||
${index === activeStep ? 'before:bg-green-dark-900 after:bg-grey-100' : ''} | ||
${index < activeStep ? 'before:bg-green-dark-900 after:bg-green-dark-900' : ''} | ||
${index > activeStep ? 'before:bg-grey-100 after:bg-grey-100' : ''} | ||
${index % 2 === 0 ? 'lg:before:-right-10 lg:before:left-auto lg:before:top-0 lg:after:-right-10' : 'lg:before:-left-[2.6rem] lg:before:right-auto lg:before:top-0 lg:after:-left-[2.6rem]'}`} | ||
> | ||
<figure className={`mx-auto flex items-center justify-between rounded-full w-8 h-8 lg:absolute lg:top-1/2 lg:-translate-y-1/2 | ||
${index === activeStep ? 'text-white bg-green-dark-900' : 'text-white bg-green-light-900'} | ||
${index < activeStep ? 'border-2 border-green-dark-900 bg-white' : ''} | ||
${index % 2 === 0 ? 'lg:-right-14' : 'lg:-left-14'}`} | ||
> | ||
<span className="block font-semibold font-lato mx-auto"> | ||
{index < activeStep ? ( | ||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="3" stroke="#4C7741" className="w-4"> | ||
<path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /> | ||
</svg> | ||
) : ( | ||
index + 1 | ||
)} | ||
</span> | ||
</figure> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProcessCard; |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { Splide, SplideSlide } from '@splidejs/react-splide'; | ||
import { i18nTranslated } from '../../helper/sliderTranslations'; | ||
import '@splidejs/react-splide/css'; | ||
import ProcessCard from "../cards/ProcessCard"; | ||
|
||
function Process() { | ||
const activeStep = 1; | ||
|
||
const steps = [ | ||
{ | ||
label: "Konzepterstellung", | ||
shortName: "Konzept", | ||
description: "Occaecat in dolor eiusmod fugiat. Excepteur proident nostrud aliquip esse ut nostrud in ut esse. Proident ut consequat consequat consectetur magna." | ||
}, | ||
{ | ||
label: "MVP (Most Valid Product)", | ||
shortName: "MVP", | ||
description: "Occaecat in dolor eiusmod fugiat. Excepteur proident nostrud aliquip esse ut nostrud in ut esse. Proident ut consequat consequat consectetur magna." | ||
}, | ||
{ | ||
label: "Produktvorstellung 01", | ||
shortName: "Vorstellung 01", | ||
description: "Occaecat in dolor eiusmod fugiat. Excepteur proident nostrud aliquip esse ut nostrud in ut esse. Proident ut consequat consequat consectetur magna." | ||
}, | ||
{ | ||
label: "Produktvorstellung 02", | ||
shortName: "Vorstellung 02", | ||
description: "Occaecat in dolor eiusmod fugiat. Excepteur proident nostrud aliquip esse ut nostrud in ut esse. Proident ut consequat consequat consectetur magna." | ||
}, | ||
{ | ||
label: "Finale Vorstellung", | ||
shortName: "Finalisierung", | ||
description: "Occaecat in dolor eiusmod fugiat. Excepteur proident nostrud aliquip esse ut nostrud in ut esse. Proident ut consequat consequat consectetur magna." | ||
}, | ||
]; | ||
|
||
const breakpoints = { | ||
640: { | ||
padding: '20%' | ||
}, | ||
1024: { | ||
destroy: true, | ||
}, | ||
}; | ||
|
||
return ( | ||
<section className="my-28 lg:my-36 xl:my-44"> | ||
<article className="px-4 mb-8 max-w-208 mx-auto md:px-6 lg:mb-14 lg:text-center xl:max-w-screen-lg"> | ||
<h2 className="font-lato font-bold text-2xl mb-6 lg:text-3xl"> | ||
Der aktuelle Projektfortschritt | ||
</h2> | ||
<p> | ||
Sit sint sit incididunt magna esse incididunt incididunt consectetur ex sit. | ||
Ipsum labore dolor minim culpa Lorem incididunt nisi nulla culpa dolor. | ||
Occaecat in dolor eiusmod fugiat. Excepteur proident nostrud aliquip esse ut nostrud in ut esse. | ||
Proident ut consequat consequat consectetur magna. | ||
</p> | ||
</article> | ||
|
||
<Splide | ||
options={{ rewind: true, arrows: false, pagination: false, i18n: i18nTranslated, mediaQuery: 'min', breakpoints: breakpoints, start: activeStep }} | ||
aria-label="Der aktuelle Projektfortschritt" | ||
className="md:px-2 lg:mx-auto lg:max-w-screen-lg xl:max-w-screen-xl" | ||
> | ||
{steps.map((step, index) => ( | ||
<SplideSlide key={index} className="pb-10 lg:w-1/2 lg:even:ml-auto lg:even:mr-0 lg:even:pl-10 lg:pb-0 lg:odd:pr-10"> | ||
<ProcessCard | ||
label={step.label} | ||
shortName={step.shortName} | ||
index={index} | ||
activeStep={activeStep} | ||
maxIndex={steps.length} | ||
isCurrent={index === activeStep} | ||
isCompleted={index < activeStep} | ||
description={step.description} /> | ||
</SplideSlide> | ||
))} | ||
</Splide> | ||
</section> | ||
); | ||
} | ||
|
||
export default Process; |
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