-
Notifications
You must be signed in to change notification settings - Fork 2
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 #90 from fac29/homepage-pop
Homepage pop
- Loading branch information
Showing
12 changed files
with
184 additions
and
57 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,69 @@ | ||
import { useState, useEffect } from 'react'; | ||
import stage1 from '/stage1.jpg'; | ||
import stage2 from '/stage2.jpg'; | ||
import stage3 from '/stage3.jpg'; | ||
import stage4 from '/stage4.jpg'; | ||
import stage5 from '/stage5.png'; | ||
|
||
const stages = [ | ||
{ | ||
id: 1, | ||
image: stage1, | ||
caption: 'Graduating university', | ||
}, | ||
{ | ||
id: 2, | ||
image: stage2, | ||
caption: 'Beginning a career', | ||
}, | ||
{ | ||
id: 3, | ||
image: stage3, | ||
caption: 'Giving back', | ||
}, | ||
{ | ||
id: 4, | ||
image: stage4, | ||
caption: 'Exploring the world', | ||
}, | ||
{ | ||
id: 5, | ||
image: stage5, | ||
caption: 'Starting a business', | ||
}, | ||
]; | ||
|
||
function CarouselStages() { | ||
const [current, setCurrent] = useState(0); | ||
|
||
useEffect(() => { | ||
setTimeout(() => { | ||
slideRight(); | ||
}, 10000); | ||
}), | ||
[current]; | ||
|
||
const slideRight = () => { | ||
setCurrent(current === stages.length - 1 ? 0 : current + 1); | ||
}; | ||
return ( | ||
<div className='box-content h-64 w-full max-w-lg relative'> | ||
<ul> | ||
{stages.map((stage, index: number) => ( | ||
<li | ||
key={stage.id} | ||
className={`absolute top-0 left-0 w-full h-full transition-opacity duration-500 ease-in-out | ||
${index === current ? 'opacity-100' : 'opacity-0'} ${index === current ? 'pointer-events-auto' : 'pointer-events-none'}`} | ||
> | ||
<figure> | ||
<img src={stage.image} /> | ||
<figcaption>{stage.caption}</figcaption> | ||
</figure> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
export default CarouselStages; |
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
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