From c46f16131bccaca8e4430c3ab555ccb7dd5804b0 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Sat, 25 Mar 2023 13:05:16 +0000 Subject: [PATCH 01/16] Woops, maybe it was broken afterall --- gallery/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gallery/__init__.py b/gallery/__init__.py index 8657f37..1db7d79 100644 --- a/gallery/__init__.py +++ b/gallery/__init__.py @@ -66,7 +66,13 @@ def create_app(test_config=None): assets.register('js_all', js_scripts) # Error handlers - @app.errorhandler(Exception) + @app.errorhandler(400) + @app.errorhandler(401) + @app.errorhandler(403) + @app.errorhandler(404) + @app.errorhandler(405) + @app.errorhandler(418) + @app.errorhandler(500) def error_page(err): error = err.code msg = err.description From 5dab4fb53d2ab84886311c5bb25dc9afbbb4547e Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Sat, 25 Mar 2023 13:06:00 +0000 Subject: [PATCH 02/16] Action label, start --- gallery/static/js/lable.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gallery/static/js/lable.js diff --git a/gallery/static/js/lable.js b/gallery/static/js/lable.js new file mode 100644 index 0000000..4188422 --- /dev/null +++ b/gallery/static/js/lable.js @@ -0,0 +1,25 @@ +document.addEventListener('DOMContentLoaded', function() { + let labels = document.querySelectorAll('[data-label]'); + + for (let i = 0; i < labels.length; i++) { + labels[i].addEventListener('mouseover', function() { + let label = document.createElement('div'); + label.classList.add('label'); + label.innerHTML = this.dataset.label; + + document.body.appendChild(label); + + label.style.left = (this.offsetLeft + this.offsetWidth + 8) + 'px'; + label.style.top = (this.offsetTop + (label.offsetHeight / 2) - 2) + 'px'; + + setTimeout(function() { + label.style.opacity = 1; + }.bind(this), 250); + }); + + labels[i].addEventListener('mouseout', function() { + let label = document.querySelector('.label'); + label.parentNode.removeChild(label); + }); + } +}); From b862c74bbe2df097fdcc417de80c0d850a97e77a Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Sat, 25 Mar 2023 16:22:32 +0000 Subject: [PATCH 03/16] Switch to CSS vars for variables --- gallery/templates/groups/group.html | 2 +- gallery/templates/groups/list.html | 2 +- gallery/templates/index.html | 2 +- gallery/templates/layout.html | 7 +- .../templates/settings/settings_layout.html | 2 +- gallery/themes/default/components/banner.sass | 10 +- .../default/components/buttons/block.sass | 50 +++++----- .../components/buttons/info-button.sass | 6 +- .../default/components/buttons/pill.sass | 20 ++-- .../components/buttons/top-of-page.sass | 6 +- .../default/components/elements/labels.sass | 33 +++++++ .../components/elements/notification.sass | 14 +-- .../default/components/elements/pop-up.sass | 16 ++-- .../default/components/elements/tags.sass | 4 +- .../components/elements/upload-panel.sass | 26 +++--- .../themes/default/components/gallery.sass | 10 +- .../components/image-view/background.sass | 11 +-- .../components/image-view/fullscreen.sass | 2 +- .../components/image-view/info-tab.sass | 28 +++--- .../themes/default/components/navigation.sass | 83 +++++++++-------- gallery/themes/default/style.sass | 18 ++-- gallery/themes/default/variables.sass | 92 ++++++++++++++----- 22 files changed, 263 insertions(+), 181 deletions(-) create mode 100644 gallery/themes/default/components/elements/labels.sass diff --git a/gallery/templates/groups/group.html b/gallery/templates/groups/group.html index 5cc2542..c888685 100644 --- a/gallery/templates/groups/group.html +++ b/gallery/templates/groups/group.html @@ -1,5 +1,5 @@ {% extends 'layout.html' %} -{% block nav_groups %}navigation-item__selected{% endblock %} +{% block nav_groups %}selected{% endblock %} {% block content %}