/
IDEPage.vue
38 lines (36 loc) · 1019 Bytes
/
IDEPage.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<script setup lang="ts">
import { computed, ref } from "vue";
import ExplorerPanel from "@/components/explorer/ExplorerPanel.vue";
import PreviewGame from "@/components/preview/PreviewGame.vue";
import EditorPanel from "@/components/editor/EditorPanel.vue";
const narratSize = ref(50);
function setNarratSize(size: number) {
narratSize.value = Math.max(0, Math.min(100, size));
}
function grow() {
setNarratSize(narratSize.value + 10);
}
function shrink() {
setNarratSize(narratSize.value - 10);
}
const narratStyle = computed(() => {
return {
width: `${narratSize.value}%`,
};
});
const editorStyle = computed(() => {
return {
width: `${100 - narratSize.value}%`,
};
});
</script>
<template>
<div class="w-full bg-neutral-900">
<div class="gap-4 w-full editor-layout flex justify-between h-screen">
<ExplorerPanel class="flex-shrink-[5]" />
<EditorPanel :style="editorStyle" />
<PreviewGame :style="narratStyle" />
</div>
</div>
</template>
<style scoped></style>