2022-12-01 18:48:31 +00:00
|
|
|
{% extends 'layout.html' %}
|
2023-01-10 12:39:29 +00:00
|
|
|
|
2023-03-08 13:36:35 +00:00
|
|
|
{% block nav_home %}navigation-item__selected{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2023-03-01 23:29:34 +00:00
|
|
|
<div class="banner">
|
2023-03-08 13:36:35 +00:00
|
|
|
<div class="banner-content">
|
2023-03-09 23:31:58 +00:00
|
|
|
<p>{{ config.WEBSITE.motto }}</p>
|
|
|
|
<h1>{{ config.WEBSITE.name }}</h1>
|
2023-03-23 15:47:35 +00:00
|
|
|
{% if images|length == 0 %}
|
|
|
|
<p>Serving 0 images :<</p>
|
|
|
|
{% elif images|length == 69 %}
|
|
|
|
<p>Serving {{ images|length }} images, nice</p>
|
|
|
|
{% else %}
|
|
|
|
<p>Serving {{ images|length }} images</p>
|
|
|
|
{% endif %}
|
2023-03-01 23:29:34 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-01-10 12:39:29 +00:00
|
|
|
|
2023-03-09 23:31:58 +00:00
|
|
|
{% if images %}
|
|
|
|
<div class="gallery-grid">
|
|
|
|
{% for image in images %}
|
|
|
|
<a id="image-{{ image.id }}" class="gallery-item" href="/image/{{ image.id }}" style="background-color: rgb({{ image.image_colours.0.0 }}, {{ image.image_colours.0.1 }}, {{ image.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>
|
|
|
|
<img alt="{{ image.post_alt }}" data-src="{{ image.file_name }}" onload="imgFade(this)" style="opacity:0;" 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-09 23:31:58 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2023-01-25 15:13:56 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block script %}
|
2022-12-01 18:48:31 +00:00
|
|
|
<script>
|
2023-02-01 00:57:36 +00:00
|
|
|
if (document.referrer.includes('image')) {
|
2023-03-08 09:01:20 +00:00
|
|
|
try {
|
2023-03-23 12:54:00 +00:00
|
|
|
let referrerId = document.referrer.split('/').pop();
|
2023-03-08 09:01:20 +00:00
|
|
|
|
2023-03-23 12:54:00 +00:00
|
|
|
let imgOffset = document.getElementById('image-' + referrerId).offsetTop;
|
|
|
|
let imgHeight = document.getElementById('image-' + referrerId).offsetHeight;
|
|
|
|
let windowHeight = window.innerHeight;
|
2023-03-08 09:01:20 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2022-12-14 19:55:40 +00:00
|
|
|
}
|
2022-12-01 18:48:31 +00:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|