Add image carousel

This commit is contained in:
technobaboo
2021-07-22 07:41:49 -05:00
parent 6da3279f19
commit e54920a523
4 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import React from 'react';
import { Carousel } from 'react-responsive-carousel';
const ImageList = [
{
image: "https://pbs.twimg.com/media/E6HnwU1WYAQUATa.jpg:large",
alt: "A scene showing multiple widgets, including sliders like an equalizer and a virtual touchscreen.",
caption: "Multiple objects working independently all at once.",
},
{
image: "img/carousel/spatialcode.png",
alt: "To the left, a code editor showing Stardust Fusion creating several models and transforming them on the logicStep. To the right is the program running in Stardust.",
caption: "Code vs output of the Spatial Fusion demo.",
},
]
function CarouselImage({image, alt, caption}) {
return (
<div>
<img alt={alt} src={image} />
<p className="legend">{caption}</p>
</div>
);
}
export default () => (
<Carousel autoPlay className="gallery">
{ImageList.map((props, idx) => (
<CarouselImage key={idx} {...props} />
))}
</Carousel>
);