Skip to content

Commit

Permalink
disable image zoom on small screens so pinch to zoom works
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolarosa committed Jun 14, 2024
1 parent d8852a4 commit 6d1510b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/vue-components/Image.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<template>
<div class="flex flex-col">
<img :src="src" data-zoomable />
<TipComponent>Click the image for a closer look!</TipComponent>
<div v-if="enableZoom">
<img :src="src" data-zoomable />
<TipComponent>Click the image for a closer look!</TipComponent>
</div>
<div v-else>
<img :src="src" />
</div>
</div>
</template>

<script setup>
const props = defineProps({
src: { type: String, required: true },
});
const enableZoom = window.innerWidth > "900" ? true : false;
</script>

0 comments on commit 6d1510b

Please sign in to comment.