From 6175c86816f80b2055b62ea98ac78873e4f712d5 Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 1 Feb 2024 01:36:06 +0300 Subject: [PATCH] hide some elements, notifications zone, bug fixes --- static/scripts/projects.js | 38 +++++++++++++++++++ static/styles/main.css | 28 ++++++++++++++ static/templates/admin/users.html | 14 ++++--- static/templates/admin/usersettings.html | 14 ++++--- static/templates/project/documents.html | 12 ++++-- static/templates/project/payments.html | 14 ++++--- static/templates/project/progress.html | 12 ++++-- static/templates/project/project.html | 12 ++++-- .../templates/project/settings/modules.html | 14 ++++--- .../templates/project/settings/payment.html | 14 ++++--- .../templates/project/settings/payments.html | 14 ++++--- .../templates/project/settings/settings.html | 14 ++++--- static/templates/project/tests.html | 14 ++++--- static/templates/projects.html | 14 ++++--- static/templates/user/settings.html | 14 ++++--- 15 files changed, 180 insertions(+), 62 deletions(-) diff --git a/static/scripts/projects.js b/static/scripts/projects.js index f077ddd..f8720b5 100644 --- a/static/scripts/projects.js +++ b/static/scripts/projects.js @@ -36,6 +36,44 @@ $(document).ready(function () { }); }); +function toggleNotifications() { + if ($("#dropdownNotifications").hasClass("is-visible")) { + event.preventDefault(); + $("#dropdownNotifications").removeClass("is-visible"); + $("#dropdownNotifications").css("display", "none"); + } else { + event.preventDefault(); + $("#dropdownNotifications").css("display", "inline-flex"); + setTimeout(function () { + $("#dropdownNotifications").addClass("is-visible"); + }, 100); + } +} + +$(document).on("click", function (event) { + if ($(event.target).closest("#notificationsIcon").length) { + return; + } else { + if (!$(event.target).closest(".dropdown-account").length) { + $("#dropdownNotifications").removeClass("is-visible"); + setTimeout(function () { + $("#dropdownNotifications").css("display", "none"); + }, 200); + } + } +}); + +$(document).ready(function () { + $(document).keydown(function (e) { + if (e.key === "Escape" || e.key === "Esc") { + $("#dropdownNotifications").removeClass("is-visible"); + setTimeout(function () { + $("#dropdownNotifications").css("display", "none"); + }, 200); + } + }); +}); + function setTheme(theme) { document.documentElement.setAttribute("data-theme", theme); diff --git a/static/styles/main.css b/static/styles/main.css index 4b62f52..70d1ed3 100644 --- a/static/styles/main.css +++ b/static/styles/main.css @@ -1150,6 +1150,34 @@ input::placeholder { color: #0f0f10; } +.dropdown-notifications { + display: none; + flex-direction: column; + align-items: flex-start; + position: absolute; + background-color: #fff; + width: 350px; + min-height: 180px; + padding: 8px 0; + transform: translate(-100%, 50px); + border: 1px solid rgba(0, 0, 0, 0.1); + border-radius: 12px; + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.02), + 0px 4px 8px -4px rgba(0, 0, 0, 0.04), 0px 16px 24px -8px rgba(0, 0, 0, 0.06); + z-index: 6; + opacity: 0; + transition: none; +} + +.dropdown-notifications .empty-span { + font-size: 16px; +} + +.dropdown-notifications.is-visible { + opacity: 1; + transition: opacity 0.2s ease; +} + .theme-switcher { display: inline-flex; gap: 4px; diff --git a/static/templates/admin/users.html b/static/templates/admin/users.html index a393229..a7b69db 100644 --- a/static/templates/admin/users.html +++ b/static/templates/admin/users.html @@ -41,12 +41,16 @@