slideswap

Archived. Use <carousel-elemental> from the Book of Elementals, which is keyboard and screen reader complete.

A cross-fade slideshow for slides that are not the same size — a paragraph, then a portrait image, then a wide one.

Where that stops: there are no roles and no arrow-key navigation, so this is not the APG carousel pattern.

Demo

Slide 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam euismod, nisl eget aliquam ultricies, nunc nunc aliquet nunc, nec al

Slide 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam euismod, nisl eget aliquam ultricies, nunc nunc aliquet nunc, nec al

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam euismod, nisl eget aliquam ultricies, nunc nunc aliquet nunc, nec al

Slide 3
Slide 4
Slide 5

Adding and removing slides

add(slide) appends and remove() drops the last one — both take an optional index for a specific position. add() leaves you on the slide you were already on, so Add below follows it with setCurrentSlide(); without that the new slide sits at opacity: 0 and the button looks like it did nothing.

Installation

Install via npm:

npm install slideswap