PW Viewer
Image viewer with the following features:
- Follows the progressive enhancement strategy: if javascript fails, the web page keeps working
- CSS powered:
- High performance: Use css transform to scale, rotate, translate elements
- No styles or themes are provided with this package. You decide how the viewer must look.
- Responsive:
- Suport for touch devices
- Works with
<picture>
element - Light and fast
- Modern
- Build with ES6 and modern tools (webpack, babel, etc)
- Easy to extend and adapt to your needs
- Support for all modern browsers. IE10+ should work
Install
Requirements:
- NPM to install the package and the dependencies
- Webpack (or any other javascript loader)
npm install pw-viewer
Usage
Html
Let's say we have the following html code:
ZoomReset
Note the data-viewer-src
attribute in the image. It's used to load a full quality image on zoom.
CSS
The following css code is optional (but recommended):
JS
And finally the javascript to build the viewer:
; //Init the viewervar myViewer = document; //Zoom on click the buttondocument; document;
Demo
To run the demo, just clone this repository enter in the directory and execute:
npm installnpm start
You should see something in http://localhost:8080/