Is there a way to achieve an effect in HTML that resembles the pull title bar animation from top to bottom in Android?
Any suggestions on how to create this effect or what tools I would need?
Currently, when I swipe, the page simply displays a following animation and does not mimic my finger movements.
I am fairly new to this. Any help is greatly appreciated.
Thank you for taking the time to read this!
This is the CSS code I have tried:
.myanimation {
animation : mymove .3s linear;
-webkit-animation : mymove .3s linear;
}
.removeanimation {
animation : remove .3s linear;
-webkit-animation : remove .3s linear;
}
@keyframes mymove
{
0% {width: 20%;}
25% {width: 40%;}
50% {width: 60%;}
75% {width: 80%;}
100% {width: 100%;}
}
@-webkit-keyframes mymove /*Safari and Chrome*/
{
0% {width: 20%;}
25% {width: 40%;}
50% {width: 60%;}
75% {width: 80%;}
100% {width: 100%;}
}
@keyframes remove
{
0% {width: 100%;}
25% {width: 80%;}
50% {width: 60%;}
75% {width: 40%;}
100% {width: 20%;}
}
@-webkit-keyframes remove /*Safari and Chrome*/
{
0% {width: 100%;}
25% {width: 80%;}
50% {width: 60%;}
75% {width: 40%;}
100% {width: 20%;}
}
This is the JavaScript (using hammer.js):
$(".play").hammer().on("swiperight", function (event) {
$('#mainSetting').removeClass('hide');
$('#mainSetting').removeClass('removeanimation');
$('#mainSetting').addClass('myanimation');
$('#mainSetting').css("width","100%");
});
$("#mainSetting").hammer().on("swipeleft", function(event) {
$('#mainSetting').removeClass('myanimation');
$('#mainSetting').addClass('removeanimation');
$('#mainSetting').css("width","10%");
setTimeout(function(){$('#mainSetting').addClass('hide')},400);
});