2022-06-20 17:38:49 +09:00
|
|
|
<template>
|
2023-02-11 13:08:18 +09:00
|
|
|
<div v-if="show" ref="el" :class="[$style.root]" :style="{ background: bg }">
|
|
|
|
<div :class="[$style.upper, { [$style.slim]: narrow, [$style.thin]: thin_ }]">
|
|
|
|
<div v-if="narrow && props.displayMyAvatar && $i" class="_button" :class="$style.buttonsLeft" @click="openAccountMenu">
|
|
|
|
<MkAvatar :class="$style.avatar" :user="$i" />
|
|
|
|
</div>
|
|
|
|
<div v-else-if="narrow && !hideTitle" :class="$style.buttonsLeft" />
|
|
|
|
|
|
|
|
<template v-if="metadata">
|
|
|
|
<div v-if="!hideTitle" :class="$style.titleContainer" @click="top">
|
|
|
|
<MkAvatar v-if="metadata.avatar" :class="$style.titleAvatar" :user="metadata.avatar" indicator/>
|
|
|
|
<i v-else-if="metadata.icon" :class="[$style.titleIcon, metadata.icon]"></i>
|
|
|
|
|
|
|
|
<div :class="$style.title">
|
|
|
|
<MkUserName v-if="metadata.userName" :user="metadata.userName" :nowrap="true"/>
|
|
|
|
<div v-else-if="metadata.title">{{ metadata.title }}</div>
|
|
|
|
<div v-if="metadata.subtitle" :class="$style.subtitle">
|
|
|
|
{{ metadata.subtitle }}
|
|
|
|
</div>
|
2022-06-20 17:38:49 +09:00
|
|
|
</div>
|
2023-02-11 13:08:18 +09:00
|
|
|
</div>
|
|
|
|
<div v-if="!narrow || hideTitle" :class="$style.tabs" @wheel="onTabWheel">
|
|
|
|
<div :class="$style.tabsInner">
|
|
|
|
<button v-for="t in tabs" :ref="(el) => tabRefs[t.key] = (el as HTMLElement)" v-tooltip.noDelay="t.title" class="_button" :class="[$style.tab, { [$style.active]: t.key != null && t.key === props.tab }]" @mousedown="(ev) => onTabMousedown(t, ev)" @click="(ev) => onTabClick(t, ev)">
|
|
|
|
<div :class="$style.tabInner">
|
|
|
|
<i v-if="t.icon" :class="[$style.tabIcon, t.icon]"></i>
|
|
|
|
<div v-if="!t.iconOnly" :class="$style.tabTitle">{{ t.title }}</div>
|
|
|
|
<Transition
|
|
|
|
v-else
|
|
|
|
@enter="enter"
|
|
|
|
@after-enter="afterEnter"
|
|
|
|
@leave="leave"
|
|
|
|
@after-leave="afterLeave"
|
|
|
|
mode="in-out"
|
|
|
|
>
|
|
|
|
<div v-if="t.key === tab" :class="$style.tabTitle">{{ t.title }}</div>
|
|
|
|
</Transition>
|
|
|
|
</div>
|
|
|
|
</button>
|
2022-06-20 17:38:49 +09:00
|
|
|
</div>
|
2023-02-11 13:08:18 +09:00
|
|
|
<div ref="tabHighlightEl" :class="$style.tabHighlight"></div>
|
2022-06-20 17:38:49 +09:00
|
|
|
</div>
|
2023-02-11 13:08:18 +09:00
|
|
|
</template>
|
|
|
|
<div v-if="(narrow && !hideTitle) || (actions && actions.length > 0)" :class="$style.buttonsRight">
|
|
|
|
<template v-for="action in actions">
|
|
|
|
<button v-tooltip.noDelay="action.text" class="_button" :class="[$style.button, { [$style.highlighted]: action.highlighted }]" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
|
|
|
|
</template>
|
2022-06-20 17:38:49 +09:00
|
|
|
</div>
|
2023-02-11 13:08:18 +09:00
|
|
|
</div>
|
|
|
|
<div v-if="(narrow && !hideTitle) && hasTabs" :class="[$style.lower, { [$style.slim]: narrow, [$style.thin]: thin_ }]">
|
|
|
|
<div :class="$style.tabs" @wheel="onTabWheel">
|
|
|
|
<div :class="$style.tabsInner">
|
|
|
|
<button v-for="tab in tabs" :ref="(el) => tabRefs[tab.key] = (el as HTMLElement)" v-tooltip.noDelay="tab.title" class="_button" :class="[$style.tab, { [$style.active]: tab.key != null && tab.key === props.tab }]" @mousedown="(ev) => onTabMousedown(tab, ev)" @click="(ev) => onTabClick(tab, ev)">
|
|
|
|
<i v-if="tab.icon" :class="[$style.tabIcon, tab.icon]"></i>
|
|
|
|
<span v-if="!tab.iconOnly" :class="$style.tabTitle">{{ tab.title }}</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2023-01-14 12:15:02 +09:00
|
|
|
<div ref="tabHighlightEl" :class="$style.tabHighlight"></div>
|
2022-06-20 17:38:49 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2022-12-25 15:48:51 +09:00
|
|
|
import { onMounted, onUnmounted, ref, inject, watch, nextTick } from 'vue';
|
2022-06-20 17:38:49 +09:00
|
|
|
import tinycolor from 'tinycolor2';
|
|
|
|
import { scrollToTop } from '@/scripts/scroll';
|
|
|
|
import { globalEvents } from '@/events';
|
2022-06-22 16:29:21 +09:00
|
|
|
import { injectPageMetadata } from '@/scripts/page-metadata';
|
2023-02-11 13:08:18 +09:00
|
|
|
import { $i, openAccountMenu as openAccountMenu_ } from '@/account';
|
2022-06-22 16:29:21 +09:00
|
|
|
|
|
|
|
type Tab = {
|
2022-12-25 15:48:51 +09:00
|
|
|
key: string;
|
2022-06-22 16:29:21 +09:00
|
|
|
title: string;
|
|
|
|
icon?: string;
|
|
|
|
iconOnly?: boolean;
|
|
|
|
onClick?: (ev: MouseEvent) => void;
|
|
|
|
};
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2022-12-25 15:48:51 +09:00
|
|
|
const props = withDefaults(defineProps<{
|
2022-06-22 16:29:21 +09:00
|
|
|
tabs?: Tab[];
|
|
|
|
tab?: string;
|
2022-06-20 17:38:49 +09:00
|
|
|
actions?: {
|
|
|
|
text: string;
|
|
|
|
icon: string;
|
2022-12-25 15:48:51 +09:00
|
|
|
highlighted?: boolean;
|
2022-06-20 17:38:49 +09:00
|
|
|
handler: (ev: MouseEvent) => void;
|
|
|
|
}[];
|
|
|
|
thin?: boolean;
|
2022-08-13 17:41:17 +09:00
|
|
|
displayMyAvatar?: boolean;
|
2022-12-25 15:48:51 +09:00
|
|
|
}>(), {
|
2023-01-02 16:41:09 +09:00
|
|
|
tabs: () => ([] as Tab[]),
|
2022-12-25 15:48:51 +09:00
|
|
|
});
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2022-06-22 16:29:21 +09:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'update:tab', key: string);
|
|
|
|
}>();
|
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
const metadata = injectPageMetadata();
|
|
|
|
|
|
|
|
const hideTitle = inject('shouldOmitHeaderTitle', false);
|
|
|
|
const thin_ = props.thin || inject('shouldHeaderThin', false);
|
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
let el = $shallowRef<HTMLElement | undefined>(undefined);
|
2022-12-25 15:48:51 +09:00
|
|
|
const tabRefs: Record<string, HTMLElement | null> = {};
|
2023-02-11 13:08:18 +09:00
|
|
|
let tabHighlightEl = $shallowRef<HTMLElement | null>(null);
|
2022-12-25 15:48:51 +09:00
|
|
|
const bg = ref<string | undefined>(undefined);
|
2022-06-20 17:38:49 +09:00
|
|
|
let narrow = $ref(false);
|
2022-12-25 15:48:51 +09:00
|
|
|
const hasTabs = $computed(() => props.tabs.length > 0);
|
2022-06-20 17:38:49 +09:00
|
|
|
const hasActions = $computed(() => props.actions && props.actions.length > 0);
|
|
|
|
const show = $computed(() => {
|
|
|
|
return !hideTitle || hasTabs || hasActions;
|
|
|
|
});
|
|
|
|
|
|
|
|
const preventDrag = (ev: TouchEvent) => {
|
|
|
|
ev.stopPropagation();
|
|
|
|
};
|
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
const top = () => {
|
2022-12-25 15:48:51 +09:00
|
|
|
if (el) {
|
|
|
|
scrollToTop(el as HTMLElement, { behavior: 'smooth' });
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
};
|
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
function openAccountMenu(ev: MouseEvent) {
|
|
|
|
openAccountMenu_({
|
|
|
|
withExtraOperation: true,
|
|
|
|
}, ev);
|
|
|
|
}
|
|
|
|
|
2022-06-22 16:29:21 +09:00
|
|
|
function onTabMousedown(tab: Tab, ev: MouseEvent): void {
|
|
|
|
// ユーザビリティの観点からmousedown時にはonClickは呼ばない
|
|
|
|
if (tab.key) {
|
|
|
|
emit('update:tab', tab.key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
function onTabClick(t: Tab, ev: MouseEvent): void {
|
|
|
|
if (t.key === props.tab) {
|
|
|
|
top();
|
|
|
|
} else if (t.onClick) {
|
2022-06-22 20:47:53 +09:00
|
|
|
ev.preventDefault();
|
|
|
|
ev.stopPropagation();
|
2023-02-11 13:08:18 +09:00
|
|
|
t.onClick(ev);
|
2022-06-22 20:47:53 +09:00
|
|
|
}
|
2023-02-11 13:08:18 +09:00
|
|
|
|
|
|
|
if (t.key) {
|
|
|
|
emit('update:tab', t.key);
|
2022-06-22 16:29:21 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
const calcBg = () => {
|
|
|
|
const rawBg = metadata?.bg || 'var(--bg)';
|
|
|
|
const tinyBg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);
|
|
|
|
tinyBg.setAlpha(0.85);
|
|
|
|
bg.value = tinyBg.toRgbString();
|
|
|
|
};
|
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
let ro1: ResizeObserver | null;
|
|
|
|
let ro2: ResizeObserver | null;
|
|
|
|
|
|
|
|
function renderTab() {
|
|
|
|
const tabEl = props.tab ? tabRefs[props.tab] : undefined;
|
|
|
|
if (tabEl && tabHighlightEl && tabHighlightEl.parentElement) {
|
|
|
|
// offsetWidth や offsetLeft は少数を丸めてしまうため getBoundingClientRect を使う必要がある
|
|
|
|
// https://developer.mozilla.org/ja/docs/Web/API/HTMLElement/offsetWidth#%E5%80%A4
|
|
|
|
const parentRect = tabHighlightEl.parentElement.getBoundingClientRect();
|
|
|
|
const rect = tabEl.getBoundingClientRect();
|
|
|
|
tabHighlightEl.style.width = rect.width + 'px';
|
|
|
|
tabHighlightEl.style.left = (rect.left - parentRect.left + tabHighlightEl.parentElement.scrollLeft) + 'px';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function onTabWheel(ev: WheelEvent) {
|
|
|
|
if (ev.deltaY !== 0 && ev.deltaX === 0) {
|
|
|
|
ev.preventDefault();
|
|
|
|
ev.stopPropagation();
|
|
|
|
(ev.currentTarget as HTMLElement).scrollBy({
|
|
|
|
left: ev.deltaY,
|
|
|
|
behavior: 'smooth',
|
|
|
|
});
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function enter(el: HTMLElement) {
|
|
|
|
const elementWidth = el.getBoundingClientRect().width;
|
|
|
|
el.style.width = '0';
|
|
|
|
el.offsetWidth; // reflow
|
|
|
|
el.style.width = elementWidth + 'px';
|
|
|
|
setTimeout(renderTab, 70);
|
|
|
|
}
|
|
|
|
function afterEnter(el: HTMLElement) {
|
|
|
|
el.style.width = '';
|
|
|
|
nextTick(renderTab);
|
|
|
|
}
|
|
|
|
function leave(el: HTMLElement) {
|
|
|
|
const elementWidth = el.getBoundingClientRect().width;
|
|
|
|
el.style.width = elementWidth + 'px';
|
|
|
|
el.offsetWidth; // reflow
|
|
|
|
el.style.width = '0';
|
|
|
|
}
|
|
|
|
function afterLeave(el: HTMLElement) {
|
|
|
|
el.style.width = '';
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
calcBg();
|
|
|
|
globalEvents.on('themeChanged', calcBg);
|
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
watch([() => props.tab, () => props.tabs], () => {
|
|
|
|
nextTick(() => renderTab());
|
2022-06-22 16:29:21 +09:00
|
|
|
}, {
|
|
|
|
immediate: true,
|
|
|
|
});
|
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
if (el && el.parentElement) {
|
|
|
|
narrow = el.parentElement.offsetWidth < 500;
|
2023-02-11 13:08:18 +09:00
|
|
|
ro1 = new ResizeObserver((entries, observer) => {
|
|
|
|
if (el && el.parentElement && document.body.contains(el as HTMLElement)) {
|
2022-06-20 17:38:49 +09:00
|
|
|
narrow = el.parentElement.offsetWidth < 500;
|
|
|
|
}
|
|
|
|
});
|
2023-02-11 13:08:18 +09:00
|
|
|
ro1.observe(el.parentElement as HTMLElement);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (el) {
|
|
|
|
ro2 = new ResizeObserver((entries, observer) => {
|
|
|
|
if (document.body.contains(el as HTMLElement)) {
|
|
|
|
nextTick(() => renderTab());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
ro2.observe(el);
|
2022-06-20 17:38:49 +09:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
globalEvents.off('themeChanged', calcBg);
|
2023-02-11 13:08:18 +09:00
|
|
|
if (ro1) ro1.disconnect();
|
|
|
|
if (ro2) ro2.disconnect();
|
2022-06-20 17:38:49 +09:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2022-06-20 17:38:49 +09:00
|
|
|
-webkit-backdrop-filter: var(--blur, blur(15px));
|
|
|
|
backdrop-filter: var(--blur, blur(15px));
|
|
|
|
border-bottom: solid 0.5px var(--divider);
|
2023-02-11 13:08:18 +09:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.upper,
|
|
|
|
.lower {
|
|
|
|
width: 100%;
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.upper {
|
|
|
|
--height: 50px;
|
|
|
|
display: flex;
|
2022-07-05 22:35:57 +09:00
|
|
|
height: var(--height);
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
.tabs:first-child {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
.tabs:not(:first-child) {
|
|
|
|
padding-left: 16px;
|
|
|
|
mask-image: linear-gradient(90deg, rgba(0,0,0,0), rgb(0,0,0) 16px, rgb(0,0,0) 100%);
|
|
|
|
}
|
|
|
|
.tabs:last-child {
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
|
|
|
.tabs:not(:last-child) {
|
|
|
|
margin-right: 0;
|
|
|
|
}
|
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
&.thin {
|
2022-12-21 15:27:30 +09:00
|
|
|
--height: 42px;
|
2022-06-20 17:38:49 +09:00
|
|
|
|
|
|
|
> .buttons {
|
|
|
|
> .button {
|
|
|
|
font-size: 0.9em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.slim {
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
> .titleContainer {
|
|
|
|
flex: 1;
|
|
|
|
margin: 0 auto;
|
2023-02-11 13:08:18 +09:00
|
|
|
max-width: 100%;
|
2022-06-20 17:38:49 +09:00
|
|
|
|
|
|
|
> *:first-child {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
> *:last-child {
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-01-14 12:15:02 +09:00
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
.lower {
|
|
|
|
--height: 40px;
|
|
|
|
height: var(--height);
|
|
|
|
}
|
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.buttons {
|
|
|
|
--margin: 8px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
min-width: var(--height);
|
|
|
|
height: var(--height);
|
|
|
|
margin: 0 var(--margin);
|
2022-08-13 17:41:17 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
&:empty {
|
|
|
|
width: var(--height);
|
|
|
|
}
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.buttonsLeft {
|
|
|
|
composes: buttons;
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.buttonsRight {
|
|
|
|
composes: buttons;
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.avatar {
|
|
|
|
$size: 32px;
|
|
|
|
display: inline-block;
|
|
|
|
width: $size;
|
|
|
|
height: $size;
|
|
|
|
vertical-align: bottom;
|
|
|
|
margin: 0 8px;
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.button {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2023-02-11 13:08:18 +09:00
|
|
|
height: var(--height);
|
|
|
|
width: calc(var(--height) - (var(--margin)));
|
2023-01-14 12:15:02 +09:00
|
|
|
box-sizing: border-box;
|
|
|
|
position: relative;
|
|
|
|
border-radius: 5px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background: rgba(0, 0, 0, 0.05);
|
2022-06-20 17:38:49 +09:00
|
|
|
}
|
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
&.highlighted {
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.fullButton {
|
|
|
|
& + .fullButton {
|
|
|
|
margin-left: 12px;
|
2022-06-20 17:38:49 +09:00
|
|
|
}
|
2023-01-14 12:15:02 +09:00
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.titleContainer {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2023-02-11 13:08:18 +09:00
|
|
|
max-width: min(30vw, 400px);
|
2023-01-14 12:15:02 +09:00
|
|
|
overflow: auto;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-align: left;
|
|
|
|
font-weight: bold;
|
|
|
|
flex-shrink: 0;
|
|
|
|
margin-left: 24px;
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.titleAvatar {
|
|
|
|
$size: 32px;
|
|
|
|
display: inline-block;
|
|
|
|
width: $size;
|
|
|
|
height: $size;
|
|
|
|
vertical-align: bottom;
|
|
|
|
margin: 0 8px;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.titleIcon {
|
|
|
|
margin-right: 8px;
|
|
|
|
width: 16px;
|
|
|
|
text-align: center;
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.title {
|
|
|
|
min-width: 0;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
line-height: 1.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.subtitle {
|
|
|
|
opacity: 0.6;
|
|
|
|
font-size: 0.8em;
|
|
|
|
font-weight: normal;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
&.activeTab {
|
|
|
|
text-align: center;
|
2022-06-22 16:29:21 +09:00
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
> .chevron {
|
|
|
|
display: inline-block;
|
|
|
|
margin-left: 6px;
|
2022-06-22 16:29:21 +09:00
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
}
|
|
|
|
}
|
2023-01-14 12:15:02 +09:00
|
|
|
|
|
|
|
.tabs {
|
2023-02-11 13:08:18 +09:00
|
|
|
display: block;
|
2023-01-14 12:15:02 +09:00
|
|
|
position: relative;
|
2023-02-11 13:08:18 +09:00
|
|
|
margin: 0;
|
|
|
|
height: var(--height);
|
2023-01-14 12:15:02 +09:00
|
|
|
font-size: 0.8em;
|
2023-02-11 13:08:18 +09:00
|
|
|
text-align: center;
|
|
|
|
overflow-x: auto;
|
|
|
|
overflow-y: hidden;
|
|
|
|
scrollbar-width: none;
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tabsInner {
|
|
|
|
display: inline-block;
|
|
|
|
height: var(--height);
|
2023-01-14 12:15:02 +09:00
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tab {
|
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
|
|
|
padding: 0 10px;
|
|
|
|
height: 100%;
|
|
|
|
font-weight: normal;
|
|
|
|
opacity: 0.7;
|
2023-02-11 13:08:18 +09:00
|
|
|
transition: opacity 0.2s ease;
|
2023-01-14 12:15:02 +09:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-11 13:08:18 +09:00
|
|
|
.tabInner {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
2023-01-14 12:15:02 +09:00
|
|
|
.tabIcon + .tabTitle {
|
|
|
|
margin-left: 8px;
|
2023-02-11 13:08:18 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
.tabTitle {
|
|
|
|
overflow: hidden;
|
|
|
|
transition: width 0.15s ease-in-out;
|
2023-01-14 12:15:02 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
.tabHighlight {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
height: 3px;
|
|
|
|
background: var(--accent);
|
|
|
|
border-radius: 999px;
|
2023-02-11 13:08:18 +09:00
|
|
|
transition: width 0.15s ease, left 0.15s ease;
|
2023-01-14 12:15:02 +09:00
|
|
|
pointer-events: none;
|
|
|
|
}
|
2022-06-20 17:38:49 +09:00
|
|
|
</style>
|