All Projects → pawelgrzybek → Siema

pawelgrzybek / Siema

Licence: other
Siema - Lightweight and simple carousel in pure JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Siema

nglp-angular-material-landing-page
NGLP is an Angular Material Landing Page.
Stars: ✭ 32 (-99.06%)
Mutual labels:  carousel
ui-carousel
🎨 Angular carousel Component 🔥
Stars: ✭ 84 (-97.52%)
Mutual labels:  carousel
Ngu Carousel
Angular Universal carousel
Stars: ✭ 263 (-92.24%)
Mutual labels:  carousel
react-native-imaged-carousel-card
Fully customizable & Lovely Imaged Carousel Card for React Native
Stars: ✭ 70 (-97.94%)
Mutual labels:  carousel
SJCenterFlowLayout
Carousel flow layout for UICollectionView on iOS.
Stars: ✭ 34 (-99%)
Mutual labels:  carousel
react-gesture-gallery
a react image gallery with gesture support
Stars: ✭ 14 (-99.59%)
Mutual labels:  carousel
shopify-product-image-slider
Implementation of the Slick image carousel into a Shopify store
Stars: ✭ 21 (-99.38%)
Mutual labels:  carousel
Vue Picture Swipe
🖼 Vue Picture Swipe Gallery (a gallery of image with thumbnails, lazy-load and swipe) backed by photoswipe
Stars: ✭ 322 (-90.5%)
Mutual labels:  carousel
react-native-carousel
React Native carousel
Stars: ✭ 35 (-98.97%)
Mutual labels:  carousel
react-styled-carousel
React styled components carousel or slide show. No external css import is required.
Stars: ✭ 42 (-98.76%)
Mutual labels:  carousel
react-native-animated-carousel
🦄 A wonderful animated carsouel hooks component for React-Native
Stars: ✭ 16 (-99.53%)
Mutual labels:  carousel
ngx-image-gallery
Probably the best Angular 4+ modal and inline image gallery. Angular upgrade for ng-image-gallery.
Stars: ✭ 80 (-97.64%)
Mutual labels:  carousel
zSlider
A pure JavaScript Carousel/Slider plugin that works well at Mobile/PC
Stars: ✭ 12 (-99.65%)
Mutual labels:  carousel
hugo-travelify-theme
Port of Aigars Silkalns's Wordpress theme Travelify to Hugo. Demo -
Stars: ✭ 34 (-99%)
Mutual labels:  carousel
Flutter swiper
The best swiper for flutter , with multiple layouts, infinite loop. Compatible with Android & iOS.
Stars: ✭ 3,209 (-5.34%)
Mutual labels:  carousel
react-gallery-carousel
Mobile-friendly gallery carousel 🎠 with server side rendering, lazy loading, fullscreen, thumbnails, touch, mouse emulation, RTL, keyboard navigation and customisations.
Stars: ✭ 178 (-94.75%)
Mutual labels:  carousel
CarouselGifViewer
Efficiently display a list of GIFs in a carousel (RecyclerView).
Stars: ✭ 33 (-99.03%)
Mutual labels:  carousel
Vueper Slides
A touch ready and responsive slideshow / carousel for Vue & Vue 3.
Stars: ✭ 319 (-90.59%)
Mutual labels:  carousel
Ngx Drag Scroll
A lightweight responsive Angular carousel library
Stars: ✭ 292 (-91.39%)
Mutual labels:  carousel
tiny-wheels
一套基于原生JavaScript开发的组件库,无依赖、体积小、简单易用
Stars: ✭ 60 (-98.23%)
Mutual labels:  carousel

Hi. I will be discontinuing active maintenance of Siema. I built it by myself to use on one of my projects. Two years later I consider carousels as an anti-pattern and I would suggest you to find a better UI pattern than carousel for your current project. If you really want to use it, feel free. If you have any questions, please look for the answer in closed issues section. Would you like to contribute or coutinue maintenance of Siema? Fantastic!


Siema - Lightweight and simple carousel with no dependencies

Full docs with examples: https://pawelgrzybek.github.io/siema/.

Siema is a lightweight (only 3kb gzipped) carousel plugin with no dependencies and no styling. As Brad Frost once said "do that shit yourself". It is 100% open source and available on Github. It is free to use on personal and commercial projects. Use it with your favourite module bundler or by manually injecting the script into your project.

Installation

Setup is trivially easy. A little bit of markup...

<div class="siema">
  <div>Hi, I'm slide 1</div>
  <div>Hi, I'm slide 2</div>
  <div>Hi, I'm slide 3</div>
  <div>Hi, I'm slide 4</div>
</div>

If you are using a module bundler like Webpack or Browserify...

yarn add siema
import Siema from 'siema';
new Siema();

...or manually inject the minified script into your website.

<script src="siema.min.js"></script>
<script>
  new Siema();
</script>

Options

Siema comes with a few (optional) settings that you can change by passing an object as an argument. Default values are presented below.

new Siema({
  selector: '.siema',
  duration: 200,
  easing: 'ease-out',
  perPage: 1,
  startIndex: 0,
  draggable: true,
  multipleDrag: true,
  threshold: 20,
  loop: false,
  rtl: false,
  onInit: () => {},
  onChange: () => {},
});

selector (string or DOM element)
The selector to use as a carousel. Siema will use all immediate children of this selector as a slider items. It can be a query string (example) or DOM element (example).

duration (number)
Slide transition duration in milliseconds (example).

easing (string)
It is like a CSS transition-timing-function — describes acceleration curve (example).

perPage (number or object)
The number of slides to be shown. It accepts a number (example) or an object (example) for complex responsive layouts.

startIndex (number)
Index (zero-based) of the starting slide (example).

draggable (boolean)
Use dragging and touch swiping (example).

multipleDrag (boolean)
Allow dragging to move multiple slides.

threshold (number)
Touch and mouse dragging threshold (in px) (example).

loop (boolean)
Loop the slides around (example).

rtl (boolean)
Enables layout for languages written from right to left (like Hebrew or Arabic) (example).

onInit (function)
Runs immediately after initialization (example).

onChange (function)
Runs after slide change (example).

API

As mentioned above, Siema doesn't come with many options - just a few useful methods. Combine it with some very basic JavaScript and voila!

prev(howManySlides = 1, callback)
Go to previous item (example). Optionally slide few items backward by passing howManySlides (number) argument (example). Optional callback (function) available as a third argument (example).

next(howManySlides = 1, callback)
Go to next item (example). Optionally slide few items forward by passing howManySlides (number) argument (example). Optional callback (function) available as a third argument (example).

goTo(index, callback)
Go to item at particular index (number) (example). Optional callback (function) available as a second argument (example).

remove(index, callback)
Remove item at particular index (number) (example). Optional callback (function) available as a second argument (example).

insert(item, index, callback)
Insert new item (DOM element) at specific index (number) (example). Optional callback (function) available as a third argument (example).

prepend(item, callback)
Prepend new item (DOM element) (example). Optional callback (function) available as a second argument (example).

append(item, callback)
Append new item (DOM element) (example). Optional callback (function) available as a second argument (example).

destroy(restoreMarkup = false, callback)
Remove all event listeners on instance (example). Use restoreMarkup to restore the initial markup inside selector (example). Optional callback (function) available as a third argument (example).

currentSlide
Prints current slide index (example).

Browser support

  • IE10
  • Chrome 12
  • Firefox 16
  • Opera 15
  • Safari 5.1
  • Android Browser 4.0
  • iOS Safari 6.0

Extra & Thanks

Siema means 'hello' in Polish. When I play around with some code, I always use random names. That's the whole story behind the name of this one :)

Huge thanks to Jarkko Sibenberg for the cute logo design! I can't thank BrowserStack enough for giving me a free access to their testing amazing service.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].