An open API service indexing awesome lists of open source software.

https://github.com/festify/ken-burns-carousel

🌄 A web component that displays a set of images with a ken burns effect
https://github.com/festify/ken-burns-carousel

carousel ken-burns slideshow web-component

Last synced: 4 months ago
JSON representation

🌄 A web component that displays a set of images with a ken burns effect

Awesome Lists containing this project

README

        

# \
[![Travis](https://travis-ci.org/Festify/ken-burns-carousel.svg?branch=master)](https://travis-ci.org/Festify/ken-burns-carousel)

A bare and extremely light web component that displays a set of images with a ken burns effect. [Demo](https://festify.github.io/ken-burns-carousel/).





## Usage
Import the JS:
```js
/*
* Importing directly from the element defines the element class
* and registers it with the global element registry with the tag
* name 'ken-burns-carousel'.
*/
import 'ken-burns-carousel';
```

Alternatively:

```js
/*
* In case the default name conflicts, you can import from
* 'ken-burns-element/dist/element'. This export _does not_ register
* the element with the element registry and allows you to choose
* a custom tag name.
*/
import KenBurnsElement from 'ken-burns-carousel/dist/element';

customElements.define('custom-ken-burns-element-tag', KenBurnsElement);
```

Use the element in the DOM:
```html

```

And the carousel will begin fading images ✨. See the [Demo](https://festify.github.io/ken-burns-carousel/) for more examples.

## Compatibility
The element works in all evergreen browsers (tested on Firefox, Chrome, Safari and Edge). Mileage with other browsers may vary.

That said, the element does not do any complex DOM operations or use any fancy APIs (except for web components, of course), so adapting it, if needed, will be simple. The element has been adapted for usage with the ShadyDOM polyfill.

## Performance
The element makes careful use of composition layers and uses CSS 3D transforms and opacity animations exclusively. As such, animations will run butter smooth even when expensive filters are applied to the images.

The element also preloads images before displaying them so that FOUCs are prevented. This also works across different image lists. For optimal results, ensure the element has a nice background color as the element is transparent while the first image is loading.

## License
MIT