All Projects → RobinCK → Vue Gallery

RobinCK / Vue Gallery

Licence: mit
📷 Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.

Projects that are alternatives of or similar to Vue Gallery

Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+7188.64%)
Mutual labels:  mobile, gallery, slider, carousel, touch
Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (+405.19%)
Mutual labels:  mobile, gallery, slider, carousel, touch
MediaSliderView
Pure java based, highly customizable media slider gallery supporting both images and videos for android.
Stars: ✭ 85 (-79.01%)
Mutual labels:  gallery, slider, images, carousel
Vue Slick Carousel
🚥Vue Slick Carousel with True SSR Written for ⚡Faster Luxstay
Stars: ✭ 447 (+10.37%)
Mutual labels:  nuxt, slider, carousel, vue-component
Embla Carousel
A lightweight carousel library with fluid motion and great swipe precision.
Stars: ✭ 1,874 (+362.72%)
Mutual labels:  mobile, slider, carousel, touch
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (+384.44%)
Mutual labels:  mobile, gallery, slider, carousel
Keen Slider
The HTML touch slider carousel with the most native feeling
Stars: ✭ 3,097 (+664.69%)
Mutual labels:  mobile, slider, carousel, touch
Egjs Flicking
🎠 ♻️ Everyday 30 million people experience. It's reliable, flexible and extendable carousel.
Stars: ✭ 937 (+131.36%)
Mutual labels:  mobile, slider, carousel
React Siema
ReactSiema Demo
Stars: ✭ 90 (-77.78%)
Mutual labels:  gallery, slider, carousel
Vuetify Swipeout
👆 A swipe out example built with Vue CLI 3 + Vuetify + Swiper.
Stars: ✭ 117 (-71.11%)
Mutual labels:  mobile, slider, touch
React Grid Carousel
React responsive carousel component w/ grid layout
Stars: ✭ 29 (-92.84%)
Mutual labels:  gallery, slider, carousel
React Native Swiper Flatlist
👆 Swiper component implemented with FlatList using Hooks & Typescript + strict automation tests with Detox
Stars: ✭ 217 (-46.42%)
Mutual labels:  images, slider, carousel
Vue Awesome Swiper
🏆 Swiper component for @vuejs
Stars: ✭ 12,072 (+2880.74%)
Mutual labels:  nuxtjs, slider, vue-component
vue-splide
The Splide component for Vue.
Stars: ✭ 257 (-36.54%)
Mutual labels:  slider, carousel, vue-component
skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (-92.35%)
Mutual labels:  gallery, slider, 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 (-56.05%)
Mutual labels:  gallery, touch, carousel
Hammer Slider
DISCONTINUED - HammerSlider touch is a lightweight infinite carousel plugin.
Stars: ✭ 21 (-94.81%)
Mutual labels:  slider, carousel, touch
Veluxi Starter
Veluxi Vue.js Starter Project with Nuxt JS and Vuetify
Stars: ✭ 39 (-90.37%)
Mutual labels:  nuxt, nuxtjs, carousel
vue-piece-slider
animated slides in a fragmented look 🐞🌳✡️📐
Stars: ✭ 95 (-76.54%)
Mutual labels:  slider, images, carousel
jooger.me
👍 My personal website,powered by @nuxt
Stars: ✭ 39 (-90.37%)
Mutual labels:  nuxt, vue-component, nuxtjs

vue-gallery

Greenkeeper badge 📷 VueJS responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.

Example

jsFiddle - image

jsFiddle - video

Install

CDN

Recommended: https://unpkg.com/vue-gallery, which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at https://unpkg.com/vue-gallery/

npm

npm install vue-gallery

Yarn

yarn add vue-gallery

Nuxt

  1. Add a new file named vue-gallery.client.js to your nuxt plugins folder. It is important that your filename ends in .client.js (more info on this convention, only works from Nuxt v.2.4.0).
  2. Copy paste the following content in it:
import Vue from 'vue'
import VueGallery from 'vue-gallery'

Vue.component('VGallery', VueGallery)
  1. Add it to your list of plugins in nuxt.config.js:
plugins: ['~plugins/vue-gallery.client.js']
  1. You can now use the component globally:
<v-gallery :images="images"
           :index="index"
           @close="index = null" />

Usage

VueJS single file (ECMAScript 2015)

<template>
  <div>
    <gallery :images="images" :index="index" @close="index = null"></gallery>
    <div
      class="image"
      v-for="(image, imageIndex) in images"
      :key="imageIndex"
      @click="index = imageIndex"
      :style="{ backgroundImage: 'url(' + image + ')', width: '300px', height: '200px' }"
    ></div>
  </div>
</template>

<script>
  import VueGallery from 'vue-gallery';
  
  export default {
    data: function () {
      return {
        images: [
          'https://dummyimage.com/800/ffffff/000000',
          'https://dummyimage.com/1600/ffffff/000000',
          'https://dummyimage.com/1280/000000/ffffff',
          'https://dummyimage.com/400/000000/ffffff',
        ],
        index: null
      };
    },

    components: {
      'gallery': VueGallery
    },
  }
</script> 

<style scoped>
  .image {
    float: left;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    border: 1px solid #ebebeb;
    margin: 5px;
  }
</style>

Browser (ES5)

  <script type="text/javascript" src="https://unpkg.com/[email protected]/dist/vue.js"></script>
  <script type="text/javascript" src="https://unpkg.com/[email protected]/js/blueimp-helper.js"></script>
  <script type="text/javascript" src="https://unpkg.com/[email protected]/js/blueimp-gallery.js"></script>
  <script type="text/javascript" src="https://unpkg.com/[email protected]/js/blueimp-gallery-fullscreen.js"></script>
  <script type="text/javascript" src="vue-gallery.js"></script>
  <link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/css/blueimp-gallery.min.css">
  

<div id="app">
  <gallery :images="images" :index="index" @close="index = null"></gallery>
  <div
    class="image"
    v-for="image, imageIndex in images"
    @click="index = imageIndex"
    :style="{ backgroundImage: 'url(' + image + ')', width: '300px', height: '200px' }"
  ></div>
</div>

<script type="text/javascript">
  new Vue({
    el: '#app',
    data: function () {
      return {
        images: [
          'https://dummyimage.com/800/ffffff/000000',
          'https://dummyimage.com/1600/ffffff/000000',
          'https://dummyimage.com/1280/000000/ffffff',
          'https://dummyimage.com/400/000000/ffffff'
        ],
        index: null
      };
    },

    components: {
      'gallery': VueGallery
    }
  });
</script>

Props

Props Type Default Description
images Array [] Urls list
index Number null Opened image index
options Object blueimp-gallery options

Events

Name Params Description
onopen
onopened
onslide
onslideend
onslidecomplete
onclose
onclosed

Known Issues

1. Multiple VueGallery components in same page breaks functionalities

Fix: Give each gallery a unique id. jsFiddle Example

2. Images not oriented correctly.

It's because the image isn't in the "correct" orientation and the exif orientation data is what "fixes" the orientation when you view the images. Browsers don't fix the image orientation based on the exif data. Some browsers show it "correctly" when you open the image in a new tab by itself but don't fix it if you use the image link in a src attribute. Relevant stackoverflow.

Fix: Use the onslide callback to read the exif data and "correct" the orientation based of the exif orientation. More info on blueimp-gallery.

jsFiddle Example

Code excerpt:

<gallery :options="options" :images="images" :index="index" @close="index = null"/>
data() {
  //...
  options: {
    onslide: function(index, slide) {
      const rotation = {
        1: 'rotate(0deg)',
        3: 'rotate(180deg)',
        6: 'rotate(90deg)',
        8: 'rotate(270deg)'
      }

    //Conditionally change rotation of image based on the image orientation data. Example jsfiddle --> https://jsfiddle.net/orotemo/obvna6qn/ Or use something like https://github.com/mattiasw/ExifReader
    //But for this example, the fix has been hardcoded. 
      slide.getElementsByTagName(
        'img'
      )[0].style = `transform: ${rotation['3']};`
    }
  }
}

Other my Vue JS plugins

Project Status Description
vue-ls npm Vue plugin for work with local storage, session storage and memory storage from Vue context
vue-popper npm VueJS popover component based on popper.js

Development Setup

# install dependencies
npm install

# build dist files
npm run build

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

FOSSA Status

MIT © Igor Ognichenko

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].