Skip to content

Commit cb49dc8

Browse files
committed
Initial commit, squash trash, v0.0.2 🎉
0 parents  commit cb49dc8

30 files changed

+7898
-0
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": [ "es2015" ]
3+
}

.eslintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "eslint:recommended",
4+
"env": {
5+
"node": true,
6+
"mocha": true
7+
}
8+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
*.swp
3+
*.swo
4+
coverage

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- "4.0"
4+
- "5.0"

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# v-img
2+
[![npm version](https://badge.fury.io/js/v-img.svg)](https://badge.fury.io/js/v-img)
3+
4+
> Image viewer never been that easy to setup. :foggy:
5+
6+
![demo gif](https://media.giphy.com/media/xUPGcK6vveKz3VpHtC/giphy.gif)
7+
8+
[More examples](https://crowdbotics.github.io/v-img/demo/index.html)
9+
10+
## Browser support
11+
| Browser | Minimum version |
12+
|:--:|:--:|
13+
| Firefox (desktop) | :question: |
14+
| Chrome (desktop) | :question: |
15+
| Safari (desktop) | :question: |
16+
| Opera (desktop) | :question: |
17+
| Firefox (mobile) | :question: |
18+
| Chrome (mobile) | :question: |
19+
| Safari (mobile) | :question: |
20+
| Opera mini (mobile) | :question: |
21+
> Will be filled soon.
22+
23+
## Getting started
24+
1. Install plugin with yarn or npm
25+
```bash
26+
yarn add v-img
27+
```
28+
or
29+
```bash
30+
npm install v-img --save
31+
```
32+
2. Use plugin before creating Vue instance
33+
```javascript
34+
import Vue from 'vue';
35+
import VueImg from 'v-img';
36+
37+
Vue.use(VueImg);
38+
new Vue({...})
39+
```
40+
3. Add `v-img` directive to the image
41+
```vue
42+
<img v-img src="...">
43+
```
44+
45+
## Available options
46+
To open only one image don't specify any directive argument:
47+
```vue
48+
<img v-img src="...">
49+
```
50+
To specify groups of images (to be able to scroll around them when opened, show counter in top left corner) add similar argument to directives:
51+
```vue
52+
<img v-img:name src="...">
53+
<img v-img:name src="...">
54+
```
55+
There are some available options we can specify as value of the directive:
56+
```vue
57+
<img v-img="{...}" src="...">
58+
```
59+
| Option | Description | Default value |
60+
| :----: | :---------: | :-----------: |
61+
| src | Source of image will be displayed | src attribute from html tag|
62+
| cursor| Cursor when hovering original `<img>` | 'pointer' |
63+
64+
## TODO :pencil:
65+
66+
- [ ] Preload all custom soruces of opened group
67+
- [ ] Always show control bottons on mobiles
68+
- [ ] Add tests

demo/.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
["latest", {
4+
"es2015": { "modules": false }
5+
}]
6+
]
7+
}

demo/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
node_modules/
3+
npm-debug.log
4+
yarn-error.log

demo/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# demo
2+
3+
> A Vue.js project
4+
5+
## Build Setup
6+
7+
``` bash
8+
# install dependencies
9+
npm install
10+
11+
# serve with hot reload at localhost:8080
12+
npm run dev
13+
14+
# build for production with minification
15+
npm run build
16+
```
17+
18+
For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).

demo/dist/build.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/dist/build.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)