diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-04-29 09:43:15 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-04-29 09:43:15 +0900 |
| commit | d6ae4c980ba0e7893af4a2c327cad367cda24e5c (patch) | |
| tree | 220f5ddf34da3edb6d5f5b674062b9b7905f7739 /packages/frontend/src/ui/_common_/titlebar.vue | |
| parent | Bump version to 2025.4.1-beta.8 (diff) | |
| download | misskey-d6ae4c980ba0e7893af4a2c327cad367cda24e5c.tar.gz misskey-d6ae4c980ba0e7893af4a2c327cad367cda24e5c.tar.bz2 misskey-d6ae4c980ba0e7893af4a2c327cad367cda24e5c.zip | |
feat(frontend): タイトルバーを表示できるように
Diffstat (limited to 'packages/frontend/src/ui/_common_/titlebar.vue')
| -rw-r--r-- | packages/frontend/src/ui/_common_/titlebar.vue | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/packages/frontend/src/ui/_common_/titlebar.vue b/packages/frontend/src/ui/_common_/titlebar.vue new file mode 100644 index 0000000000..c62b13b73a --- /dev/null +++ b/packages/frontend/src/ui/_common_/titlebar.vue @@ -0,0 +1,87 @@ +<!-- +SPDX-FileCopyrightText: syuilo and misskey-project +SPDX-License-Identifier: AGPL-3.0-only +--> + +<template> +<div :class="$style.root"> + <div :class="$style.title"> + <img :src="instance.iconUrl || instance.faviconUrl || '/favicon.ico'" alt="" :class="$style.instanceIcon"/> + <span :class="$style.instanceTitle">{{ instance.name ?? host }}</span> + </div> + <div :class="$style.controls"> + <span :class="$style.left"> + <button v-if="canBack" class="_button" :class="$style.button" @click="goBack"><i class="ti ti-arrow-left"></i></button> + </span> + <span :class="$style.right"> + </span> + </div> +</div> +</template> + +<script lang="ts" setup> +import { host } from '@@/js/config.js'; +import { ref } from 'vue'; +import { instance } from '@/instance.js'; +import { prefer } from '@/preferences.js'; + +const canBack = ref(true); + +function goBack() { + window.history.back(); +} +</script> + +<style lang="scss" module> +.root { + --height: 36px; + + background: var(--MI_THEME-navBg); + height: var(--height); + font-size: 90%; +} + +.title { + display: flex; + justify-content: center; + align-items: center; + text-align: center; + height: var(--height); +} + +.controls { + position: absolute; + top: 0; + left: 0; + display: flex; + justify-content: center; + align-items: center; + height: var(--height); +} + +.instanceIcon { + display: inline-block; + width: 20px; + aspect-ratio: 1; + border-radius: 5px; + margin-right: 8px; +} + +.instanceTitle { + display: inline-block; +} + +.left { + margin-right: auto; +} + +.right { + margin-left: auto; +} + +.button { + display: inline-block; + height: var(--height); + aspect-ratio: 1; +} +</style> |