Fix parallax

This commit is contained in:
Nyymix 2025-03-19 17:00:12 +02:00
parent cd045e92cd
commit dfd4f8a4e0

View file

@ -7,12 +7,27 @@
{% if top_photos %}
{% for photo in top_photos %}
<li>
<img src="{{ photo.photo_bg.url }}" alt="{{ photo.album.name }} - {{ photo.slug }}" loading="lazy" uk-cover />
<img src="{{ photo.photo_md.url }}"
srcset="
{{ photo.photo_sm.url }} 480w,
{{ photo.photo_md.url }} 1024w,
{{ photo.photo_bg.url }} 1920w
"
sizes="100vw"
width="{{ photo.width }}"
height="{{ photo.height }}"
style="aspect-ratio: 7 / 3;"
alt="{{ photo.album.name }} - {{ photo.slug }}"
{% if forloop.first %} loading="eager" {% else %} loading="lazy" {% endif %}
uk-cover />
</li>
{% endfor %}
{% else %}
<li>
<img src="{% static 'img/placeholder.png' %}" alt="" uk-cover />
<img src="{% static 'img/placeholder.png' %}"
width="1920" height="823"
style="aspect-ratio: 7 / 3;"
alt="Placeholder" uk-cover />
</li>
{% endif %}
</ul>