From 0cdcc32b5c6e1cabad77614d3fccd453a92788fa Mon Sep 17 00:00:00 2001 From: Sriram Hariharan Date: Mon, 14 Jan 2019 19:57:50 -0600 Subject: [PATCH] copy click animation --- css/popup.css | 5 ++--- js/popup.js | 13 +++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/css/popup.css b/css/popup.css index 78f1b964..5b022c52 100644 --- a/css/popup.css +++ b/css/popup.css @@ -64,11 +64,10 @@ body { outline: 0; } -.copybut:hover { - box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.16), 0 4px 20px 0 rgba(0, 0, 0, 0.12); +.noshadow { + box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.2), 0 4px 20px 0 rgba(0, 0, 0, 0.16); } - #copyicon { font-size: x-large; border-radius: 50%; diff --git a/js/popup.js b/js/popup.js index a4d4bee5..cec4e2e0 100644 --- a/js/popup.js +++ b/js/popup.js @@ -119,13 +119,22 @@ function updateConflicts() { /* Handle the button clicks */ $(document).ready(function () { + + $("#courseList").on('mouseover', '.copybut', function () { + $(this).addClass('noshadow'); + }).on('mouseleave', '.copybut', function () { + $(this).removeClass('noshadow'); + }); $("#courseList").on('click', '.copybut', function (e) { e.stopPropagation(); var temp = $(""); $(this).find('i').text('check'); - $(this).find('i').css('box-shadow', 'none'); - $(this).find('i').delay(200).queue(function (n) { + $(this).stop(true, false).removeAttr('style').removeClass('noshadow', { + duration: 200 + }); + $(this).find('i').delay(400).queue(function (n) { $(this).text('content_copy'); + $(this).parent().addClass('noshadow'); n(); })