From 670d6ecc063948c0c0f5688071aa2180653da919 Mon Sep 17 00:00:00 2001 From: Subhamoy Biswas Date: Tue, 21 Nov 2023 21:35:59 +0530 Subject: [PATCH] (feat): initialised basic share button functions --- htdocs/assets/_floatingbar.php | 1 + htdocs/assets/js/floatingbar-config.js | 27 ++++++++++++++++++++++ htdocs/assets/style.css | 32 +++++++------------------- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/htdocs/assets/_floatingbar.php b/htdocs/assets/_floatingbar.php index bc0c431..51c4eac 100644 --- a/htdocs/assets/_floatingbar.php +++ b/htdocs/assets/_floatingbar.php @@ -108,4 +108,5 @@ + \ No newline at end of file diff --git a/htdocs/assets/js/floatingbar-config.js b/htdocs/assets/js/floatingbar-config.js index 8f70df5..94beddf 100644 --- a/htdocs/assets/js/floatingbar-config.js +++ b/htdocs/assets/js/floatingbar-config.js @@ -4,6 +4,7 @@ const floatingBar = document.getElementById("floating-bar"); const searchBar = document.getElementById("searchbar"); const shareBtn = document.getElementById("sharebutton"); const closeBtn = document.getElementById("closebutton"); +const shareCloseBtn = document.getElementById("shareclosebutton"); const searchTxt = document.getElementById("searchtext"); const searchInput = document.getElementById("searchinput"); const windowWrapper = document.getElementById("floatingwindowwrapper"); @@ -294,4 +295,30 @@ searchInput.addEventListener('input', function() { else { fallback_search(searchDef, searchRes); } +}); + + +//---share window config starts here + +function activate_share() { + windowWrapper.classList.remove("hidden"); + windowWrapper.classList.add("flotingbar-window-wrapper-show"); + shareBtn.classList.add("hidden"); + shareCloseBtn.classList.remove("hidden"); + +} + +function close_share() { + windowWrapper.classList.remove("flotingbar-window-wrapper-show"); + windowWrapper.classList.add("hidden"); + shareCloseBtn.classList.add("hidden"); + shareBtn.classList.remove("hidden"); +} + +shareBtn.addEventListener("click", function () { + activate_share(); +}); + +shareCloseBtn.addEventListener("click", function () { + close_share(); }); \ No newline at end of file diff --git a/htdocs/assets/style.css b/htdocs/assets/style.css index 51b0570..5bad5ea 100644 --- a/htdocs/assets/style.css +++ b/htdocs/assets/style.css @@ -874,6 +874,10 @@ video { height: 200px; } +.h-\[27px\] { + height: 27px; +} + .h-\[2px\] { height: 2px; } @@ -914,18 +918,6 @@ video { height: 100vh; } -.h-\[20px\] { - height: 20px; -} - -.h-\[25px\] { - height: 25px; -} - -.h-\[27px\] { - height: 27px; -} - .w-0 { width: 0px; } @@ -942,6 +934,10 @@ video { width: 250px; } +.w-\[27px\] { + width: 27px; +} + .w-\[300px\] { width: 300px; } @@ -995,18 +991,6 @@ video { width: 100vw; } -.w-\[20px\] { - width: 20px; -} - -.w-\[25px\] { - width: 25px; -} - -.w-\[27px\] { - width: 27px; -} - .rotate-\[15deg\] { --tw-rotate: 15deg; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));