aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-10-07 14:20:59 +1100
committerTerry Truong <terry06890@gmail.com>2022-10-08 20:08:47 +1100
commitf50ff6be403c19ce44632098104a775f4144ea66 (patch)
treeffabe4a47067409e4d63802000d3a0b86ae6c778 /src/components
parent1c69c4abf6e54ccab886c23cd6e691179ce6f076 (diff)
Add title bar
Add IconButton.vue and components/*Icon.vue files
Diffstat (limited to 'src/components')
-rw-r--r--src/components/IconButton.vue23
-rw-r--r--src/components/TestComponent.vue8
-rw-r--r--src/components/icon/HelpIcon.vue7
-rw-r--r--src/components/icon/SearchIcon.vue7
-rw-r--r--src/components/icon/SettingsIcon.vue17
5 files changed, 54 insertions, 8 deletions
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>