{"id":13938022,"url":"https://github.com/RobinCK/vue-gallery","last_synced_at":"2025-07-20T00:31:41.059Z","repository":{"id":57396024,"uuid":"93592438","full_name":"RobinCK/vue-gallery","owner":"RobinCK","description":":camera: Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. 🇺🇦","archived":false,"fork":false,"pushed_at":"2023-08-06T19:37:35.000Z","size":915,"stargazers_count":469,"open_issues_count":43,"forks_count":82,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-11T05:57:21.599Z","etag":null,"topics":["carousel","gallery","images","mobile","nuxt","nuxtjs","pictures","slider","touch","vue","vue-component","vuejs"],"latest_commit_sha":null,"homepage":"https://robinck.github.io/vue-gallery/","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobinCK.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"open_collective":"vue-gallery"}},"created_at":"2017-06-07T04:26:55.000Z","updated_at":"2025-05-18T01:59:27.000Z","dependencies_parsed_at":"2022-09-16T12:11:21.185Z","dependency_job_id":"a2053531-3cb7-42bf-903a-446ad345ea6f","html_url":"https://github.com/RobinCK/vue-gallery","commit_stats":{"total_commits":139,"total_committers":19,"mean_commits":7.315789473684211,"dds":0.525179856115108,"last_synced_commit":"0f02f4233dfc0a96bda6a206160f11461ba3d3d9"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/RobinCK/vue-gallery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinCK%2Fvue-gallery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinCK%2Fvue-gallery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinCK%2Fvue-gallery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinCK%2Fvue-gallery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobinCK","download_url":"https://codeload.github.com/RobinCK/vue-gallery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobinCK%2Fvue-gallery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265437673,"owners_count":23765128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carousel","gallery","images","mobile","nuxt","nuxtjs","pictures","slider","touch","vue","vue-component","vuejs"],"created_at":"2024-08-07T23:04:10.562Z","updated_at":"2025-07-20T00:31:36.005Z","avatar_url":"https://github.com/RobinCK.png","language":"Vue","funding_links":["https://opencollective.com/vue-gallery","https://opencollective.com/vue-gallery/contribute","https://opencollective.com/vue-gallery/organization/0/website","https://opencollective.com/vue-gallery/organization/1/website","https://opencollective.com/vue-gallery/organization/2/website","https://opencollective.com/vue-gallery/organization/3/website","https://opencollective.com/vue-gallery/organization/4/website","https://opencollective.com/vue-gallery/organization/5/website","https://opencollective.com/vue-gallery/organization/6/website","https://opencollective.com/vue-gallery/organization/7/website","https://opencollective.com/vue-gallery/organization/8/website","https://opencollective.com/vue-gallery/organization/9/website"],"categories":["Vue","UI组件","Components \u0026 Libraries","UI Components [🔝](#readme)","UI Components"],"sub_categories":["覆盖","UI Components","Overlay"],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://cdn.rawgit.com/RobinCK/vue-gallery/a08dae25/doc/gallery.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://opencollective.com/vue-gallery\" alt=\"Financial Contributors on Open Collective\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/all/badge.svg?label=financial+contributors\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/RobinCK/vue-gallery\"\u003e\u003cimg src=\"https://img.shields.io/badge/vuejs-2.x-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vue-gallery\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/vue-gallery.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e  \n  \n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://david-dm.org/RobinCK/vue-gallery\"\u003e\u003cimg src=\"https://david-dm.org/RobinCK/vue-gallery.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://david-dm.org/RobinCK/vue-gallery?type=dev\"\u003e\u003cimg src=\"https://david-dm.org/RobinCK/vue-gallery/dev-status.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/RobinCK/vue-gallery\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/vue-gallery.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/RobinCK/vue-gallery/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/vue-gallery.svg?style=flat-square\"\u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n# vue-gallery\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/RobinCK/vue-gallery.svg)](https://greenkeeper.io/)\n:camera: VueJS responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.\n\n## Example\n\n[jsFiddle - image](https://fiddle.jshell.net/Robin_ck/LffrLb2k/show/light/)\n\n[jsFiddle - video](https://fiddle.jshell.net/Robin_ck/djqcrm8m/show/light/)\n\n## Install\n#### CDN\n\nRecommended: 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/\n\n#### npm\n\n``` bash\nnpm install vue-gallery\n\n```\n\n#### Yarn\n\n``` bash\nyarn add vue-gallery\n\n```\n\n### Nuxt\n\n1. 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](https://nuxtjs.org/guide/plugins/#name-conventional-plugin), only works from Nuxt v.2.4.0).\n2. Copy paste the following content in it:\n```js\nimport Vue from 'vue'\nimport VueGallery from 'vue-gallery'\n\nVue.component('VGallery', VueGallery)\n```\n3. Add it to your list of plugins in `nuxt.config.js`:\n```js\nplugins: ['~plugins/vue-gallery.client.js']\n```\n4. You can now use the component globally:\n```js\n\u003cv-gallery :images=\"images\"\n           :index=\"index\"\n           @close=\"index = null\" /\u003e\n```\n\n## Usage\n\n### VueJS single file (ECMAScript 2015)\n```html\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cgallery :images=\"images\" :index=\"index\" @close=\"index = null\"\u003e\u003c/gallery\u003e\n    \u003cdiv\n      class=\"image\"\n      v-for=\"(image, imageIndex) in images\"\n      :key=\"imageIndex\"\n      @click=\"index = imageIndex\"\n      :style=\"{ backgroundImage: 'url(' + image + ')', width: '300px', height: '200px' }\"\n    \u003e\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\n  import VueGallery from 'vue-gallery';\n  \n  export default {\n    data: function () {\n      return {\n        images: [\n          'https://dummyimage.com/800/ffffff/000000',\n          'https://dummyimage.com/1600/ffffff/000000',\n          'https://dummyimage.com/1280/000000/ffffff',\n          'https://dummyimage.com/400/000000/ffffff',\n        ],\n        index: null\n      };\n    },\n\n    components: {\n      'gallery': VueGallery\n    },\n  }\n\u003c/script\u003e \n\n\u003cstyle scoped\u003e\n  .image {\n    float: left;\n    background-size: cover;\n    background-repeat: no-repeat;\n    background-position: center center;\n    border: 1px solid #ebebeb;\n    margin: 5px;\n  }\n\u003c/style\u003e\n\n```\n\n### Browser (ES5)\n```html\n  \u003cscript type=\"text/javascript\" src=\"https://unpkg.com/vue@2.4.3/dist/vue.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\" src=\"https://unpkg.com/blueimp-gallery@2.27.0/js/blueimp-helper.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\" src=\"https://unpkg.com/blueimp-gallery@2.27.0/js/blueimp-gallery.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\" src=\"https://unpkg.com/blueimp-gallery@2.27.0/js/blueimp-gallery-fullscreen.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\" src=\"vue-gallery.js\"\u003e\u003c/script\u003e\n  \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"https://unpkg.com/blueimp-gallery@2.27.0/css/blueimp-gallery.min.css\"\u003e\n  \n\n\u003cdiv id=\"app\"\u003e\n  \u003cgallery :images=\"images\" :index=\"index\" @close=\"index = null\"\u003e\u003c/gallery\u003e\n  \u003cdiv\n    class=\"image\"\n    v-for=\"image, imageIndex in images\"\n    @click=\"index = imageIndex\"\n    :style=\"{ backgroundImage: 'url(' + image + ')', width: '300px', height: '200px' }\"\n  \u003e\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cscript type=\"text/javascript\"\u003e\n  new Vue({\n    el: '#app',\n    data: function () {\n      return {\n        images: [\n          'https://dummyimage.com/800/ffffff/000000',\n          'https://dummyimage.com/1600/ffffff/000000',\n          'https://dummyimage.com/1280/000000/ffffff',\n          'https://dummyimage.com/400/000000/ffffff'\n        ],\n        index: null\n      };\n    },\n\n    components: {\n      'gallery': VueGallery\n    }\n  });\n\u003c/script\u003e\n```\n\n## Props\n\n| Props               | Type      | Default                                         | Description  |\n| --------------------|:----------| ------------------------------------------------|--------------|\n| images              | Array     | []                                              | Urls list  |\n| index               | Number    | null                                            | Opened image index  |\n| options             | Object    |                                                 | [blueimp-gallery](https://github.com/blueimp/Gallery) options |\n\n\n\n## Events\n| Name             | Params                  | Description  |\n| -----------------|:------------------------|--------------|\n| onopen           |                         |         |\n| onopened         |                         |         |\n| onslide          |                         |         |\n| onslideend       |                         |         |\n| onslidecomplete  |                         |         |\n| onclose          |                         |         |\n| onclosed         |                         |         |\n\n\n## Known Issues\n\n### 1. Multiple VueGallery components in same page breaks functionalities\n\n**Fix:** Give each gallery a unique id. [jsFiddle Example](https://jsfiddle.net/sam_saama/nzjp13ec/)\n\n### 2. Images not oriented correctly.\n\nIt'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](https://stackoverflow.com/questions/24658365/img-tag-displays-wrong-orientation).\n\n**Fix:** Use the `onslide` callback to read the exif data and \"correct\" the orientation based of the exif orientation. [More info on blueimp-gallery](https://github.com/blueimp/Gallery#event-callbacks).\n\n[jsFiddle Example](https://jsfiddle.net/sam_saama/72k0xr3n/)\n\nCode excerpt:\n\n```html\n\u003cgallery :options=\"options\" :images=\"images\" :index=\"index\" @close=\"index = null\"/\u003e\n```\n\n```js\ndata() {\n  //...\n  options: {\n    onslide: function(index, slide) {\n      const rotation = {\n        1: 'rotate(0deg)',\n        3: 'rotate(180deg)',\n        6: 'rotate(90deg)',\n        8: 'rotate(270deg)'\n      }\n\n    //Conditionally change rotation of image based on the image orientation data. Example jsfiddle --\u003e https://jsfiddle.net/orotemo/obvna6qn/ Or use something like https://github.com/mattiasw/ExifReader\n    //But for this example, the fix has been hardcoded. \n      slide.getElementsByTagName(\n        'img'\n      )[0].style = `transform: ${rotation['3']};`\n    }\n  }\n}\n\n```\n\n## Other my Vue JS plugins\n\n| Project | Status | Description |\n|---------|--------|-------------|\n| [vue-ls](https://github.com/RobinCK/vue-ls)    | ![npm](https://img.shields.io/npm/v/vue-ls.svg)  | Vue plugin for work with local storage, session storage and memory storage from Vue context |\n| [vue-popper](https://github.com/RobinCK/vue-popper)      | ![npm](https://img.shields.io/npm/v/vue-popperjs.svg) | VueJS popover component based on \u003ca href=\"https://popper.js.org/\"\u003epopper.js\u003c/a\u003e |\n\n\n## Development Setup\n\n``` bash\n# install dependencies\nnpm install\n\n# build dist files\nnpm run build\n```\n\n## Contributors\n\n### Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/RobinCK/vue-gallery/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/vue-gallery/contribute)]\n\n#### Individuals\n\n\u003ca href=\"https://opencollective.com/vue-gallery\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/individuals.svg?width=890\"\u003e\u003c/a\u003e\n\n#### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/vue-gallery/contribute)]\n\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/0/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/1/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/2/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/3/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/3/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/4/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/4/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/5/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/5/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/6/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/6/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/7/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/7/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/8/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/8/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/vue-gallery/organization/9/website\"\u003e\u003cimg src=\"https://opencollective.com/vue-gallery/organization/9/avatar.svg\"\u003e\u003c/a\u003e\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FRobinCK%2Fvue-gallery.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FRobinCK%2Fvue-gallery?ref=badge_large)\n\nMIT © [Igor Ognichenko](https://github.com/RobinCK)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobinCK%2Fvue-gallery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRobinCK%2Fvue-gallery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobinCK%2Fvue-gallery/lists"}