diff options
| -rw-r--r-- | .eslintrc.js | 3 | ||||
| -rw-r--r-- | src/App.vue | 28 | ||||
| -rw-r--r-- | src/components/IconButton.vue | 23 | ||||
| -rw-r--r-- | src/components/TestComponent.vue | 8 | ||||
| -rw-r--r-- | src/components/icon/HelpIcon.vue | 7 | ||||
| -rw-r--r-- | src/components/icon/SearchIcon.vue | 7 | ||||
| -rw-r--r-- | src/components/icon/SettingsIcon.vue | 17 |
7 files changed, 80 insertions, 13 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index 556ae40..abbda84 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,8 +10,9 @@ module.exports = { ], "overrides": [ ], - "parser": "@typescript-eslint/parser", + "parser": "vue-eslint-parser", "parserOptions": { + "parser": "@typescript-eslint/parser", "ecmaVersion": "latest", "sourceType": "module" }, diff --git a/src/App.vue b/src/App.vue index f88c1a0..f30339e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,10 +1,30 @@ <template> - <div class="text-stone-100 bg-yellow-700"> - Hello World +<div class="absolute left-0 top-0 w-screen h-screen overflow-hidden flex flex-col" style="bg-stone-800" > + <!-- Title bar --> + <div class="flex shadow gap-2 p-2 bg-stone-900 text-yellow-500"> + <h1 class="my-auto ml-2 text-4xl">Histplorer</h1> + <div class="mx-auto"/> <!-- Spacer --> + <!-- Icons --> + <icon-button :size="45" class="text-stone-50 bg-yellow-600"> + <help-icon/> + </icon-button> + <icon-button :size="45" class="text-stone-50 bg-yellow-600"> + <settings-icon/> + </icon-button> </div> - <test-component/> + <!-- Content area --> + <div class="grow min-h-0 relative bg-stone-800"> + <div class="text-stone-50 p-4">Content</div> + </div> +</div> </template> <script setup lang="ts"> -import TestComponent from './components/TestComponent.vue'; +import {ref, computed, watch, onMounted, onUnmounted, nextTick} from 'vue'; +// Components +import IconButton from './components/IconButton.vue'; +// Icons +import SettingsIcon from './components/icon/SettingsIcon.vue'; +import HelpIcon from './components/icon/HelpIcon.vue'; + </script> diff --git a/src/components/IconButton.vue b/src/components/IconButton.vue new file mode 100644 index 0000000..9357e97 --- /dev/null +++ b/src/components/IconButton.vue @@ -0,0 +1,23 @@ +<template> +<div :style="styles" class="p-2 rounded-full hover:cursor-pointer" + :class="{'hover:brightness-125': !disabled, 'brightness-50': disabled}"> + <slot class="w-full h-full">?</slot> +</div> +</template> + +<script setup lang="ts"> +import {computed} from 'vue'; + +const props = defineProps({ + size: {type: Number, default: 36}, + disabled: {type: Boolean, default: false}, +}); + +const styles = computed(() => ({ + minWidth: props.size + 'px', + maxWidth: props.size + 'px', + minHeight: props.size + 'px', + maxHeight: props.size + 'px', + padding: (props.size / 5) + 'px', +})); +</script> diff --git a/src/components/TestComponent.vue b/src/components/TestComponent.vue deleted file mode 100644 index d2ba0b7..0000000 --- a/src/components/TestComponent.vue +++ /dev/null @@ -1,8 +0,0 @@ -<template> - <div class="text-yellow-500 bg-stone-700"> - Testing - </div> -</template> - -<script setup lang="ts"> -</script> diff --git a/src/components/icon/HelpIcon.vue b/src/components/icon/HelpIcon.vue new file mode 100644 index 0000000..a61553a --- /dev/null +++ b/src/components/icon/HelpIcon.vue @@ -0,0 +1,7 @@ +<template> +<svg viewBox="0 0 512 512"> + <path d="M160 164s1.44-33 33.54-59.46C212.6 88.83 235.49 84.28 256 84c18.73-.23 35.47 2.94 45.48 7.82C318.59 100.2 352 120.6 352 164c0 45.67-29.18 66.37-62.35 89.18S248 298.36 248 324" + fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="45"/> + <circle cx="248" cy="430" r="32" fill="currentColor"/> +</svg> +</template> diff --git a/src/components/icon/SearchIcon.vue b/src/components/icon/SearchIcon.vue new file mode 100644 index 0000000..4a25aea --- /dev/null +++ b/src/components/icon/SearchIcon.vue @@ -0,0 +1,7 @@ +<template> +<svg viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <circle cx="11" cy="11" r="8"/> + <line x1="21" y1="21" x2="16.65" y2="16.65"/> +</svg> +</template> diff --git a/src/components/icon/SettingsIcon.vue b/src/components/icon/SettingsIcon.vue new file mode 100644 index 0000000..e8738a9 --- /dev/null +++ b/src/components/icon/SettingsIcon.vue @@ -0,0 +1,17 @@ +<template> +<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> +</template> |
