This repository has been archived on 2026-10-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
SnapEdit/frontend/src/components/Gallery.vue
T

65 lines
1.2 KiB
Vue

<script setup lang="ts">
import { defineComponent } from 'vue'
import { ImageType } from '@/image'
import Image from '@/components/Image.vue'
</script>
<script lang="ts">
export default defineComponent({
props: {
images: {
type: Map<number, ImageType>,
required: true
}
}
})
</script>
<template>
<div class="flex" v-if="images.keys !== null">
<div v-for="[id, image] in images" :key="id" class="image">
<label>{{ image.name }}</label>
<Image class="gallery" :id="id" :images="images" redirect="home" />
</div>
</div>
<h1 v-else>No image found</h1>
</template>
<style scoped>
.flex {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.image {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 5px;
padding: 0.5rem;
background-color: #1a1a1a;
color: white;
border-radius: 8px;
border: 1px solid transparent;
}
.image:hover {
border-color: #646cff;
}
label {
font-size: 1.5em;
color: white;
}
</style>
<style>
.gallery.imageContainer img {
margin: 5px;
max-width: max(33vw, calc(90vw/v-bind('images.size')));
max-height: max(33vh, calc(90vh/v-bind('images.size')));
margin: 2vw;
}
</style>