Fix parallax
This commit is contained in:
parent
cd045e92cd
commit
dfd4f8a4e0
1 changed files with 17 additions and 2 deletions
|
@ -7,12 +7,27 @@
|
||||||
{% if top_photos %}
|
{% if top_photos %}
|
||||||
{% for photo in top_photos %}
|
{% for photo in top_photos %}
|
||||||
<li>
|
<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>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<li>
|
<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>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Add table
Reference in a new issue