Skip to content

Commit

Permalink
added button vibration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephemera committed Aug 14, 2013
1 parent 2cd626c commit a7020e0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Vibration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@
div.bb-docs {
padding: 1rem;
}

@-moz-keyframes vibrate {
from {
-moz-transform: rotate(-2deg);
}
to {
-moz-transform: rotate(2deg);
}
}

#vibrate.do {
-moz-animation: vibrate 10ms linear infinite alternate;
}
</style>

</head>
Expand Down Expand Up @@ -76,11 +89,13 @@ <h1>Vibration API test app</h1>
intervalId = setInterval(function(){
window.navigator.vibrate(200);
},200);
document.querySelector("#vibrate").className = 'do';
}

function stopVibrate() {
clearInterval(intervalId);
window.navigator.vibrate(0);
document.querySelector("#vibrate").className = '';
}

return {
Expand Down

0 comments on commit a7020e0

Please sign in to comment.