1
0
forked from noxious/client

Added disableBgTexture option to modals

This commit is contained in:
Dennis Postma 2024-11-17 00:39:28 +01:00
parent 7c8b5f3e82
commit 1e3fc2b0f8
4 changed files with 28 additions and 14 deletions

18
package-lock.json generated
View File

@ -3523,9 +3523,9 @@
} }
}, },
"node_modules/dexie": { "node_modules/dexie": {
"version": "4.0.9", "version": "4.0.10",
"resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.9.tgz", "resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.10.tgz",
"integrity": "sha512-VQG1huEVSAdDZssb9Bb9mFy+d3jAE0PT4d1nIRYlT46ip1fzbs1tXi0SlUayRDgV3tTbJG8ZRqAo2um49gtynA==", "integrity": "sha512-eM2RzuR3i+M046r2Q0Optl3pS31qTWf8aFuA7H9wnsHTwl8EPvroVLwvQene/6paAs39Tbk6fWZcn2aZaHkc/w==",
"license": "Apache-2.0" "license": "Apache-2.0"
}, },
"node_modules/didyoumean": { "node_modules/didyoumean": {
@ -3621,9 +3621,9 @@
} }
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.60", "version": "1.5.62",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.60.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.62.tgz",
"integrity": "sha512-HcraRUkTKJ+8yA3b10i9qvhUlPBRDlKjn1XGek1zDGVfAKcvi8TsUnImGqLiEm9j6ZulxXIWWIo9BmbkbCTGgA==", "integrity": "sha512-t8c+zLmJHa9dJy96yBZRXGQYoiCEnHYgFwn1asvSPZSUdVxnB62A4RASd7k41ytG3ErFBA0TpHlKg9D9SQBmLg==",
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
@ -5827,9 +5827,9 @@
} }
}, },
"node_modules/phaser3-rex-plugins": { "node_modules/phaser3-rex-plugins": {
"version": "1.80.10", "version": "1.80.11",
"resolved": "https://registry.npmjs.org/phaser3-rex-plugins/-/phaser3-rex-plugins-1.80.10.tgz", "resolved": "https://registry.npmjs.org/phaser3-rex-plugins/-/phaser3-rex-plugins-1.80.11.tgz",
"integrity": "sha512-7qpWkpFmXobkpMSFEIRcVnotpAYZDksGzgCuZrzDAy+vtmKex5bTdSEZ8UDYYwYgkuAhVoMsveFF6oDfGOSY4Q==", "integrity": "sha512-it+rV0ElkAd0jjSLqSewLBk91vFzb+P/HxOfFhs9xdc+HfANDmNTLwFxiBIvuXEn84nyiCn1VR08Fcnyw7DuyQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@ -1,5 +1,5 @@
<template> <template>
<Modal :isModalOpen="gameStore.uiSettings.isGmPanelOpen" @modal:close="() => gameStore.toggleGmPanel()" :modal-width="1000" :modal-height="650" :can-full-screen="true"> <Modal :isModalOpen="gameStore.uiSettings.isGmPanelOpen" @modal:close="() => gameStore.toggleGmPanel()" :modal-width="1000" :modal-height="650" :can-full-screen="true" :disable-bg-texture="true">
<template #modalHeader> <template #modalHeader>
<div class="flex gap-1.5 flex-wrap"> <div class="flex gap-1.5 flex-wrap">
<button @mousedown.stop class="btn-cyan py-1.5 px-4 min-w-24">General</button> <button @mousedown.stop class="btn-cyan py-1.5 px-4 min-w-24">General</button>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="mb-4 flex flex-col gap-3"> <div class="mb-4 flex flex-col gap-3">
<div @click="toggle" class="p-3 bg-gray-100 bg-opacity-50 rounded hover:bg-gray-200 text-white font-default cursor-pointer"> <div @click="toggle" class="p-3 bg-gray-200 bg-opacity-50 rounded hover:bg-gray-300 text-white font-default cursor-pointer">
<slot name="header" /> <slot name="header" />
</div> </div>
<transition enter-active-class="transition-all duration-300 ease-in-out" leave-active-class="transition-all duration-300 ease-in-out" enter-from-class="opacity-0 max-h-0" enter-to-class="opacity-100 max-h-96" leave-from-class="opacity-100 max-h-96" leave-to-class="opacity-0 max-h-0"> <transition enter-active-class="transition-all duration-300 ease-in-out" leave-active-class="transition-all duration-300 ease-in-out" enter-from-class="opacity-0 max-h-0" enter-to-class="opacity-100 max-h-96" leave-from-class="opacity-100 max-h-96" leave-to-class="opacity-0 max-h-0">

View File

@ -3,7 +3,13 @@
<div v-if="isModalOpenRef" class="fixed border-solid border-2 border-gray-500 z-50 flex flex-col backdrop-blur-sm shadow-lg" :style="modalStyle"> <div v-if="isModalOpenRef" class="fixed border-solid border-2 border-gray-500 z-50 flex flex-col backdrop-blur-sm shadow-lg" :style="modalStyle">
<!-- Header --> <!-- Header -->
<div @mousedown="startDrag" class="cursor-move p-2.5 flex justify-between items-center border-solid border-0 border-b border-gray-500 relative"> <div @mousedown="startDrag" class="cursor-move p-2.5 flex justify-between items-center border-solid border-0 border-b border-gray-500 relative">
<div class="rounded-t absolute w-full h-full top-0 left-0 bg-[url('/assets/ui-texture.png')] bg-no-repeat bg-center bg-cover opacity-90" /> <div
:class="{
'bg-[url(/assets/ui-texture.png)] bg-no-repeat bg-center bg-cover opacity-90': !disableBgTexture,
'bg-gray-700': disableBgTexture
}"
class="rounded-t absolute w-full h-full top-0 left-0"
/>
<div class="relative z-10"> <div class="relative z-10">
<slot name="modalHeader" /> <slot name="modalHeader" />
</div> </div>
@ -19,7 +25,13 @@
<!-- Body --> <!-- Body -->
<div class="overflow-hidden grow relative"> <div class="overflow-hidden grow relative">
<div class="rounded-b absolute w-full h-full top-0 left-0 bg-[url('/assets/ui-texture.png')] bg-no-repeat bg-cover bg-center opacity-90" /> <div
:class="{
'bg-[url(/assets/ui-texture.png)] bg-no-repeat bg-center bg-cover opacity-90': !disableBgTexture,
'bg-gray-700': disableBgTexture
}"
class="rounded-b absolute w-full h-full top-0 left-0"
/>
<div class="relative z-10 h-full"> <div class="relative z-10 h-full">
<slot name="modalBody" /> <slot name="modalBody" />
</div> </div>
@ -41,6 +53,7 @@ interface ModalProps {
modalPositionY?: number modalPositionY?: number
modalWidth?: number modalWidth?: number
modalHeight?: number modalHeight?: number
disableBgTexture?: boolean
} }
interface Position { interface Position {
@ -58,7 +71,8 @@ const props = withDefaults(defineProps<ModalProps>(), {
modalPositionX: 0, modalPositionX: 0,
modalPositionY: 0, modalPositionY: 0,
modalWidth: 500, modalWidth: 500,
modalHeight: 280 modalHeight: 280,
disableBgTexture: false
}) })
const emit = defineEmits<{ const emit = defineEmits<{