chore: minor ui improvements

This commit is contained in:
Liyas Thomas
2022-12-03 13:01:47 +05:30
parent dcbc2f1145
commit a1d69b3210
11 changed files with 151 additions and 210 deletions

View File

@@ -543,12 +543,16 @@ details[open] summary .indicator {
@apply bg-accent #{!important}; @apply bg-accent #{!important};
} }
input[type="color"]::-webkit-color-swatch-wrapper { .color-picker[type="color"] {
@apply rounded; @apply appearance-none;
padding: 0;
} }
input[type="color"]::-webkit-color-swatch { .color-picker[type="color"]::-webkit-color-swatch-wrapper {
@apply rounded; @apply rounded;
border: none; @apply p-0;
}
.color-picker[type="color"]::-webkit-color-swatch {
@apply rounded;
@apply border-0;
} }

View File

@@ -99,6 +99,7 @@ declare module '@vue/runtime-core' {
HttpTests: typeof import('./components/http/Tests.vue')['default'] HttpTests: typeof import('./components/http/Tests.vue')['default']
HttpURLEncodedParams: typeof import('./components/http/URLEncodedParams.vue')['default'] HttpURLEncodedParams: typeof import('./components/http/URLEncodedParams.vue')['default']
IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default'] IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']
IconLucideBrush: typeof import('~icons/lucide/brush')['default']
IconLucideCheckCircle: typeof import('~icons/lucide/check-circle')['default'] IconLucideCheckCircle: typeof import('~icons/lucide/check-circle')['default']
IconLucideChevronRight: typeof import('~icons/lucide/chevron-right')['default'] IconLucideChevronRight: typeof import('~icons/lucide/chevron-right')['default']
IconLucideGlobe: typeof import('~icons/lucide/globe')['default'] IconLucideGlobe: typeof import('~icons/lucide/globe')['default']
@@ -107,9 +108,11 @@ declare module '@vue/runtime-core' {
IconLucideLayers: typeof import('~icons/lucide/layers')['default'] IconLucideLayers: typeof import('~icons/lucide/layers')['default']
IconLucideLoader: typeof import('~icons/lucide/loader')['default'] IconLucideLoader: typeof import('~icons/lucide/loader')['default']
IconLucideMinus: typeof import('~icons/lucide/minus')['default'] IconLucideMinus: typeof import('~icons/lucide/minus')['default']
IconLucideRss: typeof import('~icons/lucide/rss')['default']
IconLucideSearch: typeof import('~icons/lucide/search')['default'] IconLucideSearch: typeof import('~icons/lucide/search')['default']
IconLucideUser: typeof import('~icons/lucide/user')['default'] IconLucideUser: typeof import('~icons/lucide/user')['default']
IconLucideUsers: typeof import('~icons/lucide/users')['default'] IconLucideUsers: typeof import('~icons/lucide/users')['default']
IconLucideVerified: typeof import('~icons/lucide/verified')['default']
LensesHeadersRenderer: typeof import('./components/lenses/HeadersRenderer.vue')['default'] LensesHeadersRenderer: typeof import('./components/lenses/HeadersRenderer.vue')['default']
LensesHeadersRendererEntry: typeof import('./components/lenses/HeadersRendererEntry.vue')['default'] LensesHeadersRendererEntry: typeof import('./components/lenses/HeadersRendererEntry.vue')['default']
LensesRenderersHTMLLensRenderer: typeof import('./components/lenses/renderers/HTMLLensRenderer.vue')['default'] LensesRenderersHTMLLensRenderer: typeof import('./components/lenses/renderers/HTMLLensRenderer.vue')['default']

View File

@@ -149,9 +149,11 @@
</template> </template>
</tippy> </tippy>
<ButtonSecondary <ButtonSecondary
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip', allowHTML: true }"
:title="`${t(
'app.shortcuts'
)} <kbd>${getSpecialKey()}</kbd><kbd>K</kbd>`"
:icon="IconZap" :icon="IconZap"
:title="t('app.shortcuts')"
@click="showShortcuts = true" @click="showShortcuts = true"
/> />
<ButtonSecondary <ButtonSecondary
@@ -223,6 +225,7 @@ import { useReadonlyStream } from "@composables/stream"
import { currentUser$ } from "~/helpers/fb/auth" import { currentUser$ } from "~/helpers/fb/auth"
import { TippyComponent } from "vue-tippy" import { TippyComponent } from "vue-tippy"
import SmartItem from "@components/smart/Item.vue" import SmartItem from "@components/smart/Item.vue"
import { getPlatformSpecialKey as getSpecialKey } from "~/helpers/platformutils"
const t = useI18n() const t = useI18n()
const showShortcuts = ref(false) const showShortcuts = ref(false)

View File

@@ -1,6 +1,6 @@
<template> <template>
<button <button
class="flex items-center flex-1 px-6 py-3 font-medium cursor-pointer transition search-entry focus:outline-none" class="flex items-center flex-1 px-6 py-3 font-medium transition cursor-pointer search-entry focus:outline-none"
:class="{ active: active }" :class="{ active: active }"
tabindex="-1" tabindex="-1"
@click="emit('action', shortcut.action)" @click="emit('action', shortcut.action)"
@@ -8,7 +8,7 @@
> >
<component <component
:is="shortcut.icon" :is="shortcut.icon"
class="mr-4 opacity-50 transition svg-icons" class="mr-4 transition opacity-50 svg-icons"
:class="{ 'opacity-100 text-secondaryDark': active }" :class="{ 'opacity-100 text-secondaryDark': active }"
/> />
<span <span
@@ -51,24 +51,18 @@ const emit = defineEmits<{
<style lang="scss" scoped> <style lang="scss" scoped>
.search-entry { .search-entry {
@apply relative; @apply relative;
@apply after:absolute;
&::after { @apply after:top-0;
@apply absolute; @apply after:left-0;
@apply top-0; @apply after:bottom-0;
@apply left-0; @apply after:bg-transparent;
@apply bottom-0; @apply after:z-2;
@apply bg-transparent; @apply after:w-0.5;
@apply z-2; @apply after:content-DEFAULT;
@apply w-0.5;
content: "";
}
&.active { &.active {
@apply bg-primaryLight; @apply bg-primaryLight;
@apply after:bg-accentLight;
&::after {
@apply bg-accentLight;
}
} }
} }
</style> </style>

View File

@@ -78,26 +78,20 @@ const primaryNavigation = [
@apply justify-center; @apply justify-center;
@apply hover: (bg-primaryDark text-secondaryDark); @apply hover: (bg-primaryDark text-secondaryDark);
@apply focus-visible: text-secondaryDark; @apply focus-visible: text-secondaryDark;
@apply after:absolute;
&::after { @apply after:inset-x-0;
@apply absolute; @apply after:md: inset-x-auto;
@apply inset-x-0; @apply after:md: inset-y-0;
@apply md: inset-x-auto; @apply after:bottom-0;
@apply md: inset-y-0; @apply after:md: bottom-auto;
@apply bottom-0; @apply after:md: left-0;
@apply md: bottom-auto; @apply after:z-2;
@apply md: left-0; @apply after:h-0.5;
@apply z-2; @apply after:md: h-full;
@apply h-0.5; @apply after:w-full;
@apply md: h-full; @apply after:md: w-0.5;
@apply w-full; @apply after:content-DEFAULT;
@apply md: w-0.5; @apply focus: after: bg-divider;
content: "";
}
&:focus::after {
@apply bg-divider;
}
.svg-icons { .svg-icons {
@apply opacity-75; @apply opacity-75;
@@ -112,28 +106,22 @@ const primaryNavigation = [
@apply text-secondaryDark; @apply text-secondaryDark;
@apply bg-primaryLight; @apply bg-primaryLight;
@apply hover: text-secondaryDark; @apply hover: text-secondaryDark;
@apply after:bg-accent;
.svg-icons { .svg-icons {
@apply opacity-100; @apply opacity-100;
} }
&::after {
@apply bg-accent;
}
} }
&.exact-active-link { &.exact-active-link {
@apply text-secondaryDark; @apply text-secondaryDark;
@apply bg-primaryLight; @apply bg-primaryLight;
@apply hover: text-secondaryDark; @apply hover: text-secondaryDark;
@apply after:bg-accent;
.svg-icons { .svg-icons {
@apply opacity-100; @apply opacity-100;
} }
&::after {
@apply bg-accent;
}
} }
} }
</style> </style>

View File

@@ -3,7 +3,7 @@
<template #body> <template #body>
<div class="flex justify-between mb-4"> <div class="flex justify-between mb-4">
<div <div
class="flex items-center border rounded divide-x border-divider divide-divider" class="flex items-center border divide-x rounded border-divider divide-divider"
> >
<label class="mx-4"> <label class="mx-4">
{{ t("mqtt.qos") }} {{ t("mqtt.qos") }}
@@ -61,7 +61,7 @@
id="select-color" id="select-color"
v-model="color" v-model="color"
type="color" type="color"
class="w-8 h-8 p-1 rounded bg-primary" class="w-8 h-8 p-1 rounded bg-primary color-picker"
/> />
</span> </span>
</div> </div>

View File

@@ -9,6 +9,7 @@
id="checkbox" id="checkbox"
type="checkbox" type="checkbox"
name="checkbox" name="checkbox"
class="checkbox"
:checked="on" :checked="on"
@change="emit('change')" @change="emit('change')"
/> />
@@ -35,7 +36,7 @@ const emit = defineEmits<{
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
input[type="checkbox"] { .checkbox[type="checkbox"] {
@apply appearance-none; @apply appearance-none;
@apply hidden; @apply hidden;
@@ -44,7 +45,7 @@ input[type="checkbox"] {
@apply cursor-pointer; @apply cursor-pointer;
&::before { &::before {
@apply border-divider border-2; @apply border-2 border-divider;
@apply rounded; @apply rounded;
@apply group-hover: border-accentDark; @apply group-hover: border-accentDark;
@apply inline-flex; @apply inline-flex;
@@ -54,9 +55,9 @@ input[type="checkbox"] {
@apply h-4; @apply h-4;
@apply w-4; @apply w-4;
@apply font-icon; @apply font-icon;
@apply mr-3; @apply mr-2;
@apply transition; @apply transition;
content: "\e876"; @apply content-["\e876"];
} }
} }

View File

@@ -31,7 +31,7 @@
> >
<Transition name="bounce" appear> <Transition name="bounce" appear>
<div <div
class="inline-block w-full overflow-hidden text-left align-bottom border shadow-lg transition-all transform border-dividerDark bg-primary sm:rounded-xl sm:align-middle" class="inline-block w-full overflow-hidden text-left align-bottom transition-all transform shadow-lg sm:border border-dividerDark bg-primary sm:rounded-xl sm:align-middle"
:class="[{ 'mt-24 md:mb-8': placement === 'top' }, styles]" :class="[{ 'mt-24 md:mb-8': placement === 'top' }, styles]"
> >
<div <div

View File

@@ -182,16 +182,6 @@ const selectTab = (id: string) => {
@apply overflow-auto; @apply overflow-auto;
@apply flex-shrink-0; @apply flex-shrink-0;
// &::after {
// @apply absolute;
// @apply inset-x-0;
// @apply bottom-0;
// @apply bg-dividerLight;
// @apply z-1;
// @apply h-0.5;
// content: "";
// }
.tab { .tab {
@apply relative; @apply relative;
@apply flex; @apply flex;
@@ -205,6 +195,15 @@ const selectTab = (id: string) => {
@apply hover: text-secondaryDark; @apply hover: text-secondaryDark;
@apply focus: outline-none; @apply focus: outline-none;
@apply focus-visible: text-secondaryDark; @apply focus-visible: text-secondaryDark;
@apply after:absolute;
@apply after:left-4;
@apply after:right-4;
@apply after:bottom-0;
@apply after:bg-transparent;
@apply after:z-2;
@apply after:h-0.5;
@apply after:content-DEFAULT;
@apply focus: after: bg-divider;
.tab-info { .tab-info {
@apply inline-flex; @apply inline-flex;
@@ -219,53 +218,29 @@ const selectTab = (id: string) => {
@apply text-secondaryLight; @apply text-secondaryLight;
} }
&::after {
@apply absolute;
@apply left-4;
@apply right-4;
@apply bottom-0;
@apply bg-transparent;
@apply z-2;
@apply h-0.5;
content: "";
}
&:focus::after {
@apply bg-divider;
}
&.active { &.active {
@apply text-secondaryDark; @apply text-secondaryDark;
@apply after:bg-accent;
.tab-info { .tab-info {
@apply text-secondary; @apply text-secondary;
@apply border-dividerDark; @apply border-dividerDark;
} }
&::after {
@apply bg-accent;
}
} }
&.vertical { &.vertical {
@apply p-2; @apply p-2;
@apply rounded; @apply rounded;
@apply focus: after: hidden;
&:focus::after {
@apply hidden;
}
&.active { &.active {
@apply text-accent; @apply text-accent;
@apply after:hidden;
.tab-info { .tab-info {
@apply text-secondary; @apply text-secondary;
@apply border-dividerDark; @apply border-dividerDark;
} }
&::after {
@apply hidden;
}
} }
} }
} }

View File

@@ -9,7 +9,7 @@
<draggable <draggable
v-bind="dragOptions" v-bind="dragOptions"
:list="tabEntries" :list="tabEntries"
:style="tabsWidth" :style="tabStyles"
:item-key="'window-'" :item-key="'window-'"
class="flex flex-shrink-0 overflow-x-auto transition divide-x divide-dividerLight" class="flex flex-shrink-0 overflow-x-auto transition divide-x divide-dividerLight"
@sort="sortTabs" @sort="sortTabs"
@@ -43,7 +43,7 @@
}" }"
:title="t('action.close')" :title="t('action.close')"
:class="[{ active: modelValue === tabID }, 'close']" :class="[{ active: modelValue === tabID }, 'close']"
class="rounded mx-2 !py-0.5 !px-1" class="mx-2 !p-0.5"
@click.stop="emit('removeTab', tabID)" @click.stop="emit('removeTab', tabID)"
/> />
</button> </button>
@@ -127,11 +127,11 @@ const emit = defineEmits<{
(e: "addTab"): void (e: "addTab"): void
}>() }>()
const tabEntries = ref<Array<[string, TabMeta]>>([]) const tabEntries = ref<Array<[string, TabMeta]>>([])
const tabsWidth = computed(() => ({ const tabStyles = computed(() => ({
maxWidth: `${tabEntries.value.length * 184}px`, maxWidth: `${tabEntries.value.length * 184}px`,
width: "100%", width: "100%",
minWidth: "0px", minWidth: "0px",
transition: "max-width 0.2s", // transition: "max-width 0.2s",
})) }))
const dragOptions = { const dragOptions = {
group: "tabs", group: "tabs",
@@ -201,16 +201,13 @@ const addTab = () => {
@apply whitespace-nowrap; @apply whitespace-nowrap;
@apply overflow-auto; @apply overflow-auto;
@apply flex-shrink-0; @apply flex-shrink-0;
@apply after:absolute;
&::after { @apply after:inset-x-0;
@apply absolute; @apply after:bottom-0;
@apply inset-x-0; @apply after:bg-dividerLight;
@apply bottom-0; @apply after:z-10;
@apply bg-dividerLight; @apply after:h-0.25;
@apply z-10; @apply after:content-DEFAULT;
@apply h-0.25;
content: "";
}
.tab { .tab {
@apply relative; @apply relative;
@@ -226,44 +223,20 @@ const addTab = () => {
@apply hover:bg-primaryDark; @apply hover:bg-primaryDark;
@apply hover:text-secondary; @apply hover:text-secondary;
@apply focus-visible:text-secondaryDark; @apply focus-visible:text-secondaryDark;
@apply before:absolute;
&::before { @apply before:left-0;
@apply absolute; @apply before:right-0;
@apply left-0; @apply before:top-0;
@apply right-0; @apply before:bg-transparent;
@apply top-0; @apply before:z-2;
@apply bg-transparent; @apply before:h-0.5;
@apply z-2; @apply before:content-DEFAULT;
@apply h-0.5; @apply focus: before: bg-divider;
content: "";
}
// &::after {
// @apply absolute;
// @apply left-0;
// @apply right-0;
// @apply bottom-0;
// @apply bg-divider;
// @apply z-2;
// @apply h-0.25;
// content: "";
// }
&:focus::before {
@apply bg-divider;
}
&.active { &.active {
@apply text-secondaryDark; @apply text-secondaryDark;
@apply bg-primary; @apply bg-primary;
@apply before:bg-accent;
&::before {
@apply bg-accent;
}
// &::after {
// @apply bg-transparent;
// }
} }
.close { .close {

View File

@@ -284,8 +284,8 @@
</SmartTabs> </SmartTabs>
</div> </div>
</div> </div>
<FirebaseLogin :show="showLogin" @hide-modal="showLogin = false" />
</div> </div>
<FirebaseLogin :show="showLogin" @hide-modal="showLogin = false" />
</div> </div>
</template> </template>