Tweaks and fixes
This commit is contained in:
@@ -75,33 +75,12 @@
|
||||
}
|
||||
})
|
||||
|
||||
// Keyboard navigation
|
||||
const keyboardNav = event => {
|
||||
const keyCode = event.keyCode
|
||||
|
||||
switch (event.keyCode) {
|
||||
case 37: case 80: case 74:
|
||||
document.querySelector('.carousel__controls--area.prev').click()
|
||||
break
|
||||
case 39: case 78: case 75:
|
||||
document.querySelector('.carousel__controls--area.next').click()
|
||||
break
|
||||
case 27: case 67:
|
||||
document.getElementById('photo_close').click()
|
||||
break
|
||||
default: break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Run code on browser only
|
||||
*/
|
||||
onMount(() => {
|
||||
changeWindowWidth = () => {
|
||||
windowWidth = window.innerWidth
|
||||
}
|
||||
changeWindowWidth()
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -109,7 +88,7 @@
|
||||
<title>Houses Of - photoName photoCountryName</title>
|
||||
</svelte:head>
|
||||
|
||||
<svelte:window on:keydown={keyboardNav} on:resize={changeWindowWidth} />
|
||||
<svelte:window bind:innerWidth={windowWidth} />
|
||||
|
||||
<section class="viewer">
|
||||
<div class="viewer__top">
|
||||
@@ -129,7 +108,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Carousel viewer={true} {photos} />
|
||||
<Carousel {photos} viewer={true} />
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user