https://github.com/crowdhailer/hammerhead
A minimal JavaScript utility to help view SVG's on webpages
https://github.com/crowdhailer/hammerhead
Last synced: 9 months ago
JSON representation
A minimal JavaScript utility to help view SVG's on webpages
- Host: GitHub
- URL: https://github.com/crowdhailer/hammerhead
- Owner: CrowdHailer
- Created: 2014-04-16T19:43:16.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-13T14:08:15.000Z (over 11 years ago)
- Last Synced: 2025-02-07T19:44:55.995Z (11 months ago)
- Language: JavaScript
- Homepage: http://crowdhailer.github.io/HammerHead/
- Size: 730 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HammerheadJS
#### A minimal JavaScript utility to help view SVG's on webpages
[](https://codeclimate.com/github/CrowdHailer/HammerHead)
# Features
### Current
- Small ~ 5kb
- Drag support with mouse and touch
- Pinch support for zoom
- Dependancy on [hammer.js](http://eightmedia.github.io/hammer.js/)
- Support for zooming with mousewheel
### Planned
- minified code
- key zoom and pan support
- temporarily disable
- zoom to point
# Usage
- Add [hammerhead.js](https://raw.githubusercontent.com/CrowdHailer/HammerHead/master/hammerhead.js) and [hammerhead.css](https://raw.githubusercontent.com/CrowdHailer/HammerHead/master/hammerhead.css) to your project directory
- Include *hammer.min.js* and *hammerhead.js* in you html
- Include *hammerhead.css* (This disables native scrolling and can effect other areas of your site)
- Optionally include *hammer.fakemultitouch.js* and/or *hammer.showtouches.js*
- Activate with the following script passing the SVG's id
```js
Hammer.plugins.fakeMultitouch(); // If including fake multitouch
Hammer.plugins.showTouches(); // If including show touches
var instance = Hammerhead(svgIdString);
```
# Credits
Built on top of [Hammerjs](http://eightmedia.github.io/hammer.js/)