├── .prettierignore ├── .prettierrc ├── docs ├── favicon.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── awsm.opt.min.css └── index.html ├── .github ├── FUNDING.yml └── workflows │ └── node.yml ├── .gitignore ├── .eslintignore ├── .browserslistrc ├── .eslintrc.cjs ├── src ├── index.js └── tinybox.vue ├── LICENSE ├── vite.config.js ├── package.json ├── index.html ├── CONTRIBUTING.md └── README.md /.prettierignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | pnpm-lock.yaml 3 | *.min.css 4 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kytta/vue-tinybox/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: kytta 2 | liberapay: kytta 3 | custom: paypal.me/NickKaramoff 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | /dev/**/*.js* 3 | /dev/nuxt/.nuxt/ 4 | dist 5 | .idea 6 | node_modules 7 | -------------------------------------------------------------------------------- /docs/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kytta/vue-tinybox/HEAD/docs/favicon-16x16.png -------------------------------------------------------------------------------- /docs/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kytta/vue-tinybox/HEAD/docs/favicon-32x32.png -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .cache 2 | /dev/**/tinybox.js 3 | /dev/nuxt/.nuxt/ 4 | dist 5 | .idea 6 | node_modules 7 | vite.config.js 8 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | >=.5% 2 | last 2 versions 3 | not dead 4 | 5 | # Browsers minimal version for critical features 6 | not chrome < 21 # flexbox 7 | not edge < 16 # svg-css 8 | not firefox < 28 # flexbox 9 | not ie < 11 # flexbox 10 | not op_mini all # css-fixed 11 | not safari < 7 # flexbox 12 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-env node */ 2 | require("@rushstack/eslint-patch/modern-module-resolution"); 3 | 4 | module.exports = { 5 | root: true, 6 | extends: [ 7 | "eslint:recommended", 8 | "xo/browser", 9 | "plugin:vue/recommended", 10 | "@vue/eslint-config-prettier", 11 | ], 12 | parserOptions: { 13 | ecmaVersion: "latest", 14 | }, 15 | env: { 16 | browser: true, 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import component from "./tinybox.vue"; 2 | 3 | // Executed by Vue.use() 4 | const install = (Vue) => { 5 | if (install.installed) return; 6 | install.installed = true; 7 | Vue.component(component.name, component); 8 | }; 9 | 10 | // Auto-install when Vue is found 11 | let GlobalVue = null; 12 | if (typeof window !== "undefined") { 13 | GlobalVue = window.Vue; 14 | // eslint-disable-next-line no-undef 15 | } else if (typeof global !== "undefined") { 16 | // eslint-disable-next-line no-undef 17 | GlobalVue = global.Vue; 18 | } 19 | 20 | if (GlobalVue) { 21 | GlobalVue.use({ install }); 22 | } 23 | 24 | // To allow module use 25 | export default component; 26 | -------------------------------------------------------------------------------- /.github/workflows/node.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | branches: 8 | - main 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout the repository 14 | uses: actions/checkout@v3 15 | - name: Install pnpm 16 | uses: pnpm/action-setup@v2 17 | with: 18 | version: latest 19 | - name: Install Node.js 20 | uses: actions/setup-node@v3 21 | with: 22 | node-version: 16 23 | cache: pnpm 24 | - name: Install dependencies 25 | run: pnpm install --ignore-scripts 26 | - name: Lint 27 | run: pnpm lint 28 | env: 29 | FORCE_COLOR: 2 30 | - name: Build 31 | run: pnpm build 32 | env: 33 | FORCE_COLOR: 2 34 | - name: Check size 35 | uses: andresz1/size-limit-action@v1 36 | with: 37 | github_token: ${{ secrets.GITHUB_TOKEN }} 38 | skip_step: build 39 | if: github.event_name == 'pull_request' 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Nikita Karamov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { resolve } from "node:path"; 2 | 3 | import { defineConfig } from "vite"; 4 | import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js"; 5 | import vue from "@vitejs/plugin-vue2"; 6 | 7 | import autoprefixer from "autoprefixer"; 8 | 9 | export default defineConfig({ 10 | build: { 11 | lib: { 12 | entry: resolve("src/index.js"), 13 | name: "Tinybox", 14 | formats: ["es", "umd"], 15 | // Workaround to keep the old file names 16 | fileName: (format) => 17 | format === "es" ? "tinybox.esm.js" : "tinybox.umd.js", 18 | }, 19 | minify: "terser", 20 | terserOptions: { 21 | output: { 22 | ecma: 6, 23 | }, 24 | }, 25 | }, 26 | rollupOptions: { 27 | external: ["vue"], 28 | output: { 29 | // Provide global variables to use in the UMD build 30 | // for externalized deps 31 | globals: { 32 | vue: "Vue", 33 | }, 34 | }, 35 | }, 36 | plugins: [ 37 | vue({ 38 | style: { 39 | postcssPlugins: [autoprefixer], 40 | }, 41 | template: { 42 | compilerOptions: { 43 | whitespace: "condense", 44 | }, 45 | }, 46 | }), 47 | cssInjectedByJsPlugin(), 48 | ], 49 | }); 50 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-tinybox", 3 | "version": "2.0.0-alpha.1", 4 | "description": "A slick, yet tiny lightbox gallery for Vue.js", 5 | "license": "MIT", 6 | "keywords": [ 7 | "vue", 8 | "vuejs", 9 | "vue.js", 10 | "lightbox", 11 | "gallery" 12 | ], 13 | "homepage": "https://os.kytta.dev/vue-tinybox", 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/kytta/vue-tinybox.git" 17 | }, 18 | "bugs": { 19 | "url": "https://github.com/kytta/vue-tinybox/issues" 20 | }, 21 | "author": { 22 | "name": "Nikita Karamov", 23 | "email": "me@kytta.dev", 24 | "url": "https://www.kytta.dev/" 25 | }, 26 | "type": "module", 27 | "main": "./dist/tinybox.umd.js", 28 | "module": "./dist/tinybox.esm.js", 29 | "unpkg": "./dist/tinybox.umd.js", 30 | "exports": { 31 | "require": "./dist/tinybox.umd.js", 32 | "import": "./dist/tinybox.esm.js" 33 | }, 34 | "browser": { 35 | "./sfc": "src/tinybox.vue" 36 | }, 37 | "files": [ 38 | "dist/tinybox.umd.js", 39 | "dist/tinybox.esm.js", 40 | "src/tinybox.vue" 41 | ], 42 | "scripts": { 43 | "build": "vite build", 44 | "dev": "vite", 45 | "fmt": "prettier --write .", 46 | "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --ignore-path .gitignore", 47 | "size": "size-limit", 48 | "pretest": "pnpm run build", 49 | "test": "pnpm run lint && pnpm run size" 50 | }, 51 | "devDependencies": { 52 | "@babel/core": "^7.10.3", 53 | "@babel/preset-env": "^7.10.3", 54 | "@rushstack/eslint-patch": "^1.2.0", 55 | "@size-limit/preset-small-lib": "^4.5.2", 56 | "@vitejs/plugin-vue2": "^2.2.0", 57 | "@vue/eslint-config-prettier": "^7.0.0", 58 | "autoprefixer": "^9.8.4", 59 | "eslint": "^8.33.0", 60 | "eslint-config-xo": "^0.43.1", 61 | "eslint-plugin-vue": "^9.9.0", 62 | "postcss": "^7.0.32", 63 | "prettier": "^2.8.3", 64 | "size-limit": "^4.5.2", 65 | "terser": "^5.16.2", 66 | "vite": "^4.1.1", 67 | "vite-plugin-css-injected-by-js": "^2.4.0", 68 | "vue": "^2", 69 | "vue-eslint-parser": "^9.1.0", 70 | "vue-template-compiler": "^2.7.14" 71 | }, 72 | "size-limit": [ 73 | { 74 | "path": "dist/tinybox.umd.js", 75 | "limit": "3333 B", 76 | "webpack": false 77 | }, 78 | { 79 | "path": "dist/tinybox.esm.js", 80 | "limit": "3333 B" 81 | } 82 | ], 83 | "engines": { 84 | "node": ">=10" 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [DEV] vue-tinybox 6 | 7 | 8 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 |

vue-tinybox demo: vanilla Vue.js

27 |
28 | 29 | 30 |
31 | 32 | 33 |
34 |

Click on any image below to open Tinybox

35 | 36 | 42 | 49 |
50 | 51 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /docs/awsm.opt.min.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /*! 4 | * awsm.css v3.0.4 (https://igoradamenko.github.io/awsm.css/) 5 | * Optimized for https://os.kytta.dev/vue-tinybox 6 | * (c) 2015 Igor Adamenko 7 | * MIT License 8 | */html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Helvetica Neue,Arial,sans-serif;font-size:100%;line-height:1.4;background:#fff;color:#000;-webkit-overflow-scrolling:touch}body{margin:1.2em;font-size:1rem}@media (min-width:20rem){body{font-size:calc(.875rem + .625vw)}}@media (min-width:40rem){body{font-size:1.125rem}}body article,body footer,body header,body main{position:relative;max-width:40rem;margin:0 auto}body>header{margin-bottom:3.5em}body>header h1{margin:0;font-size:1.5em}body>header p{margin:0;font-size:.85em}body>footer{margin-top:6em;padding-bottom:1.5em;text-align:center;font-size:.8rem;color:#aaa}nav{margin:1em 0}nav ul{list-style:none;margin:0;padding:0}nav li{display:inline-block;margin-right:1em;margin-bottom:.25em}nav a:visited{color:#0064c1}nav a:hover{color:#f00000}ul{margin-top:0;padding-top:0;padding-left:2.5em}ul li+li{margin-top:.25em}p{margin:1em 0;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}p:first-child{margin-top:0}p:last-child{margin-bottom:0}p img{float:right;margin-bottom:.5em;margin-left:.5em}aside{margin:.5em 0;font-style:italic;color:#aaa}@media (min-width:65rem){aside{position:absolute;right:-12.5rem;width:9.375rem;max-width:9.375rem;margin:0;padding-left:.5em;font-size:.8em;border-left:1px solid #f2f2f2}}h1,h2,h3{margin:1.25em 0 0;line-height:1.2}h2:focus>a[href^="#"][id]:empty,h2:hover>a[href^="#"][id]:empty{opacity:1}h1+p,h2+p,h3+p{margin-top:.5em}h2>a[href^="#"][id]:empty{position:absolute;left:-.65em;opacity:0;text-decoration:none;font-weight:400;line-height:1;color:#aaa}@media (min-width:40rem){h2>a[href^="#"][id]:empty{left:-.8em}}h2>a[href^="#"][id]:empty:focus,h2>a[href^="#"][id]:empty:hover,h2>a[href^="#"][id]:empty:target{opacity:1;box-shadow:none;color:#000}h2>a[href^="#"][id]:empty:target:focus{outline:none}h2>a[href^="#"][id]:empty:before{content:"§ "}h1{font-size:2.5em}h2{font-size:1.75em}h3{font-size:1.25em}article+article{margin-top:4em}a{color:#0064c1}a:visited{color:#8d39d0}a:active,a:hover{outline-width:0}a:hover{color:#f00000}img{display:block;max-width:100%;margin:0 auto}code{font-family:Consolas,Lucida Console,Monaco,monospace;font-style:normal}pre{overflow-x:auto;font-size:.8em;background:linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.15)) 0 0,linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.15)) 100% 0;background-attachment:scroll,scroll;background-size:1px 100%,1px 100%;background-repeat:no-repeat,no-repeat}pre>code{display:inline-block;overflow-x:visible;box-sizing:border-box;min-width:100%;border-right:3px solid #fff;border-left:1px solid #fff}::selection{background:rgba(0,100,193,.25)} 9 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to vue-tinybox 2 | 3 | Thank you for deciding to contribute to vue-tinybox! There are some things you need to know before starting. 4 | 5 | - [I want to propose a feature or file a bug without writing code](#i-want-to-propose-a-feature-or-file-a-bug-without-writing-code) 6 | - [I want to implement a feature or fix a bug myself](#i-want-to-implement-a-feature-or-fix-a-bug-myself) 7 | - [Branch naming](#branch-naming) 8 | - [Node version](#node-version) 9 | - [Package manager](#package-manager) 10 | - [Dev environment](#dev-environment) 11 | - [Testing](#testing) 12 | - [ESLint](#eslint) 13 | - [size-limit](#size-limit) 14 | - [Pull request](#pull-request) 15 | 16 | ## I want to propose a feature or file a bug without writing code 17 | 18 | If you want to ask a question, propose a new feature or tell us about a bug, you should [create a new issue](https://github.com/kytta/vue-tinybox/issues/new/choose) on the matter. Please make sure to pick the appropriate template and add as much information as you can. The more you tell me, the quicker can I resolve your issue :) 19 | 20 | ## I want to implement a feature or fix a bug myself 21 | 22 | There are rules I follow when I develop vue-tinybox, and I'd like other contributors to follow them too. 23 | 24 | ### Branch naming 25 | 26 | After forking this repo, please create a separate branch for every proposed feature. This is not enforced, but it helps a lot when navigating the PRs. Allowed are automatic names (e.g. 'patch-1') created when using GitHub's online editor. 27 | 28 | ### Node version 29 | 30 | All development should be done on the latest stable Node version with a set major number. Usually, it's the latest LTS release. Right now it is Node 14. You can always check the "Node.js CI" GitHub Action for the used version number. Use nvm if you want to install many Node versions. 31 | 32 | ### Package manager 33 | 34 | When developing or testing vue-tinybox, use Yarn v1 only. NPM and PNPM will not take Yarn's lockfile into account. 35 | 36 | ### Dev environment 37 | 38 | At the moment there are no automatic tests. To help with manual testing, I have created a test page. To have the package be built every time you edit code and to be able to see the changes, run `yarn dev`. This will launch a static file server in the background on port 8629 (TNBX). The webpage will not auto-reload, however — you should do it yourself. The webpage offers useful controls to test the package. 39 | 40 | ### Testing 41 | 42 | Testing consists of two steps: linting and checking the size. To run all tests, run `yarn test`. 43 | 44 | #### ESLint 45 | 46 | I use [ESLint](https://eslint.org/) to lint the code. Setting up an integration with your editor is quite helpful. You don't have to do it — CI will lint your code anyway. Please note that I **do not** accept unlinted code. 47 | 48 | You can run `yarn test:lint` to lint the code yourself. 49 | 50 | #### size-limit 51 | 52 | To keep the package size under control I use [size-limit](https://github.com/ai/size-limit). It is very important for me to keep the package small. Don't worry, if your edits make it go over the limit. Submit the pull request, and we'll figure out the solution together :) 53 | 54 | You can run `yarn test:size` to check the built bundle size. 55 | 56 | ### Pull request 57 | 58 | After your work is done, you can submit a pull request. There are some automated checks. One is from a GitHub Action — it executes `yarn test`. Another one is from Codacy — it checks the code quality. Please fix the issues detected by Codacy! 59 | 60 | --- 61 | 62 | After you submitted your issue or pull request, I will reach out to you and get the needed things done. Don't hesitate commenting on my decisions if you find them incorrect or unclear. 63 | 64 | If you have any questions, you can always contact me at [me@kytta.dev](mailto:me@kytta.dev) 65 | 66 | Thank you once again for participating in the life of vue-tinybox! 67 | 68 | -- _Nikita Karamov_ 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-tinybox 2 | 3 | Milky Way emoji 4 | 5 | A slick, yet tiny lightbox gallery for Vue.js 6 | 7 | - **Slick.** No excessive design. Pictures, thumbnails, controls. 8 | - **Tiny.** Dependency-free. 3 KB minified and gzipped. 9 | - **Adaptive.** Works on computers. Works on tablets. Works on phones. 10 | 11 | ## Demo 12 | 13 | Observe the live demo here: [os.kytta.dev/vue-tinybox](https://os.kytta.dev/vue-tinybox) 14 | 15 | ## Basic usage 16 | 17 | ```html 18 | 19 | ``` 20 | 21 | ## Install 22 | 23 | ### Browsers 24 | 25 | 1. Include the link to Tinybox in `` alongside Vue.js: 26 | 27 | ```html 28 | 29 | 30 | ``` 31 | 32 | 2. Tinybox will auto-install upon detecting the global Vue instance. You can use 33 | it right away. 34 | 35 | ### Node environment 36 | 37 | 1. Install the Tinybox package: 38 | 39 | ```sh 40 | npm install vue-tinybox 41 | # or 42 | yarn add vue-tinybox 43 | ``` 44 | 45 | 2. Register it as you usually would: 46 | 47 | ```js 48 | import Tinybox from "vue-tinybox"; 49 | // or 50 | const Tinybox = require("vue-tinybox"); 51 | 52 | Vue.component("Tinybox", Tinybox); 53 | //or 54 | Vue.use(Tinybox); 55 | //or 56 | new Vue({ 57 | components: { Tinybox }, 58 | // ... 59 | }); 60 | ``` 61 | 62 | ## API 63 | 64 | ### Image object 65 | 66 | An `Image` object is an object with following fields: 67 | 68 | | Field name | Type | Description | 69 | | ----------- | -------- | ---------------------------------------------------------------- | 70 | | `src` | `String` | Image URL | 71 | | `thumbnail` | `String` | (optional) Thumbnail URL. If omitted, the image URL will be used | 72 | | `caption` | `String` | (optional) Caption text to be overlayed on the image | 73 | | `alt` | `String` | (optional) Alt text. If omitted, the caption will be used | 74 | 75 | ### Props 76 | 77 | | Prop name | Type | Default | Description | 78 | | ----------- | --------- | ------- | ------------------------------------------------------------- | 79 | | `images` | `Array` | `[]` | List of either image URLs or [`Image`](#image-object) objects | 80 | | `loop` | `Boolean` | `false` | Indicates whether the images should loop | 81 | | `no-thumbs` | `Boolean` | `false` | When enabled, the thumbnails are hidden | 82 | 83 | ### `v-model` 84 | 85 | You can use `v-model` on a `Number` variable, which will hold the index of the 86 | image currently open. If no image is open (i.e. Tinybox is closed), the value 87 | becomes `null`. 88 | 89 | Instead of `v-model` you can use the `index` prop and `change` event: 90 | 91 | ```html 92 | 93 | 94 | 95 | 96 | 97 | ``` 98 | 99 | ### Events 100 | 101 | | Event name | Payload | Description | 102 | | ------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------ | 103 | | `change` | index of the image changed to | Is emitted on any image change (thumbnail navigation, prev/next, close) | 104 | | `prev`/`next` | index of the image changed to | Is emitted specifically when the user clicks "Prev"/"Next" or presses Left/Right arrow key | 105 | | `close` | index of the image Tinybox was closed at | Is emitted specifically when the user clicks "Close" or presses the Esc key | 106 | 107 | Events can come in handy for business logic cases: 108 | 109 | ```html 110 | 118 | ``` 119 | 120 | ```js 121 | export default { 122 | // ... 123 | methods: { 124 | onChange(index) { 125 | console.log("User navigated to the photo: ", index); 126 | }, 127 | onPrevious(index) { 128 | console.log("User clicked 'previous' to switch to: ", index); 129 | }, 130 | onNext(index) { 131 | console.log("User clicked 'previous' to switch to: ", index); 132 | }, 133 | onClose(index) { 134 | console.log("User closed TinyBox on this photo: ", index); 135 | }, 136 | }, 137 | }; 138 | ``` 139 | 140 | ## Browser support 141 | 142 | | ![Chrome][chrome] | ![Firefox][firefox] | ![Safari][safari] | ![MS Edge][edge] | ![Internet Explorer][ie] | 143 | | :---------------: | :-----------------: | :---------------: | :--------------: | :----------------------: | 144 | | **21+** | **28+** | **7+** | **16+** | **11** | 145 | 146 | [chrome]: https://github.com/alrra/browser-logos/raw/master/src/chrome/chrome_48x48.png 147 | [firefox]: https://github.com/alrra/browser-logos/raw/master/src/firefox/firefox_48x48.png 148 | [safari]: https://github.com/alrra/browser-logos/raw/master/src/safari/safari_48x48.png 149 | [edge]: https://github.com/alrra/browser-logos/raw/master/src/edge/edge_48x48.png 150 | [ie]: https://github.com/alrra/browser-logos/raw/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png 151 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 13 | 14 | 15 | 16 | vue-tinybox | A slick, yet tiny lightbox gallery for Vue.js 17 | 18 | 19 | 20 | 21 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
36 |

37 | Milky Way emoji 43 |

44 |

vue-tinybox

45 |

A slick, yet tiny lightbox gallery for Vue.js

46 | 66 |
67 | 68 |
69 |
70 |

71 | 72 | What is it? 73 |

74 | 75 |

Tinybox is a simple lightbox gallery for Vue.js.

76 | 77 |

78 | While being not as customizable as some other lightboxes, Tinybox is 79 | very slick and lightweight (3 KB minzipped). Tinybox is great on 80 | mobile devices too: it supports swipe gestures and changes its size 81 | responsively. 82 |

83 | 94 | 95 |
<Tinybox
 96 |     v-model="index"
 97 |     :images="images"
 98 | />
99 |
100 | 101 |
102 |

103 | 104 | Demo 105 |

106 |

Click on any image below to open Tinybox

107 | 108 | 109 | 110 | 117 |
118 | 119 |
120 |

121 | 122 | Install 123 |

124 | 125 |

Browsers

126 |

127 | Include the link to Tinybox in <head> alongside 128 | Vue.js: 129 |

130 |
<script src="https://cdn.jsdelivr.net/npm/vue-tinybox"></script>
131 | 132 |

Node.js

133 |

Install the Tinybox package and register it as you usually would:

134 |
$ npm install vue-tinybox
135 |
import Tinybox from "vue-tinybox";
136 | Vue.component('Tinybox', Tinybox);
137 |
138 | 139 |
140 |

API and more

141 | 142 |

143 | For API docs and more info on installation consult the 144 | README. 149 |

150 |
151 |
152 | 153 |
154 |

155 | vue-tinybox by 156 | Nikita Karamov 159 |

160 |

161 | Website built with 162 | awsm.css 168 |

169 |
170 | 171 | 172 | 176 | 177 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /src/tinybox.vue: -------------------------------------------------------------------------------- 1 | 68 | 69 | 331 | 332 | 473 | --------------------------------------------------------------------------------