Code optimization and fixes
This commit is contained in:
@@ -23,12 +23,17 @@
|
||||
const button = event.currentTarget.querySelector('button')
|
||||
const photoActive = document.querySelector('.gallery .active')
|
||||
const photoToHover = (to === 'prev') ? photoActive.previousSibling : photoActive.nextSibling
|
||||
if (event.type === 'mouseenter') {
|
||||
photoToHover.classList.add('hover')
|
||||
button.focus()
|
||||
} else {
|
||||
photoToHover.classList.remove('hover')
|
||||
button.blur()
|
||||
|
||||
switch (event.type) {
|
||||
case 'mouseenter':
|
||||
photoToHover.classList.add('hover')
|
||||
button.focus()
|
||||
break
|
||||
case 'mouseleave':
|
||||
photoToHover.classList.remove('hover')
|
||||
button.blur()
|
||||
break
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,13 +92,10 @@
|
||||
|
||||
<div class="carousel__information">
|
||||
<div class="carousel__information--location style-location">
|
||||
<!-- <p class="street">{photos[0].name}</p>
|
||||
<p class="style-caps state">{photos[0].location.region}, {photos[0].location.country.name}</p> -->
|
||||
<p class="street">Street Name, Suburb</p>
|
||||
<p class="style-caps state">Region, Country</p>
|
||||
</div>
|
||||
<!-- <div class="carousel__information--location style-location" aria-hidden="true">
|
||||
<p class="street">{photos[1].name}</p>
|
||||
<p class="style-caps state">{photos[1].location.region}, {photos[1].location.country.name}</p>
|
||||
</div> -->
|
||||
<!-- Duplicate for animation? -->
|
||||
{#if viewer}
|
||||
<p class="carousel__information--date">Apr 6th, 2019</p>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user