Files
What_Are_You_Lifting_App/js/plateAnimation.js
Steven Haskell 3e033e8978 Wrote test Animation script
Wrote a test animation script that should animate the plates on and off based off of the content.
2018-10-23 00:40:00 -04:00

38 lines
1.1 KiB
JavaScript

function test () {
//checks if there are any plates showing
if (document.body.contains('.platevisual__plate')) {
//animates plates off
jQuery('.b-platevisual__plates--left').animate({
opacity: 0,
left: "-=37%",
}, {duration: 500, queue: false });
jQuery('.b-platevisual__plates--right').animate({
opacity: 0,
left: "+=37%",
}, {duration: 500, queue: false });
//updates plates
jQuery(".b-platevisual__plates").html(weighthtml);
//animates plates back on
jQuery('.b-platevisual__plates--left').animate({
opacity: 1,
left: "+=37%",
}, {duration: 500, queue: false });
jQuery('.b-platevisual__plates--right').animate({
opacity: 1,
left: "-=37%",
}, {duration: 500, queue: false });
} else {
//updates plates
jQuery(".b-platevisual__plates").html(weighthtml);
//animates plates back on
jQuery('.b-platevisual__plates--left').animate({
opacity: 1,
left: "+=37%",
}, {duration: 500, queue: false });
jQuery('.b-platevisual__plates--right').animate({
opacity: 1,
left: "-=37%",
}, {duration: 500, queue: false });
}
}