An open API service indexing awesome lists of open source software.

https://github.com/gxanshu/grapesjs-zoom-plugin

stupidly simple zoom plugin for grapesjs
https://github.com/gxanshu/grapesjs-zoom-plugin

grapesjs grapesjs-builder grapesjs-plugin

Last synced: about 1 month ago
JSON representation

stupidly simple zoom plugin for grapesjs

Awesome Lists containing this project

README

        

# Grapesjs Zoom Plugin

[DEMO](https://codesandbox.io/s/sharp-haslett-dwcpvt?file=/src/index.js)

### HTML
```html


```

### JS
```js
const editor = grapesjs.init({
container: '#gjs',
height: '100%',
fromElement: true,
storageManager: false,
plugins: ['grapesjs-zoom-plugin'],
});
```

### CSS
```css
body, html {
margin: 0;
height: 100%;
}
```

## Summary

* Plugin name: `grapesjs-zoom-plugin`
super simple plugin for canvas zoom in zoom out. this plugin works with the api of canvas of the grapesjs.

there are two buttons in the `Panel` to control the canvas if you want the keyboard shortcut then its `shift -` for zoom out and `shift =` for zoom in.

in any case you have issue with the keyboard shortcuts keys then please open a [issue](https://github.com/gxanshu/grapesjs-zoom-plugin/issues/new) i am happy to help!

## Download

* CDN
* `https://unpkg.com/grapesjs-zoom-plugin`
* NPM
* `npm i grapesjs-zoom-plugin`
* GIT
* `git clone https://github.com/gxnanshu/grapesjs-zoom-plugin.git`

## Usage

Directly in the browser
```html

var editor = grapesjs.init({
container: '#gjs',
// ...
plugins: ['grapesjs-zoom-plugin'],
pluginsOpts: {
'grapesjs-zoom-plugin': { /* options */ }
}
});

```

Modern javascript
```js
import grapesjs from 'grapesjs';
import plugin from 'grapesjs-zoom-plugin';
import 'grapesjs/dist/css/grapes.min.css';

const editor = grapesjs.init({
container : '#gjs',
// ...
plugins: [plugin],
pluginsOpts: {
[plugin]: { /* options */ }
}
// or
plugins: [
editor => plugin(editor, { /* options */ }),
],
});
```

## Development

Clone the repository

```sh
$ git clone https://github.com/gxnanshu/grapesjs-zoom-plugin.git
$ cd grapesjs-zoom-plugin
```

Install dependencies

```sh
$ npm i
```

Start the dev server

```sh
$ npm start
```

Build the source

```sh
$ npm run build
```

## License

MIT