Lightweight gallery.
https://luna.liriliri.io/?path=/story/gallery
Add the following script and style to your page.
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-carousel/luna-carousel.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-gallery/luna-gallery.css" />
<script src="//cdn.jsdelivr.net/npm/luna-carousel/luna-carousel.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-gallery/luna-gallery.js"></script>
You can also get it on npm.
npm install luna-gallery luna-carousel --save
import 'luna-carousel/luna-carousel.css'
import 'luna-gallery/luna-gallery.css'
import LunaGallery from 'luna-gallery'
const gallery = new LunaGallery(container)
gallery.append('https://res.liriliri.io/luna/pic1.jpg', 'pic1.jpg')
gallery.show()
- inline(boolean): Enable inline mode.
Append image.
Clear all images.
Insert image at given position.
Slide to the item at given index.