portfolio/components/SimpleModal.vue

36 lines
861 B
Vue
Raw Normal View History

2026-03-08 11:42:09 +01:00
<template>
<Teleport to="body">
<div v-if="modelValue" class="fixed inset-0 z-50">
<!-- Backdrop - click to close -->
<div class="fixed inset-0 bg-black/50 cursor-pointer" @click="close"></div>
2026-03-08 11:42:09 +01:00
<!-- Modal Panel -->
<div class="fixed inset-0 flex items-center justify-center pointer-events-none">
2026-03-08 11:42:09 +01:00
<div
class="bg-white rounded-lg shadow-xl w-[80vw] aspect-video max-h-[85vh] overflow-hidden relative pointer-events-auto"
2026-03-08 11:42:09 +01:00
:style="{ maxHeight }"
>
<!-- Content -->
<slot />
</div>
</div>
</div>
</Teleport>
</template>
<script setup>
defineProps({
2026-03-08 11:42:09 +01:00
modelValue: Boolean,
maxHeight: {
type: String,
default: '85vh'
}
})
const emit = defineEmits(['update:modelValue'])
const close = () => {
emit('update:modelValue', false)
}
</script>