Skip to content

Commit

Permalink
enhance(Gallery): サムネイルをホバーしてもぼかしが外れないように & ギャラリーの説明を一番上に表示するように (#820)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyatea authored Nov 21, 2024
1 parent 1bad669 commit f4ebae3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
13 changes: 2 additions & 11 deletions packages/frontend/src/components/MkGalleryPostPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<MkA :to="`/gallery/${post.id}`" class="ttasepnz _panel" tabindex="-1" @pointerenter="enterHover" @pointerleave="leaveHover">
<MkA :to="`/gallery/${post.id}`" class="ttasepnz _panel" tabindex="-1">
<div class="thumbnail">
<Transition>
<ImgWithBlurhash
Expand Down Expand Up @@ -41,17 +41,8 @@ const props = defineProps<{
post: Misskey.entities.GalleryPost;
}>();

const hover = ref(false);
const safe = computed(() => defaultStore.state.nsfw === 'ignore' || defaultStore.state.nsfw === 'respect' && !props.post.isSensitive);
const show = computed(() => safe.value || hover.value);

function enterHover(): void {
hover.value = true;
}

function leaveHover(): void {
hover.value = false;
}
const show = computed(() => safe.value);
</script>

<style lang="scss" module>
Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/src/pages/gallery/post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_root">
<Transition :name="defaultStore.state.animation ? 'fade' : ''" mode="out-in">
<div v-if="post" class="rkxwuolj">
<div class="files">
<div v-for="file in post.files" :key="file.id" class="file">
<img :src="file.url"/>
</div>
</div>
<div class="body">
<div class="title">{{ post.title }}</div>
<div class="description"><Mfm :text="post.description"/></div>
<div class="files">
<div v-for="file in post.files" :key="file.id" class="file">
<img :src="file.url"/>
</div>
</div>
<div class="info">
<i class="ti ti-clock"></i> <MkTime :time="post.createdAt" mode="detail"/>
</div>
Expand Down

0 comments on commit f4ebae3

Please sign in to comment.