mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
slideshow component
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user