Add slideshow

This commit is contained in:
Nyymix 2025-04-21 22:30:47 +03:00
parent 47b543bbb3
commit 38fa9ddf3f
4 changed files with 97 additions and 10 deletions

View file

@ -88,7 +88,10 @@
<div><a href="{{ photo.photo.url }}">{{ photo.width }}x{{ photo.height }}</a></div>
</div>
<div class="uk-grid-small" uk-grid>
<button id="like-button" class="uk-button uk-button-primary">
<a href="{% url 'gallery:photo_slideshow_url' photo.album.slug photo.slug %}" class="uk-button uk-button-secondary" target="_blank" rel="noopener">
<span uk-icon="icon: play"></span> <span>Slideshow</span>
</a>
<button id="like-button" class="uk-button uk-button-secondary">
<span id="heart-icon" uk-icon="icon: heart"></span> <span id="like-text">Like</span>
</button>
</div>
@ -157,7 +160,7 @@
if (data.status === "liked") {
likeText.innerText = "Unlike";
heartIcon.setAttribute("style", "color: red");
heartIcon.setAttribute("style", "color: inherit");
} else {
likeText.innerText = "Like";
heartIcon.setAttribute("style", "color: inherit");
@ -171,7 +174,7 @@
<script>
document.addEventListener("DOMContentLoaded", function() {
document.getElementById('like-text').innerText = "Unlike";
document.getElementById('heart-icon').setAttribute("style", "color: red");
document.getElementById('heart-icon').setAttribute("style", "color: inherit");
});
</script>
{% endif %}