-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48ee23e
commit 3ad966f
Showing
5 changed files
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "interdimensional", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "http://vodkabears.github.io/interdimensional/", | ||
"authors": [ | ||
"Ilya Makarov <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/* | ||
* Interdimensional - v0.0.1 | ||
* Interdimensional - v0.0.2 | ||
* Spatial scrolling for your web pages. | ||
* http://vodkabears.github.io/interdimensional/ | ||
* | ||
* Made by Ilya Makarov <[email protected]> | ||
* Under MIT License | ||
*/ | ||
|
||
(function(root, factory) { | ||
!(function(root, factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
define(factory); | ||
} else if (typeof exports === 'object') { | ||
|
@@ -16,6 +16,7 @@ | |
root.Interdimensional = factory(); | ||
} | ||
})(this, function() { | ||
|
||
'use strict'; | ||
|
||
/** | ||
|
@@ -277,7 +278,7 @@ | |
* @param {Number} options.PPD Pixels per difference between tilts | ||
* @param {Number} options.insensitivity Minimum difference between tilts | ||
* @param {Boolean} options.useControl Use the control or not | ||
* @param {HTMLElement|null} Interdimensional control, if null - the default control will be used | ||
* @param {HTMLElement|null} options.control Interdimensional control, if null - the default control will be used | ||
*/ | ||
charge: function(options) { | ||
if (!isCharged && !isCharging) { | ||
|
@@ -306,15 +307,17 @@ | |
} | ||
|
||
// Add the control | ||
settings.useControl && document.body.appendChild(control); | ||
!settings.control && settings.useControl && document.body.appendChild(control); | ||
|
||
// Add event listeners | ||
control.addEventListener('touchstart', handleTouchStartEvent, false); | ||
window.addEventListener('deviceorientation', handleDeviceOrientationEvent, false); | ||
window.addEventListener('orientationchange', handleOrientationChangeEvent, false); | ||
|
||
trigger('charge'); | ||
}, function() { | ||
}, | ||
|
||
function() { | ||
isCharging = false; | ||
trigger('fail'); | ||
}); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters