2021-05-22 20:29:06 +00:00
|
|
|
<template>
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
<teleport to="#modal-root">
|
|
|
|
<transition
|
|
|
|
name="modal"
|
2022-01-25 04:25:34 +00:00
|
|
|
@before-enter="isAnimating = true"
|
|
|
|
@after-leave="isAnimating = false"
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
>
|
|
|
|
<div
|
|
|
|
class="modal-mask"
|
2022-01-14 04:25:47 +00:00
|
|
|
v-show="modelValue"
|
|
|
|
v-on:pointerdown.self="close"
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
v-bind="$attrs"
|
|
|
|
>
|
|
|
|
<div class="modal-wrapper">
|
|
|
|
<div class="modal-container">
|
|
|
|
<div class="modal-header">
|
2022-01-25 04:23:30 +00:00
|
|
|
<slot name="header" :shown="isOpen"> default header </slot>
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2022-03-20 18:57:45 +00:00
|
|
|
<Context ref="contextRef">
|
2022-01-25 04:23:30 +00:00
|
|
|
<slot name="body" :shown="isOpen"> default body </slot>
|
2022-03-20 18:57:45 +00:00
|
|
|
</Context>
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2022-01-14 04:25:47 +00:00
|
|
|
<slot name="footer" :shown="isOpen">
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
<div class="modal-default-footer">
|
|
|
|
<div class="modal-default-flex-grow"></div>
|
2022-01-14 04:25:47 +00:00
|
|
|
<button class="button modal-default-button" @click="close">
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
Close
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</teleport>
|
2021-05-22 20:29:06 +00:00
|
|
|
</template>
|
|
|
|
|
2022-01-14 04:25:47 +00:00
|
|
|
<script setup lang="ts">
|
2022-06-27 00:17:22 +00:00
|
|
|
import type { FeatureNode } from "game/layers";
|
2022-01-25 04:25:34 +00:00
|
|
|
import { computed, ref, toRefs } from "vue";
|
2022-03-20 18:57:45 +00:00
|
|
|
import Context from "./Context.vue";
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
|
2022-01-25 04:25:34 +00:00
|
|
|
const _props = defineProps<{
|
2022-01-14 04:25:47 +00:00
|
|
|
modelValue: boolean;
|
|
|
|
}>();
|
2022-01-25 04:25:34 +00:00
|
|
|
const props = toRefs(_props);
|
2022-01-14 04:25:47 +00:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(e: "update:modelValue", value: boolean): void;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const isOpen = computed(() => props.modelValue || isAnimating.value);
|
|
|
|
function close() {
|
|
|
|
emit("update:modelValue", false);
|
|
|
|
}
|
|
|
|
|
|
|
|
const isAnimating = ref(false);
|
2022-01-25 04:25:34 +00:00
|
|
|
|
2022-03-20 18:57:45 +00:00
|
|
|
const contextRef = ref<typeof Context | null>(null);
|
|
|
|
const nodes = computed<Record<string, FeatureNode | undefined> | null>(
|
|
|
|
() => contextRef.value?.nodes ?? null
|
2022-03-20 17:30:08 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
defineExpose({ isOpen, nodes });
|
2021-05-22 20:29:06 +00:00
|
|
|
</script>
|
|
|
|
|
2022-02-27 19:49:34 +00:00
|
|
|
<style>
|
2021-05-22 20:29:06 +00:00
|
|
|
.modal-mask {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
position: fixed;
|
|
|
|
z-index: 9998;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
|
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
|
|
transition: opacity 0.3s ease;
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.modal-wrapper {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
position: absolute;
|
|
|
|
left: 50%;
|
|
|
|
top: 50%;
|
|
|
|
transform: translate(-50%, -50%);
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.modal-container {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
width: 640px;
|
|
|
|
max-width: 95vw;
|
2021-06-12 04:38:16 +00:00
|
|
|
max-height: 95vh;
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
background-color: var(--background);
|
|
|
|
padding: 20px;
|
|
|
|
border-radius: 5px;
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
text-align: left;
|
|
|
|
border: var(--modal-border);
|
2021-06-12 04:38:16 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.modal-header {
|
|
|
|
width: 100%;
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.modal-body {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
margin: 20px 0;
|
2021-06-12 04:38:16 +00:00
|
|
|
width: 100%;
|
2021-06-22 08:34:59 +00:00
|
|
|
overflow-y: auto;
|
|
|
|
overflow-x: hidden;
|
2021-06-12 04:38:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.modal-footer {
|
|
|
|
width: 100%;
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.modal-default-footer {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
display: flex;
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.modal-default-flex-grow {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
flex-grow: 1;
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
|
2021-07-24 22:08:52 +00:00
|
|
|
.modal-enter-from {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
opacity: 0;
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.modal-leave-active {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
opacity: 0;
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
|
2021-07-24 22:08:52 +00:00
|
|
|
.modal-enter-from .modal-container,
|
2021-05-22 20:29:06 +00:00
|
|
|
.modal-leave-active .modal-container {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-17 04:30:54 +00:00
|
|
|
-webkit-transform: scale(1.1);
|
|
|
|
transform: scale(1.1);
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
|
|
|
</style>
|