Compare commits
No commits in common. "9b7de48c0276f860892da58d7087be16af3f6b2d" and "2299d3a17a4595a6b6c2f975ebcd1c37e0440384" have entirely different histories.
9b7de48c02
...
2299d3a17a
6 changed files with 2 additions and 28 deletions
|
@ -40,7 +40,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="message-data">
|
<div class="message-data">
|
||||||
<div class="message-metadata">
|
<div class="message-metadata">
|
||||||
<span class="message-author-username" tabindex="0" :style="`color: ${props.authorColor}`">
|
<span class="message-author-username" tabindex="0">
|
||||||
{{ author?.display_name || author?.username }}
|
{{ author?.display_name || author?.username }}
|
||||||
</span>
|
</span>
|
||||||
<span class="message-date" :title="date.toString()">
|
<span class="message-date" :title="date.toString()">
|
||||||
|
@ -71,7 +71,6 @@
|
||||||
import DOMPurify from 'dompurify';
|
import DOMPurify from 'dompurify';
|
||||||
import { parse } from 'marked';
|
import { parse } from 'marked';
|
||||||
import type { MessageProps } from '~/types/props';
|
import type { MessageProps } from '~/types/props';
|
||||||
import generateIrcColor from '~/utils/generateIrcColor';
|
|
||||||
|
|
||||||
const props = defineProps<MessageProps>();
|
const props = defineProps<MessageProps>();
|
||||||
|
|
||||||
|
@ -118,8 +117,6 @@ onMounted(async () => {
|
||||||
// showHover.value = !showHover.value;
|
// showHover.value = !showHover.value;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
console.log(props.authorColor)
|
|
||||||
|
|
||||||
const menuItems = [
|
const menuItems = [
|
||||||
{ name: "Reply", callback: () => { if (messageElement.value) replyToMessage(messageElement.value, props) } }
|
{ name: "Reply", callback: () => { if (messageElement.value) replyToMessage(messageElement.value, props) } }
|
||||||
]
|
]
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
:margin-bottom="(messages[i + 1] && messagesType[messages[i + 1].uuid] == 'normal') ?? false"
|
:margin-bottom="(messages[i + 1] && messagesType[messages[i + 1].uuid] == 'normal') ?? false"
|
||||||
:last="i == messages.length - 1" :message-id="message.uuid" :author="message.user" :me="me"
|
:last="i == messages.length - 1" :message-id="message.uuid" :author="message.user" :me="me"
|
||||||
:message="message" :is-reply="message.reply_to"
|
:message="message" :is-reply="message.reply_to"
|
||||||
:author-color="`${generateIrcColor(message.user.uuid)}`"
|
|
||||||
:reply-message="message.reply_to ? getReplyMessage(message.reply_to) : undefined" />
|
:reply-message="message.reply_to ? getReplyMessage(message.reply_to) : undefined" />
|
||||||
</div>
|
</div>
|
||||||
<div id="message-box" class="rounded-corners">
|
<div id="message-box" class="rounded-corners">
|
||||||
|
|
|
@ -22,8 +22,7 @@
|
||||||
"pinia-plugin-persistedstate": "^4.2.0",
|
"pinia-plugin-persistedstate": "^4.2.0",
|
||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-router": "^4.5.1",
|
"vue-router": "^4.5.1"
|
||||||
"xxhash-wasm": "^1.1.0"
|
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.11.0",
|
"packageManager": "pnpm@10.11.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
|
@ -47,9 +47,6 @@ importers:
|
||||||
vue-router:
|
vue-router:
|
||||||
specifier: ^4.5.1
|
specifier: ^4.5.1
|
||||||
version: 4.5.1(vue@3.5.13(typescript@5.8.3))
|
version: 4.5.1(vue@3.5.13(typescript@5.8.3))
|
||||||
xxhash-wasm:
|
|
||||||
specifier: ^1.1.0
|
|
||||||
version: 1.1.0
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@iconify-json/lucide':
|
'@iconify-json/lucide':
|
||||||
specifier: ^1.2.44
|
specifier: ^1.2.44
|
||||||
|
@ -4747,9 +4744,6 @@ packages:
|
||||||
engines: {node: '>= 0.10.0'}
|
engines: {node: '>= 0.10.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
xxhash-wasm@1.1.0:
|
|
||||||
resolution: {integrity: sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==}
|
|
||||||
|
|
||||||
y18n@5.0.8:
|
y18n@5.0.8:
|
||||||
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
|
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
@ -10152,8 +10146,6 @@ snapshots:
|
||||||
cssfilter: 0.0.10
|
cssfilter: 0.0.10
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
xxhash-wasm@1.1.0: {}
|
|
||||||
|
|
||||||
y18n@5.0.8: {}
|
y18n@5.0.8: {}
|
||||||
|
|
||||||
yallist@3.1.1: {}
|
yallist@3.1.1: {}
|
||||||
|
|
|
@ -9,7 +9,6 @@ export interface MessageProps {
|
||||||
format: "12" | "24",
|
format: "12" | "24",
|
||||||
type: "normal" | "grouped",
|
type: "normal" | "grouped",
|
||||||
marginBottom: boolean,
|
marginBottom: boolean,
|
||||||
authorColor: string,
|
|
||||||
last: boolean,
|
last: boolean,
|
||||||
messageId: string,
|
messageId: string,
|
||||||
replyingTo?: boolean,
|
replyingTo?: boolean,
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
import xxhash from "xxhash-wasm"
|
|
||||||
|
|
||||||
const { h64 } = await xxhash()
|
|
||||||
|
|
||||||
export default (seed: string): string => {
|
|
||||||
const lightness = 50
|
|
||||||
|
|
||||||
// this should probably be cached eventually
|
|
||||||
const idHash = h64(seed)
|
|
||||||
|
|
||||||
return `hsl(${idHash % 360n}, 100%, ${lightness}%)`
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue