URLプレビューのサムネイルを隠す機能を追加 (MisskeyIO#214)

This commit is contained in:
CyberRex 2023-11-07 02:31:26 +09:00 committed by GitHub
parent f229e26312
commit ec5e1df9f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 76 additions and 1 deletions

View file

@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<div v-else>
<component :is="self ? 'MkA' : 'a'" :class="[$style.link, { [$style.compact]: compact }]" :[attr]="self ? url.substring(local.length) : url" rel="nofollow noopener" :target="target" :title="url">
<div v-if="thumbnail" :class="$style.thumbnail" :style="`background-image: url('${thumbnail}')`">
<div v-if="thumbnail" :class="[$style.thumbnail, { [$style.thumbnailBlur]: sensitive }]" :style="`background-image: url('${thumbnail}')`">
</div>
<article :class="$style.body">
<header :class="$style.header">
@ -118,6 +118,7 @@ let description = $ref<string | null>(null);
let thumbnail = $ref<string | null>(null);
let icon = $ref<string | null>(null);
let sitename = $ref<string | null>(null);
let sensitive = $ref<boolean | undefined>(undefined);
let player = $ref({
url: null,
width: null,
@ -170,6 +171,7 @@ window.fetch(`/url?url=${encodeURIComponent(requestUrl.href)}&lang=${versatileLa
icon = info.icon;
sitename = info.sitename;
player = info.player;
sensitive = info.sensitive;
});
function adjustTweetHeight(message: any) {
@ -319,6 +321,10 @@ onUnmounted(() => {
margin-top: 6px;
}
.thumbnailBlur {
filter: blur(8px);
}
@container (max-width: 400px) {
.link {
font-size: 12px;