{"_id":"shake.js","_rev":"4-c230de040965d89ba376232c11d81ddc","name":"shake.js","description":"A custom 'shake' event plugin for mobile web browsers using device accelerometer.","dist-tags":{"latest":"1.2.2"},"versions":{"1.2.1":{"name":"shake.js","version":"1.2.1","description":"A custom 'shake' event plugin for mobile web browsers using device accelerometer.","keywords":["shake","gesture","event"],"main":"shake.js","repository":{"type":"git","url":"git+https://github.com/alexgibson/shake.js.git"},"author":{"name":"alexgibson"},"license":"MIT","bugs":{"url":"https://github.com/alexgibson/shake.js/issues"},"homepage":"https://github.com/alexgibson/shake.js#readme","gitHead":"be2d99e9d3aaedb9fb38f7ffa450f88b199eaf9c","_id":"shake.js@1.2.1","scripts":{},"_shasum":"80f855726ce2eb71d100c4e1d47812f2aa5d9390","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"alexgibson","email":"alxgbsn@gmail.com"},"maintainers":[{"name":"alexgibson","email":"alxgbsn@gmail.com"}],"dist":{"shasum":"80f855726ce2eb71d100c4e1d47812f2aa5d9390","tarball":"https://registry.npmjs.org/shake.js/-/shake.js-1.2.1.tgz","integrity":"sha512-JkpIVqxoHW6TCOzrCz32Ygg8Qa2tCf/jZH1UHbq6BXX7CpzsMk5fkPPN8BOtt7AiCWBqY85k7yh9q+JetQKqrA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtvvSKR3cAf5GuVacCuRelZTXKW2N0PG1kw78wN3UPtQIgGBdbm1xaL1NiEC0olxOGcsDrHfrf54vlLobSk24NJRA="}]}},"1.2.2":{"name":"shake.js","version":"1.2.2","description":"A custom 'shake' event plugin for mobile web browsers using device accelerometer.","keywords":["shake","gesture","event"],"main":"shake.js","repository":{"type":"git","url":"git+https://github.com/alexgibson/shake.js.git"},"author":{"name":"alexgibson"},"license":"MIT","bugs":{"url":"https://github.com/alexgibson/shake.js/issues"},"homepage":"https://github.com/alexgibson/shake.js#readme","gitHead":"117b756c48557b01aedddd7442bde887d020bf3e","_id":"shake.js@1.2.2","scripts":{},"_shasum":"b2ac560a82abe68d78a029623a7088e1b30bacff","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"alexgibson","email":"alxgbsn@gmail.com"},"maintainers":[{"name":"alexgibson","email":"alxgbsn@gmail.com"}],"dist":{"shasum":"b2ac560a82abe68d78a029623a7088e1b30bacff","tarball":"https://registry.npmjs.org/shake.js/-/shake.js-1.2.2.tgz","integrity":"sha512-2onqnUWjVMsW8zFIlJ0gBGIzt33WkExKMToc5qgOX7HuHD1lBu52FQwlk763iZAlVE+ihiT1fHFMabzlVw/xIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2IHJqzJ3l4piGHeS2tw4WBL/dZJ2PAAGHFos36mQAcQIgWHlCov4lwIUu5MU8plcCJx4r5QtnfeWR7BW1ZnJHUWg="}]}}},"readme":"shake.js\n=======================================\n\nA custom 'shake' event JavaScript plugin for mobile web browsers using device accelerometer.\n\nInstallation\n---------------------------------------\n\n* Download: [zip](https://github.com/alexgibson/shake.js/zipball/master)\n* [NPM](https://www.npmjs.org/): `npm install shake.js`\n* [Bower](https://github.com/twitter/bower/): `bower install shake.js`\n* Git: `git clone https://github.com/alexgibson/shake.js`\n\nDependencies\n---------------------------------------\n\nYour web browser must support the `devicemotion` event for this plugin to work. Shake.js uses built-in feature detection to determine if it can run in your web browser. It will terminate silently on non-supporting browsers.\n\nhttp://w3c.github.io/deviceorientation/spec-source-orientation.html\n\nSetup\n---------------------------------------\n\nFor CommonJS using NPM:\n\n```\nvar Shake = require('shake.js');\n```\n\nFor AMD module:\n\n```\ndefine(['./shake'], function(Shake) {\n    // ...\n});\n```\n\nIn the browser:\n\n```\n<script src=\"shake.js\"></script>\n```\n\nNext, create a new Shake instance:\n\n```\nvar myShakeEvent = new Shake({\n    threshold: 15, // optional shake strength threshold\n    timeout: 1000 // optional, determines the frequency of event generation\n});\n```\n\nStart listening to device motion:\n\n```\nmyShakeEvent.start();\n```\n\nRegister a `shake` event listener on `window` with your callback:\n\n```\nwindow.addEventListener('shake', shakeEventDidOccur, false);\n\n//function to call when shake occurs\nfunction shakeEventDidOccur () {\n\n    //put your own code here etc.\n    alert('shake!');\n}\n```\n\nYou can stop listening for shake events like so:\n\n```\nwindow.removeEventListener('shake', shakeEventDidOccur, false);\n```\n\nTo stop listening to device motion, you can call:\n\n```\nmyShakeEvent.stop();\n```\n\nSupported web browsers/devices\n---------------------------------------\n\n- iOS Safari 4.2.1 (and above)\n- Android 4.0.3 (default browser)\n- Chrome 41+ for Android\n- Opera Mobile (Android)\n- BlackBerry PlayBook 2.0\n- Firefox for Android\n- FirefoxOS Devices\n","maintainers":[{"name":"alexgibson","email":"alxgbsn@gmail.com"}],"time":{"modified":"2022-06-26T18:34:31.900Z","created":"2015-07-22T12:48:49.545Z","1.2.1":"2015-07-22T12:48:49.545Z","1.2.2":"2015-07-22T13:01:19.037Z"},"homepage":"https://github.com/alexgibson/shake.js#readme","keywords":["shake","gesture","event"],"repository":{"type":"git","url":"git+https://github.com/alexgibson/shake.js.git"},"author":{"name":"alexgibson"},"bugs":{"url":"https://github.com/alexgibson/shake.js/issues"},"license":"MIT","readmeFilename":"README.md"}