Skip to content

Commit

Permalink
updated readme and demos
Browse files Browse the repository at this point in the history
  • Loading branch information
ehassaan committed Aug 4, 2023
1 parent c9095ee commit bf0fc79
Show file tree
Hide file tree
Showing 21 changed files with 1,176 additions and 107 deletions.
30 changes: 10 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
# vue-zoomable-cute
# vue-zoomable

Tiny and high performance zoom and pan library for Vue 3. It uses CSS Transforms which provides hardware acceleration.

Checkout the [demos](https://hassaanakbar.github.io/vue-zoomable/demos/).

## Why the fork?

Because I wanna have more controll!!

> _laughs in an evil manner_
xD

I will still make pr for changes though.

## Installation

```sh
npm install vue-zoomable-cute
# or
yarn add vue-zoomable-cute
```
`npm install vue-zoomable`

## Usage

Immediate child of VueZoomable must be either svg or an html container.


```vue
<template>
<VueZoomable
Expand All @@ -44,10 +29,11 @@ Immediate child of VueZoomable must be either svg or an html container.
</template>
<script setup lang="ts">
import VueZoomable from "vue-zoomable-cute";
import "vue-zoomable-cute/dist/style.css";
import VueZoomable from "vue-zoomable";
import "vue-zoomable/dist/style.css";
</script>
```

### Model

- v-model:zoom
Expand Down Expand Up @@ -80,7 +66,9 @@ All props other than `selector` are observable and can be changed after initiali

### Document Flow

If you have any document flow whatsoever on your page, it certainly won't do if you can only zoom with the mouse wheel. Because that would scroll the document at the same time. One sollution might be to do some weird stuff with prevent default or smth. But that gets messy REAAAL quickly.
If you have any document flow whatsoever on your page, it certainly won't do if you can only zoom with the mouse wheel. Because that would scroll the document at the same time. Thanks to [Hellow2](https://github.com/HeIIow2) for document flow and control buttons features.

---

My sollution was inspired by [Google-Maps](https://developers.google.com/maps/documentation/javascript/examples/control-default). You can set the prop `enableWheelOnKey` to whatever key button you like. _(Every value that can be found in KeyEvents `event.key` are valid and should work)_. If `enableWheelOnKey` is set, the zoom on Wheel will only work, if simmultaniously the corresponding Button is pressed.

Expand All @@ -99,6 +87,8 @@ Now usually `Control` + `wheel` zooms in and out of the viewport. This... isn't

Because this could be unintuitive, I implemented a message that tells you what you need to do to actually zoom, that appears after you would have zoomed without this. Just like [Google](https://developers.google.com/maps/documentation/javascript/examples/control-default) did.

---

### Events

- panned
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"vuepress": "2.0.0-beta.66"
},
"dependencies": {
"vue-zoomable": "^1.1.3"
"vue-zoomable": "^1.1"
}
}
20 changes: 13 additions & 7 deletions docs/src/.vuepress/.cache/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
{
"hash": "68b3f5e5",
"browserHash": "7290a27e",
"hash": "37e6c00c",
"browserHash": "18f6553b",
"optimized": {
"@vue/devtools-api": {
"src": "../../../../node_modules/.pnpm/@[email protected]/node_modules/@vue/devtools-api/lib/esm/index.js",
"file": "@vue_devtools-api.js",
"fileHash": "0986c0db",
"fileHash": "89d88f26",
"needsInterop": false
},
"@vuepress/shared": {
"src": "../../../../node_modules/.pnpm/@[email protected]/node_modules/@vuepress/shared/dist/index.js",
"file": "@vuepress_shared.js",
"fileHash": "59941662",
"fileHash": "ba68d25d",
"needsInterop": false
},
"@vueuse/core": {
"src": "../../../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@vueuse/core/index.mjs",
"file": "@vueuse_core.js",
"fileHash": "1abe57d8",
"fileHash": "24141d58",
"needsInterop": false
},
"vue": {
"src": "../../../../node_modules/.pnpm/[email protected]/node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "6b828bb5",
"fileHash": "b910b2bd",
"needsInterop": false
},
"vue-router": {
"src": "../../../../node_modules/.pnpm/[email protected][email protected]/node_modules/vue-router/dist/vue-router.esm-bundler.js",
"file": "vue-router.js",
"fileHash": "bceea853",
"fileHash": "8b5e06f9",
"needsInterop": false
},
"vue-zoomable": {
"src": "../../../../node_modules/.pnpm/[email protected]/node_modules/vue-zoomable/dist/vue-zoomable.mjs",
"file": "vue-zoomable.js",
"fileHash": "51206eea",
"needsInterop": false
}
},
Expand Down
Loading

0 comments on commit bf0fc79

Please sign in to comment.