Skip to content

Commit

Permalink
fix gallery column count
Browse files Browse the repository at this point in the history
  • Loading branch information
ninedev-i committed Feb 14, 2025
1 parent c88427e commit 1dc7895
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/content/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const props = defineProps<{ data: [string, string, number][]; withBorder?: boole
const photos = ref();
const openedPhoto = ref(null);
const numberOfColumns = computed(() => props.data.length >= 5 ? 5 : props.data.length);
const numberOfGalleryColumns = computed(() => props.data.length >= 5 ? 5 : props.data.length);
const susbscribeKeyPress = debounce(function({ keyCode }) {
if (!openedPhoto.value) {
Expand Down Expand Up @@ -57,13 +57,13 @@ watch(openedPhoto, () => {
</div>
</template>

<style>
<style scoped>
.gallery {
gap: 0 12px;
max-width: 100%;
clear: both;
display: grid;
grid-template-columns: repeat(v-bind('numberOfColumns'), 1fr);
grid-template-columns: repeat(v-bind('numberOfGalleryColumns'), 1fr);
width: fit-content;
@media (max-width: 700px) {
Expand Down

0 comments on commit 1dc7895

Please sign in to comment.