+
![]()
{{ DateParse(message.createdAt) }}
+ >{{ parsedDate }}
@@ -70,6 +70,8 @@
.content > div {
display: flex;
gap: 0.25rem;
+ user-select: none;
+ -webkit-user-select: none;
}
.username {
@@ -120,6 +122,7 @@ import { Icon } from "@iconify/vue";
import type ApiMap from "lynqchat-js/1.0.0-alpha.0/map";
import ErrorModal from "@/components/Modal/Error.vue";
import Confirm from "@/components/Modal/Confirm.vue";
+import { inject, onBeforeUnmount, onMounted, ref, watch, type Ref } from "vue";
const props = defineProps<{
message: Extract
["messages"][number];
@@ -184,4 +187,42 @@ const deleteMessage = async () => {
},
});
}
+
+const now = inject[>("now")!;
+const parsedDate = ref();
+const messageElem = ref(null);
+const isVisible = ref(false);
+let observer: IntersectionObserver;
+onMounted(() => {
+ if (!messageElem.value)
+ return;
+
+ observer = new IntersectionObserver((entries) => {
+ for (const entry of entries) {
+ if (!entry.isIntersecting)
+ continue;
+
+ isVisible.value = true;
+
+ observer.unobserve(entry.target);
+ }
+ }, {
+ rootMargin: "100px 0px",
+ });
+
+ observer.observe(messageElem.value);
+});
+
+const stopWatch = watch([isVisible, now], ([visible, currentNow]) => {
+ if (visible) {
+ parsedDate.value = DateParse(props.message.createdAt, currentNow);
+ }
+}, {
+ immediate: true,
+});
+
+onBeforeUnmount(() => {
+ observer?.disconnect();
+ stopWatch();
+});
\ No newline at end of file
diff --git a/packages/frontend/src/components/Modal/CreateCommunity.vue b/packages/frontend/src/components/Modal/CreateCommunity.vue
new file mode 100644
index 0000000..f02a028
--- /dev/null
+++ b/packages/frontend/src/components/Modal/CreateCommunity.vue
@@ -0,0 +1,186 @@
+
+ ]
+
コミュニティを作成
+
+
+
+
+ コミュニティの作成に失敗しました。
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/frontend/src/global.css b/packages/frontend/src/global.css
index 31476b8..32d7cc8 100755
--- a/packages/frontend/src/global.css
+++ b/packages/frontend/src/global.css
@@ -69,4 +69,6 @@ label {
height: fit-content;
max-width: 70dvw;
max-height: 90dvh;
+ user-select: none;
+ -webkit-user-select: none;
}
\ No newline at end of file
diff --git a/packages/frontend/src/main.ts b/packages/frontend/src/main.ts
index 2bf8558..4268f17 100755
--- a/packages/frontend/src/main.ts
+++ b/packages/frontend/src/main.ts
@@ -51,7 +51,6 @@ const router = createRouter({
meta: {
title: "コミュニティ",
isFullRoute: true,
- canReloadTitle: false,
},
component: () => import("@/routes/community/index.vue"),
children: [
@@ -87,14 +86,6 @@ router.afterEach((to, from) => {
return false;
}
- if (
- to.matched[0]?.path === from.matched[0]?.path &&
- from.meta.canReloadTitle === false
- ) {
- routerStatus.isLoad = false;
- return false;
- }
-
const title = to.meta.title;
let serverName = "LynqChat";
diff --git a/packages/frontend/src/routes/community/channel.vue b/packages/frontend/src/routes/community/channel.vue
index baebdf1..3efb379 100644
--- a/packages/frontend/src/routes/community/channel.vue
+++ b/packages/frontend/src/routes/community/channel.vue
@@ -126,7 +126,7 @@ import { account, presentCommunity, serverInfo } from "@/lib/account";
import client from "@/lib/client";
import { createModal, createTopNotice } from "@/lib/modal";
import GoHomeError from "@/components/Modal/GoHomeError.vue";
-import { ref } from "vue";
+import { onMounted, provide, ref } from "vue";
import Progress from "@/components/Progress.vue";
import { title } from "@/lib/router";
import type ApiMap from "lynqchat-js/1.0.0-alpha.0/map";
@@ -325,6 +325,14 @@ const deleteMessage = (data: { id: string }) => {
messages.value = messages.value.toSpliced(index, 1);
}
+const now = ref(new Date());
+onMounted(() => {
+ setInterval(() =>
+ now.value = new Date()
+ , 1000);
+});
+provide("now", now);
+
(async () => {
isProcessing.value = true;
diff --git a/packages/frontend/src/routes/community/index.vue b/packages/frontend/src/routes/community/index.vue
index edad230..553dda9 100644
--- a/packages/frontend/src/routes/community/index.vue
+++ b/packages/frontend/src/routes/community/index.vue
@@ -26,7 +26,7 @@
@@ -72,6 +72,8 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
+ user-select: none;
+ -webkit-user-select: none;
}
.channels a:hover,