From 2c6429d48c275ed0e9879eabdd44a937a9653bcf Mon Sep 17 00:00:00 2001 From: Gustavo Luigi Date: Tue, 30 Aug 2022 19:18:55 +0200 Subject: [PATCH] animate count --- content/contents/balkonkraftwerk.blade.php | 9 +++++++++ content/includes/css.blade.php | 1 + content/master.blade.php | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/content/contents/balkonkraftwerk.blade.php b/content/contents/balkonkraftwerk.blade.php index 833d0f3..9e402c1 100644 --- a/content/contents/balkonkraftwerk.blade.php +++ b/content/contents/balkonkraftwerk.blade.php @@ -89,6 +89,15 @@ }); $('#btn-add-to-bag').click(function(){ let productId = $(this).attr("data-id"); + let parentElement = $('#count-products-in-bag').parent(); + let copyElemetn = $('#count-products-in-bag').clone(); + copyElemetn.attr('id', ''); + copyElemetn.appendTo(parentElement); + $('#count-products-in-bag').addClass('animate__animated animate__backInUp'); + $('#count-products-in-bag').on('animationend', function(){ + $('#count-products-in-bag').removeClass('animate__animated animate__backInUp'); + copyElemetn.remove(); + }); addToBag(productId); }); }); diff --git a/content/includes/css.blade.php b/content/includes/css.blade.php index 22b888a..cd29c84 100644 --- a/content/includes/css.blade.php +++ b/content/includes/css.blade.php @@ -1,4 +1,5 @@ +