Merge pull request #1454 from ae-utbm/sas-click

Change sas picture on picture click
This commit is contained in:
thomas girod
2026-08-19 18:06:29 +02:00
committed by GitHub
2 changed files with 12 additions and 7 deletions
+3
View File
@@ -48,6 +48,9 @@
height: 100%; height: 100%;
max-width: 100%; max-width: 100%;
object-fit: contain; object-fit: contain;
// Prevent ugly selection when
// clicking to change the image
user-select: none;
} }
} }
} }
+9 -7
View File
@@ -82,7 +82,11 @@
<div class="container" id="pict"> <div class="container" id="pict">
<div class="main"> <div class="main">
<div class="photo" :aria-busy="currentPicture.imageLoading"> <div
class="photo"
:aria-busy="currentPicture.imageLoading"
@click="currentPicture = (($event.offsetX > $event.target.getBoundingClientRect().width / 2) ? nextPicture : previousPicture) ?? currentPicture"
>
<img <img
:src="currentPicture.compressedUrl" :src="currentPicture.compressedUrl"
:alt="currentPicture.name" :alt="currentPicture.name"
@@ -95,13 +99,11 @@
<div class="infos"> <div class="infos">
<h5>{% trans %}Infos{% endtrans %}</h5> <h5>{% trans %}Infos{% endtrans %}</h5>
<div> <div>
<div> <div
<span>{% trans %}Date: {% endtrans %}</span> x-data="{formatter: Intl.DateTimeFormat('{{ LANGUAGE_CODE }}', {dateStyle: 'long'})}"
<span
x-text="Intl.DateTimeFormat(
'{{ LANGUAGE_CODE }}', {dateStyle: 'long'}
).format(Date.parse(currentPicture.date))"
> >
<span>{% trans %}Date: {% endtrans %}</span>
<span x-text="formatter.format(new Date(currentPicture.date))">
</span> </span>
</div> </div>
<div> <div>