diff --git a/gallery/__init__.py b/gallery/__init__.py index 098c5c9..a869622 100644 --- a/gallery/__init__.py +++ b/gallery/__init__.py @@ -67,7 +67,6 @@ def create_app(test_config=None): assets.register('js_all', js_scripts) # Error handlers - @app.errorhandler(Exception) def error_page(err): # If the error is a HTTP error, return the error page diff --git a/gallery/routes/api.py b/gallery/routes/api.py index 000042c..e613c27 100644 --- a/gallery/routes/api.py +++ b/gallery/routes/api.py @@ -29,7 +29,7 @@ db_session = db_session() @blueprint.route('/file/', methods=['GET']) -def get_file(file_name): +def file(file_name): """ Returns a file from the uploads folder r for resolution, 400x400 or thumb for thumbnail diff --git a/gallery/routes/groups.py b/gallery/routes/groups.py index 0c5f170..961c9a8 100644 --- a/gallery/routes/groups.py +++ b/gallery/routes/groups.py @@ -7,6 +7,7 @@ from flask import Blueprint, abort, render_template, url_for from sqlalchemy.orm import sessionmaker from gallery import db +from gallery.utils import contrast blueprint = Blueprint('group', __name__, url_prefix='/group') @@ -59,8 +60,13 @@ def group(group_id): for image in group_images: image = db_session.query(db.Posts).filter(db.Posts.id == image[0]).first() images.append(image) + + if images: + text_colour = contrast.contrast(images[0].image_colours[0], 'rgb(var(--fg-black))', 'rgb(var(--fg-white))') + else: + text_colour = 'rgb(var(--fg-black))' - return render_template('groups/group.html', group=group_item, images=images) + return render_template('groups/group.html', group=group_item, images=images, text_colour=text_colour) @blueprint.route('//') diff --git a/gallery/static/images/error.png b/gallery/static/error.png similarity index 100% rename from gallery/static/images/error.png rename to gallery/static/error.png diff --git a/gallery/static/images/icon.png b/gallery/static/icon.png similarity index 100% rename from gallery/static/images/icon.png rename to gallery/static/icon.png diff --git a/gallery/static/images/bg.svg b/gallery/static/images/bg.svg deleted file mode 100644 index b133190..0000000 --- a/gallery/static/images/bg.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/gallery/static/js/main.js b/gallery/static/js/main.js index 85f8705..33feeee 100644 --- a/gallery/static/js/main.js +++ b/gallery/static/js/main.js @@ -47,8 +47,8 @@ function loadOnView() { window.onload = function () { loadOnView(); - const darkColor = '#151515'; - const lightColor = '#E8E3E3'; + const darkColor = 'rgb(var(--black))'; + const lightColor = 'rgb(var(--white))'; let contrastCheck = document.querySelectorAll('#contrast-check'); for (let i = 0; i < contrastCheck.length; i++) { let bgColor = contrastCheck[i].getAttribute('data-color'); @@ -94,7 +94,7 @@ window.onload = function () { infoButton.classList.add('show'); } infoButton.onclick = function () { - popUpShow('OnlyLegs Gallery', + popUpShow('OnlyLegs on Flask', 'Using Phosphoricons and Manrope
' + 'Made by Fluffy and others with ❤️
' + 'V23.03.25'); diff --git a/gallery/static/images/logo-black.svg b/gallery/static/logo-black.svg similarity index 100% rename from gallery/static/images/logo-black.svg rename to gallery/static/logo-black.svg diff --git a/gallery/static/images/logo-white.svg b/gallery/static/logo-white.svg similarity index 100% rename from gallery/static/images/logo-white.svg rename to gallery/static/logo-white.svg diff --git a/gallery/templates/error.html b/gallery/templates/error.html index 72b570e..9d76c79 100644 --- a/gallery/templates/error.html +++ b/gallery/templates/error.html @@ -1,8 +1,7 @@ {% extends 'layout.html' %} - {% block content %}

{{error}}

{{msg}}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/gallery/templates/groups/group.html b/gallery/templates/groups/group.html index c888685..ea7cefe 100644 --- a/gallery/templates/groups/group.html +++ b/gallery/templates/groups/group.html @@ -1,29 +1,44 @@ {% extends 'layout.html' %} {% block nav_groups %}selected{% endblock %} -{% block content %} - {% else %}
-

No image!

+

*crickets chirping*

{% if g.user %} -

You can get started by uploading an image!

+

Add some images to the group!

{% else %} -

Login to start uploading images!

+

Login to start managing this image group!

{% endif %}
{% endif %} diff --git a/gallery/templates/groups/list.html b/gallery/templates/groups/list.html index 25ed66c..3e721d9 100644 --- a/gallery/templates/groups/list.html +++ b/gallery/templates/groups/list.html @@ -37,23 +37,19 @@

{{ group.name }}

- + {% endif %} {% endfor %} {% else %}
-

No image groups!

+

*crickets chirping*

{% if g.user %}

You can get started by creating a new image group!

{% else %} -

Login to get started!

+

Login to start seeing anything here!

{% endif %}
{% endif %} {% endblock %} - -{% block script %} - -{% endblock %} \ No newline at end of file diff --git a/gallery/templates/image.html b/gallery/templates/image.html index 7df6f90..27a7a92 100644 --- a/gallery/templates/image.html +++ b/gallery/templates/image.html @@ -1,33 +1,96 @@ {% extends 'layout.html' %} - -{% block head %} - - -{% endblock %} - {% block wrapper_class %}image-wrapper{% endblock %} +{% block head %} + + + + + +{% endblock %} {% block content %}
- {{ image.post_alt }} - + {{ image.post_alt }} +
-
+
{{ image.post_alt }}
{{ image.post_alt }}
@@ -44,14 +107,14 @@
{% endif %}
- -
{% if image.author_id == g.user.id %}
- -