misskey/packages/client/src/ui/_common_/statusbars.vue

87 lines
2.5 KiB
Vue
Raw Normal View History

<template>
<div
class="dlrsnxqu" :class="{
verySmall: defaultStore.reactiveState.statusbarSize.value === 'verySmall',
small: defaultStore.reactiveState.statusbarSize.value === 'small',
medium: defaultStore.reactiveState.statusbarSize.value === 'medium',
2022-07-03 13:30:58 +02:00
large: defaultStore.reactiveState.statusbarSize.value === 'large',
veryLarge: defaultStore.reactiveState.statusbarSize.value === 'veryLarge',
}"
>
<div v-for="x in defaultStore.reactiveState.statusbars.value" :key="x.id" class="item" :class="{ black: x.black }">
<span class="name">{{ x.name }}</span>
<XRss v-if="x.type === 'rss'" class="body" :refresh-interval-sec="x.props.refreshIntervalSec" :marquee-duration="x.props.marqueeDuration" :marquee-reverse="x.props.marqueeReverse" :display="x.props.display" :url="x.props.url"/>
<XFederation v-else-if="x.type === 'federation'" class="body" :refresh-interval-sec="x.props.refreshIntervalSec" :marquee-duration="x.props.marqueeDuration" :marquee-reverse="x.props.marqueeReverse" :display="x.props.display" :colored="x.props.colored"/>
<XUserList v-else-if="x.type === 'userList'" class="body" :refresh-interval-sec="x.props.refreshIntervalSec" :marquee-duration="x.props.marqueeDuration" :marquee-reverse="x.props.marqueeReverse" :display="x.props.display" :user-list-id="x.props.userListId"/>
</div>
</div>
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref, toRef, watch } from 'vue';
import * as os from '@/os';
import { defaultStore } from '@/store';
const XRss = defineAsyncComponent(() => import('./statusbar-rss.vue'));
const XFederation = defineAsyncComponent(() => import('./statusbar-federation.vue'));
const XUserList = defineAsyncComponent(() => import('./statusbar-user-list.vue'));
</script>
<style lang="scss" scoped>
.dlrsnxqu {
--height: 24px;
2022-07-03 18:12:36 +02:00
--nameMargin: 10px;
background: var(--panel);
font-size: 0.85em;
&.verySmall {
2022-07-03 18:12:36 +02:00
--nameMargin: 7px;
--height: 16px;
font-size: 0.75em;
}
&.small {
2022-07-03 18:12:36 +02:00
--nameMargin: 8px;
--height: 20px;
font-size: 0.8em;
}
&.large {
2022-07-03 18:12:36 +02:00
--nameMargin: 12px;
--height: 26px;
font-size: 0.875em;
}
2022-07-03 13:30:58 +02:00
&.veryLarge {
2022-07-03 18:12:36 +02:00
--nameMargin: 14px;
2022-07-03 13:30:58 +02:00
--height: 30px;
font-size: 0.9em;
}
> .item {
display: inline-flex;
vertical-align: bottom;
width: 100%;
line-height: var(--height);
height: var(--height);
2022-07-03 09:17:31 +02:00
overflow: hidden; overflow: clip;
contain: strict;
> .name {
2022-07-03 18:12:36 +02:00
padding: 0 var(--nameMargin);
font-weight: bold;
color: var(--accent);
}
> .body {
min-width: 0;
flex: 1;
}
&.black {
background: #000;
color: #fff;
}
}
}
</style>