diff --git a/gallery/routes/api.py b/gallery/routes/api.py index 3583f1c..548b5e0 100644 --- a/gallery/routes/api.py +++ b/gallery/routes/api.py @@ -1,6 +1,6 @@ """ Onlylegs - API endpoints -Used intermally by the frontend and possibly by other applications +Used internally by the frontend and possibly by other applications """ from uuid import uuid4 import os @@ -32,7 +32,7 @@ db_session = db_session() def get_file(file_name): """ Returns a file from the uploads folder - t is the type of file (thumb, etc) + t is the type of file (thumb, etc.) w and h are the width and height of the image for resizing f is whether to apply filters to the image, such as blurring NSFW images b is whether to force blur the image, even if it's not NSFW @@ -43,6 +43,15 @@ def get_file(file_name): height = request.args.get('h', default=0, type=int) # Height of image filtered = request.args.get('f', default=False, type=bool) # Whether to apply filters blur = request.args.get('b', default=False, type=bool) # Whether to force blur + + # Idea: instead if specifying the height and width, pass in a string like "200x200" or "200x" or "x200" + # This would remove the need for the if statements below and would be possible to pass in a string + # like 'thumb' to get the thumbnail size instead of having to specify the width and height + # This would also allow for more flexibility in the future if I wanted to add more sizes + # Another idea is to pass in a list of filters to apply to the image + # such as "blur,grayscale" or "blur,grayscale,sepia". But this would require a lot more work to implement + # and would be a lot more complicated to use, would also implement the risk of the server being overloaded + # with requests to apply a lot of filters to a lot of images at once file_name = secure_filename(file_name) # Sanitize file name diff --git a/gallery/static/images/logo-black.svg b/gallery/static/images/logo-black.svg new file mode 100644 index 0000000..559ad4d --- /dev/null +++ b/gallery/static/images/logo-black.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + diff --git a/gallery/static/images/logo-white.svg b/gallery/static/images/logo-white.svg new file mode 100644 index 0000000..a50b3f3 --- /dev/null +++ b/gallery/static/images/logo-white.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + diff --git a/gallery/templates/image.html b/gallery/templates/image.html index 118e00c..d66d80a 100644 --- a/gallery/templates/image.html +++ b/gallery/templates/image.html @@ -1,5 +1,10 @@ {% extends 'layout.html' %} +{% block head %} + + +{% endblock %} + {% block wrapper_class %}image-wrapper{% endblock %} {% block content %} diff --git a/gallery/templates/layout.html b/gallery/templates/layout.html index 1e7eb18..584131f 100644 --- a/gallery/templates/layout.html +++ b/gallery/templates/layout.html @@ -3,13 +3,37 @@ - Gallery - + + {{ config.WEBSITE.name }} + + + + + + + + + + + + + + {% assets "js_all" %} {% endassets %} + + {% block head %}{% endblock %}