Skip to content

Instantly share code, notes, and snippets.

View imRohan's full-sized avatar
🎧
Focusing

Rohan Likhite imRohan

🎧
Focusing
View GitHub Profile
@imRohan
imRohan / DeviceMotionSnippet
Last active August 29, 2015 14:21
Device Motion
if (window.DeviceMotionEvent == undefined) {
// No Sensor Detected
} else {
window.ondevicemotion = function (event) {
// Grab x/y vals
ax = Math.round(Math.abs(event.accelerationIncludingGravity.x));
ay = Math.round(Math.abs(event.accelerationIncludingGravity.y));
// Check if Device is Tilted
if (ax !== 0 | ay !== 0){
//Device is tilted
@imRohan
imRohan / discoFilter
Created April 1, 2015 14:40
April Fools "Disco" Filter
body{
-webkit-animation: adjustHue 1s alternate infinite;
}
@-webkit-keyframes adjustHue {
0% {
-webkit-filter: hue-rotate(30deg);
}
50% {
-webkit-filter: hue-rotate(60deg);