2022-12-01 18:48:31 +00:00
|
|
|
{% extends 'layout.html' %}
|
2023-03-25 16:22:32 +00:00
|
|
|
{% block nav_home %}selected{% endblock %}
|
2023-03-08 13:36:35 +00:00
|
|
|
{% block content %}
|
2023-04-04 19:36:24 +00:00
|
|
|
<div class="banner-small">
|
2023-03-08 13:36:35 +00:00
|
|
|
<div class="banner-content">
|
2023-04-04 19:36:24 +00:00
|
|
|
<h1 class="banner-header">{{ config.WEBSITE.name }}</h1>
|
2023-03-23 15:47:35 +00:00
|
|
|
{% if images|length == 0 %}
|
2023-04-04 19:36:24 +00:00
|
|
|
<p class="banner-info">0 images D:</p>
|
2023-03-23 15:47:35 +00:00
|
|
|
{% elif images|length == 69 %}
|
2023-04-04 19:36:24 +00:00
|
|
|
<p class="banner-info">{{ images|length }} images, nice</p>
|
2023-03-23 15:47:35 +00:00
|
|
|
{% else %}
|
2023-04-04 19:36:24 +00:00
|
|
|
<p class="banner-info">{{ images|length }} images</p>
|
2023-03-23 15:47:35 +00:00
|
|
|
{% endif %}
|
2023-03-01 23:29:34 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-03-09 23:31:58 +00:00
|
|
|
{% if images %}
|
|
|
|
<div class="gallery-grid">
|
|
|
|
{% for image in images %}
|
2023-04-06 16:22:56 +00:00
|
|
|
<a id="image-{{ image.id }}" class="gallery-item" href="{{ url_for('image.image', image_id=image.id) }}" style="background-color: rgb({{ image.colours.0.0 }}, {{ image.colours.0.1 }}, {{ image.colours.0.2 }})">
|
2023-03-11 22:14:03 +00:00
|
|
|
<div class="image-filter">
|
|
|
|
<p class="image-subtitle"></p>
|
|
|
|
<p class="image-title"><span class="time">{{ image.created_at }}</span></p>
|
|
|
|
</div>
|
2023-04-05 16:35:59 +00:00
|
|
|
<img fetchpriority="low" alt="{{ image.alt }}" data-src="{{ url_for('api.file', file_name=image.filename) }}?r=thumb" onload="this.classList.add('loaded');" id="lazy-load"/>
|
2023-03-09 23:31:58 +00:00
|
|
|
</a>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="big-text">
|
2023-03-23 15:47:35 +00:00
|
|
|
<h1>*crickets chirping*</h1>
|
2023-03-26 01:04:13 +00:00
|
|
|
<p>There are no images here yet, upload some!</p>
|
2023-03-09 23:31:58 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2023-01-25 15:13:56 +00:00
|
|
|
{% endblock %}
|
2023-03-27 07:15:18 +00:00
|
|
|
{% block script %}
|
2023-03-30 15:51:06 +00:00
|
|
|
<script type="text/javascript">
|
2023-03-27 07:15:18 +00:00
|
|
|
if (document.referrer.includes('image')) {
|
|
|
|
try {
|
|
|
|
let referrerId = document.referrer.split('/').pop();
|
|
|
|
|
|
|
|
let imgOffset = document.getElementById('image-' + referrerId).offsetTop;
|
|
|
|
let imgHeight = document.getElementById('image-' + referrerId).offsetHeight;
|
|
|
|
let windowHeight = window.innerHeight;
|
|
|
|
|
|
|
|
document.querySelector('html').style.scrollBehavior = 'auto';
|
|
|
|
window.scrollTo(0, imgOffset + (imgHeight / 2) - (windowHeight / 2));
|
|
|
|
document.querySelector('html').style.scrollBehavior = 'smooth';
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|