Photo: Fix number positioning and parallax effect
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-25 12:28:47 +01:00
parent 8f73e3d56e
commit 7d8285ac6d
4 changed files with 75 additions and 32 deletions

View File

@@ -21,6 +21,9 @@
const imgAlt = `${photo.name}, ${location.region}, ${location.country.name}`
const photoHref = `/viewer/${location.country.slug}/${location.slug}/${photo.slug}`
// Photo index
const photoIndex = (index < 10 ? '0': '') + index
/*
** Run code when mounted
@@ -69,9 +72,9 @@
<time class="photo__date" datetime={formatDate(photo.date, 'DATETIME')}>
{formatDate(photo.date, 'FULL')}
</time>
<span class="photo__number">
{(index < 10 ? '0': '') + index}
</span>
<div class="photo__number">
<span id="photo_number">{photoIndex}</span>
</div>
</div>
</div>
</div>