diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Settings.vue | 60 | ||||
| -rw-r--r-- | src/components/TileInfoModal.vue | 6 | ||||
| -rw-r--r-- | src/components/TileTree.vue | 16 |
3 files changed, 74 insertions, 8 deletions
diff --git a/src/components/Settings.vue b/src/components/Settings.vue new file mode 100644 index 0000000..8ec3b25 --- /dev/null +++ b/src/components/Settings.vue @@ -0,0 +1,60 @@ +<script lang="ts"> +import {defineComponent, PropType} from 'vue'; + +export default defineComponent({ + props: { + open: {type: Boolean, required: true}, // Indicates whether to show/collapse settings + }, + methods: { + onClick(){ + this.$emit('settings-open'); + }, + closeClicked(evt: Event){ + this.$emit('settings-close'); + }, + }, + emits: ['settings-open', 'settings-close'], +}); +</script> + +<template> +<div> + <div v-if="open" class="absolute bottom-0 right-0 bg-white"> + <div class="absolute top-2 right-2 w-[24px] h-[24px] [font-size:24px] [line-height:24px] text-center + font-bold hover:cursor-pointer" + @click="closeClicked">×</div> + <h1>Settings</h1> + <div> + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation + ullamco laboris nisi ut aliquip ex ea commodo consequat. + Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur + sint occaecat cupidatat non proident, sunt in culpa qui + officia deserunt mollit anim id est laborum. + </div> + </div> + <div v-else class="absolute bottom-0 right-0 w-[100px] h-[100px] overflow-hidden invisible"> + <div class="absolute bottom-[-50px] right-[-50px] w-[100px] h-[100px] visible -rotate-45 + bg-black text-white hover:cursor-pointer" @click="onClick"> + <svg class="w-[24px] h-[24px] mx-auto mt-[9px]" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <circle cx="12" cy="12" r="3"/> + <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 + 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 + 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 + 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 + 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 + 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 + 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 + 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 + 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 + 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 + 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/> + </svg> + </div> + </div> +</div> +</template> diff --git a/src/components/TileInfoModal.vue b/src/components/TileInfoModal.vue index 8b96ebb..b9a8376 100644 --- a/src/components/TileInfoModal.vue +++ b/src/components/TileInfoModal.vue @@ -40,7 +40,7 @@ export default defineComponent({ }, }, methods: { - closeIconClicked(evt: Event){ + closeClicked(evt: Event){ if (evt.target == this.$el || evt.target == this.$refs.closeIcon){ this.$emit('info-modal-close'); } @@ -51,11 +51,11 @@ export default defineComponent({ </script> <template> -<div :style="transitionStyles" class="fixed left-0 top-0 w-full h-full bg-black/40" @click="closeIconClicked"> +<div :style="transitionStyles" class="fixed left-0 top-0 w-full h-full bg-black/40" @click="closeClicked"> <div class="absolute left-1/2 -translate-x-1/2 w-4/5 top-1/2 -translate-y-1/2 p-4 bg-stone-50 rounded-md"> <div class="absolute top-2 right-2 w-[24px] h-[24px] [font-size:24px] [line-height:24px] text-center font-bold hover:cursor-pointer" - @click="closeIconClicked" ref="closeIcon">×</div> + @click="closeClicked" ref="closeIcon">×</div> <h1 class="text-center text-xl font-bold mb-2">{{lastNode != null ? lastNode.name : 'NULL'}}</h1> <hr class="mb-4 border-stone-400"/> <div :style="imgStyles" class="float-left mr-4" alt="an image"></div> diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue index 7bc1ec2..f5a6199 100644 --- a/src/components/TileTree.vue +++ b/src/components/TileTree.vue @@ -3,6 +3,7 @@ import {defineComponent, PropType} from 'vue'; import Tile from './Tile.vue'; import ParentBar from './ParentBar.vue'; import TileInfoModal from './TileInfoModal.vue'; +import Settings from './Settings.vue'; import {TolNode, LayoutNode, initLayoutTree, tryLayout} from '../lib'; import type {LayoutOptions} from '../lib'; // Import paths lack a .ts or .js extension because .ts makes vue-tsc complain, and .js makes vite complain @@ -71,6 +72,7 @@ export default defineComponent({ layoutTree: layoutTree, activeRoot: layoutTree, infoModalNode: null as TolNode | null, // Hides/unhides info modal, and provides the node to display + settingsOpen: false, // Options layoutOptions: {...defaultLayoutOptions}, componentOptions: {...defaultComponentOptions}, @@ -205,6 +207,13 @@ export default defineComponent({ onInfoModalClose(){ this.infoModalNode = null; }, + // + onSettingsOpen(){ + this.settingsOpen = true; + }, + onSettingsClose(){ + this.settingsOpen = false; + }, }, created(){ window.addEventListener('resize', this.onResize); @@ -213,11 +222,7 @@ export default defineComponent({ unmounted(){ window.removeEventListener('resize', this.onResize); }, - components: { - Tile, - ParentBar, - TileInfoModal, - }, + components: {Tile, ParentBar, TileInfoModal, Settings, }, }); </script> @@ -232,6 +237,7 @@ export default defineComponent({ :pos="[0,0]" :dims="parentBarDims" :nodes="sepdParents" :options="componentOptions" @sepd-parent-clicked="onSepdParentClicked" @info-icon-clicked="onInnerInfoIconClicked"/> <tile-info-modal :tolNode="infoModalNode" :options="componentOptions" @info-modal-close="onInfoModalClose"/> + <settings :open="settingsOpen" @settings-open="onSettingsOpen" @settings-close="onSettingsClose"/> </div> </template> |
