Chg: コミュニティ・チャンネルのUI

This commit is contained in:
2026-06-01 22:02:19 +09:00
parent 2abbe66d06
commit e009526798
6 changed files with 133 additions and 58 deletions
+12 -1
View File
@@ -54,7 +54,12 @@
</div>
<div class="content-main">
<div class="content-header">
<div
class="content-header"
:class='isHiddenTitleBar
? "isHidden"
: ""'
>
{{
title
?? (serverInfo?.success
@@ -187,6 +192,7 @@ main.layout {
}
.content-header {
display: block;
padding: 1rem 1.25rem;
font-size: 1.3rem;
font-weight: bold;
@@ -198,6 +204,10 @@ main.layout {
-webkit-user-select: none;
}
.content-header.isHidden {
display: none;
}
.route-main {
display: flex;
flex-direction: column;
@@ -256,6 +266,7 @@ const router = useRouter();
const route = useRoute();
const isFullRoute = computed(() => route.meta.isFullRoute === true);
const isHiddenTitleBar = computed(() => route.meta.isHiddenTitleBar === true);
watch(route, () => {
if (typeof route.meta.title === "string")
@@ -151,6 +151,13 @@ const deleteMessage = async () => {
resolve();
break;
default:
createTopNotice({
props: {
icon: "material-symbols:error-outline-rounded",
iconColor: "var(--error-color)",
message: "キャンセルしました",
},
});
return;
}
},
+1
View File
@@ -58,6 +58,7 @@ const router = createRouter({
meta: {
title: "コミュニティ",
isFullRoute: true,
isHiddenTitleBar: true,
},
component: () => import("@/routes/community/index.vue"),
children: [
@@ -9,44 +9,51 @@
v-if="!isProcessing && channel"
class="channel"
>
<div class="messages" @scroll.passive="messagesScroll">
<div class="none-message" v-if="messages.length === 0">
<span>何ということでしょう</span>
<span>メッセージがありませんね</span>
</div>
<Progress
v-if="isLoading"
:size="10"
class="loading-progress"
/>
<Message
v-for="message of messages"
@deleteMessage="deleteMessage"
:key="message.id"
:message="message"
/>
<div class="community-top-info">
<Icon icon="material-symbols:chat-rounded" />
{{ channel.name }}
</div>
<form>
<textarea
@input="resize"
@keydown.ctrl.enter="send"
class="message-input"
rows="1"
v-model="message"
:disabled="isSending"
:placeholder="`${channel.name}に送信`"
/>
<div class="main">
<div class="messages" @scroll.passive="messagesScroll">
<div class="none-message" v-if="messages.length === 0">
<span>何ということでしょう</span>
<span>メッセージがありませんね</span>
</div>
<Icon
@click="send"
:icon='isSending
? "line-md:loading-twotone-loop"
: "material-symbols:send-rounded"'
/>
</form>
<Progress
v-if="isLoading"
:size="10"
class="loading-progress"
/>
<Message
v-for="message of messages"
@deleteMessage="deleteMessage"
:key="message.id"
:message="message"
/>
</div>
<form>
<textarea
@input="resize"
@keydown.ctrl.enter="send"
class="message-input"
rows="1"
v-model="message"
:disabled="isSending"
:placeholder="`${channel.name}に送信`"
/>
<Icon
@click="send"
:icon='isSending
? "line-md:loading-twotone-loop"
: "material-symbols:send-rounded"'
/>
</form>
</div>
</div>
</template>
@@ -55,6 +62,12 @@
margin: auto;
}
.community-top-info svg {
margin: auto 0;
width: 1.25rem;
height: 1.25rem;
}
.channel {
display: flex;
flex-direction: column;
@@ -62,6 +75,13 @@
height: 100%;
}
.main {
display: flex;
flex-direction: column;
flex-grow: 1;
padding: 1rem;
}
.messages {
display: flex;
flex-direction: column;
@@ -91,7 +111,6 @@
display: flex;
gap: 0.5rem;
padding: 1rem;
margin-bottom: 1rem;
border-radius: 1rem;
background-color: var(--bg-sub-color);
}
@@ -1,2 +1,11 @@
<template>
<span>チャンネルを選びやがれ</span>
</template>
<style scoped>
span {
margin: auto;
font-size: 1.25rem;
font-weight: bold;
}
</style>
@@ -6,20 +6,26 @@
/>
<div
v-if="!isProcessing && channels"
v-if="!isProcessing && presentCommunity && channels"
class="community"
>
<div class="channels">
<RouterLink
v-for="channel of channels"
:to="`/community/${$route.params.communityId}/${channel.id}`"
:class='route.fullPath === `/community/${$route.params.communityId}/${channel.id}`
? "isActive"
: ""'
>
<Icon icon="material-symbols:chat-rounded" />
<span>{{ channel.name }}</span>
</RouterLink>
<div class="left">
<div class="community-top-info">
{{ presentCommunity.name }}
</div>
<div class="channels">
<RouterLink
v-for="channel of channels"
:to="`/community/${$route.params.communityId}/${channel.id}`"
:class='route.fullPath === `/community/${$route.params.communityId}/${channel.id}`
? "isActive"
: ""'
>
<Icon icon="material-symbols:chat-rounded" />
<span>{{ channel.name }}</span>
</RouterLink>
</div>
</div>
<span class="border" />
@@ -32,6 +38,22 @@
</div>
</template>
<style>
.community-top-info {
display: flex;
gap: 0.25rem;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border-bottom: 1px solid var(--border-color);
padding: 1rem;
font-size: 1.1rem;
font-weight: bold;
box-sizing: border-box;
}
</style>
<style scoped>
.processing-progress {
margin: auto;
@@ -40,16 +62,13 @@
.community {
height: 100%;
display: flex;
padding-left: 1rem;
padding-right: 1rem;
}
.channels {
.left {
display: flex;
flex-direction: column;
padding-top: 1rem;
box-sizing: border-box;
width: 16rem;
width: 18rem;
height: 100%;
border-top-right-radius: 2rem;
border-bottom-right-radius: 2rem;
@@ -60,10 +79,22 @@
flex-shrink: 0;
}
.channels {
display: flex;
flex-direction: column;
width: 100%;
flex-grow: 1;
gap: 1rem;
overflow: scroll;
padding: 1rem 1rem 0 1rem;
box-sizing: border-box;
}
.channels a {
display: flex;
color: var(--text-color);
text-decoration: none;
padding-left: 1rem;
gap: 0.25rem;
height: 2rem;
border: 1px solid transparent;
@@ -101,13 +132,10 @@
.community .border {
width: 1px;
height: 100%;
margin-right: 1rem;
margin-left: 1rem;
background-color: var(--border-color);
}
.community .community-inner {
padding-top: 1rem;
flex-grow: 1;
height: 100%;
box-sizing: border-box;