jormungandr-bite/packages/client/src/ui/_common_/statusbars.vue

93 lines
2.4 KiB
Vue
Raw Normal View History

<template>
2022-07-03 10:37:47 -06:00
<div class="dlrsnxqu">
<div
v-for="x in defaultStore.reactiveState.statusbars.value" :key="x.id" class="item" :class="[{ black: x.black }, {
verySmall: x.size === 'verySmall',
small: x.size === 'small',
medium: x.size === 'medium',
large: x.size === 'large',
veryLarge: x.size === 'veryLarge',
}]"
>
<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 {
2022-07-15 02:01:13 -06:00
font-size: 15px;
background: var(--panel);
2022-07-03 10:37:47 -06:00
> .item {
--height: 24px;
--nameMargin: 10px;
font-size: 0.85em;
2022-07-03 10:37:47 -06:00
&.verySmall {
--nameMargin: 7px;
--height: 16px;
font-size: 0.75em;
}
2022-07-03 10:37:47 -06:00
&.small {
--nameMargin: 8px;
--height: 20px;
font-size: 0.8em;
}
2022-07-03 10:37:47 -06:00
&.large {
--nameMargin: 12px;
--height: 26px;
font-size: 0.875em;
}
2022-07-03 05:30:58 -06:00
2022-07-03 10:37:47 -06:00
&.veryLarge {
--nameMargin: 14px;
--height: 30px;
font-size: 0.9em;
}
display: flex;
vertical-align: bottom;
width: 100%;
line-height: var(--height);
height: var(--height);
2022-07-13 06:41:06 -06:00
overflow: clip;
contain: strict;
> .name {
2022-07-03 10:12:36 -06:00
padding: 0 var(--nameMargin);
font-weight: bold;
color: var(--accent);
2022-07-07 05:19:50 -06:00
&:empty {
display: none;
}
}
> .body {
min-width: 0;
flex: 1;
}
&.black {
background: #000;
color: #fff;
}
}
}
</style>