Skip to content

Commit

Permalink
Gallery tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
José Luis Pereira committed Jul 26, 2022
1 parent 31ab21d commit 3ba8cf1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/assets/css/webkit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
}

::-webkit-scrollbar-thumb {
border-radius: 5px;
background: rgb(0,0,0, .16);
@apply rounded;
@apply bg-gray-300;
@apply dark:bg-slate-600;
}

::-webkit-scrollbar-track {
background: rgb(0,0,0, .06);
@apply bg-gray-100;
@apply dark:bg-slate-700;
}
2 changes: 1 addition & 1 deletion src/components/Gallery/GalleryThumbnail.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="bg-white dark:bg-gray-800 flex flex-col justify-center cursor-pointer w-24 max-h-20 h-20 dark:border-gray-600 rounded border-2"
class="bg-white dark:bg-gray-800 flex flex-col justify-center cursor-pointer w-24 max-h-20 h-20 dark:border-gray-600 rounded-md border-2"
:title="title"
>
<img
Expand Down
28 changes: 19 additions & 9 deletions src/components/ImageViewer/ImageViewer.global.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/>
</div>
</div>
<div class="bottom-0 fixed overflow-x-auto max-w-full pb-2">
<div class="bottom-0 fixed max-w-full w-full">
<div
class="
text-white
Expand All @@ -52,12 +52,15 @@
:attribution="image.attribution"
/>
</div>
<GalleryThumbnailList
:current="index"
:images="images"
@select-index="emit('selectIndex', $event)"
@click.stop
/>
<div class="flex justify-center">
<GalleryThumbnailList
class="pb-2"
:current="index"
:images="images"
@select-index="emit('selectIndex', $event)"
@click.stop
/>
</div>
</div>
<ImageToolbar
class="w-full absolute top-0 h-12 left-0"
Expand Down Expand Up @@ -133,8 +136,15 @@ const image = computed(() => props.images[props.index])
document.addEventListener('keyup', handleKeyboard)
onMounted(() => imageElement.value.addEventListener('load', () => isLoading.value = false))
onUnmounted(() => document.removeEventListener('keyup', handleKeyboard))
onMounted(() => {
imageElement.value.addEventListener('load', () => isLoading.value = false)
document.body.classList.add('overflow-hidden')
})
onUnmounted(() => {
document.removeEventListener('keyup', handleKeyboard)
document.body.classList.remove('overflow-hidden')
})
watch(
() => props.index,
Expand Down

0 comments on commit 3ba8cf1

Please sign in to comment.