summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkPagePreview.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2023-09-06 17:36:14 +0900
committerGitHub <noreply@github.com>2023-09-06 17:36:14 +0900
commit22d966e92dabffba23178a4afb5853882ba7249e (patch)
tree7971b4ec56d7b272a13b9b19d6b6f87de42a3eae /packages/frontend/src/components/MkPagePreview.vue
parentfeat(backend): Webhook設定でsecretを空に出来るように (#11784) (diff)
downloadmisskey-22d966e92dabffba23178a4afb5853882ba7249e.tar.gz
misskey-22d966e92dabffba23178a4afb5853882ba7249e.tar.bz2
misskey-22d966e92dabffba23178a4afb5853882ba7249e.zip
enhance(frontend): データセーバーモードで隠れる画像を増やす等 (#11779)
* enhance datasaver mode * サムネイルがないとき変な角丸にならんようにする * Avoid using wildcard selector * Avoid wildcard * Update MkMediaImage.vue --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/frontend/src/components/MkPagePreview.vue')
-rw-r--r--packages/frontend/src/components/MkPagePreview.vue43
1 files changed, 22 insertions, 21 deletions
diff --git a/packages/frontend/src/components/MkPagePreview.vue b/packages/frontend/src/components/MkPagePreview.vue
index 53920da50d..65464956be 100644
--- a/packages/frontend/src/components/MkPagePreview.vue
+++ b/packages/frontend/src/components/MkPagePreview.vue
@@ -5,7 +5,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<MkA :to="`/@${page.user.username}/pages/${page.name}`" class="vhpxefrj" tabindex="-1">
- <div v-if="page.eyeCatchingImage" class="thumbnail" :style="`background-image: url('${page.eyeCatchingImage.thumbnailUrl}')`"></div>
+ <div v-if="page.eyeCatchingImage" class="thumbnail">
+ <MediaImage
+ :image="page.eyeCatchingImage"
+ :disableImageLink="true"
+ :controls="false"
+ :cover="true"
+ :class="$style.eyeCatchingImageRoot"
+ />
+ </div>
<article>
<header>
<h1 :title="page.title">{{ page.title }}</h1>
@@ -23,12 +31,22 @@ SPDX-License-Identifier: AGPL-3.0-only
import { } from 'vue';
import * as Misskey from 'misskey-js';
import { userName } from '@/filters/user';
+import MediaImage from '@/components/MkMediaImage.vue';
const props = defineProps<{
page: Misskey.entities.Page;
}>();
</script>
+<style module>
+.eyeCatchingImageRoot {
+ width: 100%;
+ height: 200px;
+ border-radius: var(--radius) var(--radius) 0 0;
+ overflow: hidden;
+}
+</style>
+
<style lang="scss" scoped>
.vhpxefrj {
display: block;
@@ -39,32 +57,15 @@ const props = defineProps<{
}
> .thumbnail {
- width: 100%;
- height: 200px;
- background-position: center;
- background-size: cover;
- display: flex;
- justify-content: center;
- align-items: center;
-
- > button {
- font-size: 3.5em;
- opacity: 0.7;
-
- &:hover {
- font-size: 4em;
- opacity: 0.9;
- }
- }
-
& + article {
- left: 100px;
- width: calc(100% - 100px);
+ border-radius: 0 0 var(--radius) var(--radius);
}
}
> article {
+ background-color: var(--panel);
padding: 16px;
+ border-radius: var(--radius);
> header {
margin-bottom: 8px;