Last active
August 29, 2015 14:06
-
-
Save motionharvest/64b5eec7eb5bfbf8b5d5 to your computer and use it in GitHub Desktop.
Hold my beer
This file contains hidden or 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
System.$win.on('mousemove', function(e) { | |
nextX = e.clientX; | |
diff = currX - nextX; | |
var tmpVal = (Data.Active.shell.width * Data.Active.boxes[index].perc) * System.scale; | |
var valMinusDif = tmpVal - diff; | |
var newperc = (valMinusDif / (Data.Active.shell.width * System.scale)); | |
var percDif = newperc - Data.Active.boxes[index].perc; | |
Data.Active.boxes[index].perc += percDif; | |
Data.Active.boxes[index + 1].perc -= percDif; | |
boxElements[index].update({ | |
perc: Data.Active.boxes[index].perc, | |
width: System.roundInches(Data.Active.shell.width * Data.Active.boxes[index].perc) | |
}); | |
boxElements[index + 1].update({ | |
perc: Data.Active.boxes[index + 1].perc, | |
width: System.roundInches(Data.Active.shell.width * Data.Active.boxes[index + 1].perc) | |
}); | |
renderData.render(); | |
currX = nextX; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment