wip
This commit is contained in:
parent
cf3245b59c
commit
4c79716688
|
@ -4,13 +4,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<a ref="el" :href="to" target="_blank" rel="noopener">
|
<a :href="to" target="_blank" rel="noopener">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, inject, shallowRef } from 'vue';
|
import { } from 'vue';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
to: string;
|
to: string;
|
||||||
|
@ -18,8 +18,4 @@ const props = withDefaults(defineProps<{
|
||||||
}>(), {
|
}>(), {
|
||||||
activeClass: null,
|
activeClass: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const el = shallowRef<HTMLElement>();
|
|
||||||
|
|
||||||
defineExpose({ $el: el });
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<component :is="link ? EmA : 'span'" v-bind="bound" class="_noSelect" :class="[$style.root, { [$style.cat]: user.isCat }]" @click="onClick">
|
<component :is="link ? EmA : 'span'" v-bind="bound" class="_noSelect" :class="[$style.root, { [$style.cat]: user.isCat }]">
|
||||||
<EmImgWithBlurhash :class="$style.inner" :src="url" :hash="user.avatarBlurhash" :cover="true" :onlyAvgColor="true"/>
|
<EmImgWithBlurhash :class="$style.inner" :src="url" :hash="user.avatarBlurhash" :cover="true" :onlyAvgColor="true"/>
|
||||||
<div v-if="user.isCat" :class="[$style.ears]">
|
<div v-if="user.isCat" :class="[$style.ears]">
|
||||||
<div :class="$style.earLeft">
|
<div :class="$style.earLeft">
|
||||||
|
@ -45,12 +45,10 @@ import { userPage } from '@/utils.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
user: Misskey.entities.User;
|
user: Misskey.entities.User;
|
||||||
target?: string | null;
|
|
||||||
link?: boolean;
|
link?: boolean;
|
||||||
preview?: boolean;
|
preview?: boolean;
|
||||||
indicator?: boolean;
|
indicator?: boolean;
|
||||||
}>(), {
|
}>(), {
|
||||||
target: null,
|
|
||||||
link: false,
|
link: false,
|
||||||
preview: false,
|
preview: false,
|
||||||
indicator: false,
|
indicator: false,
|
||||||
|
@ -61,7 +59,7 @@ const emit = defineEmits<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const bound = computed(() => props.link
|
const bound = computed(() => props.link
|
||||||
? { to: userPage(props.user), target: props.target }
|
? { to: userPage(props.user) }
|
||||||
: {});
|
: {});
|
||||||
|
|
||||||
const url = computed(() => {
|
const url = computed(() => {
|
||||||
|
@ -69,11 +67,6 @@ const url = computed(() => {
|
||||||
return props.user.avatarUrl;
|
return props.user.avatarUrl;
|
||||||
});
|
});
|
||||||
|
|
||||||
function onClick(ev: MouseEvent): void {
|
|
||||||
if (props.link) return;
|
|
||||||
emit('click', ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDecorationUrl(decoration: Omit<Misskey.entities.UserDetailed['avatarDecorations'][number], 'id'>) {
|
function getDecorationUrl(decoration: Omit<Misskey.entities.UserDetailed['avatarDecorations'][number], 'id'>) {
|
||||||
return decoration.url;
|
return decoration.url;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
<article :class="$style.article">
|
<article :class="$style.article">
|
||||||
<div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div>
|
<div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div>
|
||||||
<EmAvatar :class="$style.avatar" :user="appearNote.user"/>
|
<EmAvatar :class="$style.avatar" :user="appearNote.user" link/>
|
||||||
<div :class="$style.main">
|
<div :class="$style.main">
|
||||||
<EmNoteHeader :note="appearNote" :mini="true"/>
|
<EmNoteHeader :note="appearNote" :mini="true"/>
|
||||||
<div style="container-type: inline-size;">
|
<div style="container-type: inline-size;">
|
||||||
|
|
|
@ -324,8 +324,9 @@ onUnmounted(() => {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
top: 8px;
|
top: 8px;
|
||||||
left: 8px;
|
left: 8px;
|
||||||
padding: 6px 8px;
|
padding: 6px 10px;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
font-size: 85%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.embedCodeGenPreviewSpinner {
|
.embedCodeGenPreviewSpinner {
|
||||||
|
|
Loading…
Reference in New Issue