slideshow component

This commit is contained in:
MathieuG-P
2022-06-03 22:01:17 +02:00
parent 6dc2ce4769
commit 9c13c7830a
2 changed files with 35 additions and 0 deletions
@@ -0,0 +1,24 @@
.slide{
overflow: hidden;
}
.slide > img{
animation: slide 50s infinite linear;
opacity: 0;
position: absolute;
}
@keyframes slide {
5% {
opacity: 1;
}
20% {
opacity: 1;
}
30% {
opacity: 0;
}
40% {
transform: scale(1.2);
}
}
@@ -0,0 +1,11 @@
import './slideshow.component.css';
export function Slideshow(props: {className: string, images: string[]}) {
return (
<div className={`slide ${props.className}`}>
{
props.images.map((i, index) => <img key={index} className='w-full h-full object-cover' src={i} style={{animationDelay: `${index * 10}s`}}></img>)
}
</div>
)
}