Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

リアクションをホバーしたときに拡大して表示 #4434

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c1c88b5
リアクションのホバー時に拡大表示する機能の追加
Jan 3, 2025
8d05380
ホバー時、リアクションした人も分かるように
Jan 4, 2025
acd6832
format
Pugma Jan 4, 2025
0101b00
titleを削除
Jan 5, 2025
ec87df5
aria-label属性を追加(フォーマットはDiscordに合わせた)
Jan 5, 2025
e50a748
rum formatで引っかかったので修正
Jan 5, 2025
6bbdefe
コードを整形
Jan 5, 2025
7c3878d
ポップアップが画面の端に来ると表示が壊れる不具合の修正およびポップアップがツールバーより上に来るように修正
UnABC Jan 6, 2025
dfe59a5
リアクションした人数が多い場合に「他n人」と圧縮
UnABC Jan 12, 2025
2544496
リアクションした人一覧で余分な空白が出来る問題を軽減
UnABC Jan 12, 2025
862f88f
ホバーした0.5秒後にポップアップが出るように調整
UnABC Jan 13, 2025
5ee9bac
formatの調整
UnABC Jan 13, 2025
108c4c1
モバイル版においてホバーによる拡大を無効化
Jan 14, 2025
b5850d4
StampScaledDetailElementのspan要素をscript部で記述など
UnABC Jan 15, 2025
3a771c4
ポップアップをDiscordと同じような感じに変更
UnABC Jan 18, 2025
646c014
conflictの解消
UnABC Jan 18, 2025
f19b322
拡大表示内容に誤りがあったので修正
UnABC Jan 19, 2025
5087384
format
UnABC Jan 19, 2025
e379fa0
画面端で見切れる問題を修正、UIの微調整
UnABC Feb 15, 2025
b84cbfa
Merge branch 'master' into issue4299
Pugma Feb 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<div v-for="stamp in stampList" :key="stamp.id" :class="$style.stamp">
<stamp-element
:stamp="stamp"
:is-detail-shown="isDetailShown"
@add-stamp="addStamp"
@remove-stamp="removeStamp"
/>
Expand Down Expand Up @@ -136,7 +137,7 @@ const { toggleStampPicker } = useStampPickerInvoker(
&[data-show-details] {
flex-direction: column;
}
contain: content;
contain: none;
}
.stamp {
margin: {
Expand Down
27 changes: 27 additions & 0 deletions src/components/Main/MainView/MessageElement/StampElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
:title="tooltip"
:data-include-me="$boolAttr(includeMe)"
@click="onClick"
@mouseenter="onMouseEnter"
@mouseleave="onMouseLeave"
>
<transition name="stamp-pressed" mode="out-in">
<a-stamp
Expand All @@ -15,6 +17,11 @@
</transition>
<spin-number :value="stamp.sum" :class="$style.count" />
</div>
<stamp-scaled-element
:class="$style.scaleReaction"
:show="isHovered && !isDetailShown"
:stamp="stamp"
/>
</template>

<script lang="ts" setup>
Expand All @@ -24,9 +31,12 @@ import { ref, computed, watch, onMounted } from 'vue'
import { useStampsStore } from '/@/store/entities/stamps'
import { useUsersStore } from '/@/store/entities/users'
import type { MessageStampById } from '/@/lib/messageStampList'
import StampScaledElement from './StampScaledElement.vue'
import useHover from '/@/composables/dom/useHover'

const props = defineProps<{
stamp: MessageStampById
isDetailShown: boolean
}>()

const emit = defineEmits<{
Expand Down Expand Up @@ -85,6 +95,8 @@ watch(
isProgress.value = false
}
)

const { isHovered, onMouseEnter, onMouseLeave } = useHover()
</script>

<style lang="scss" module>
Expand All @@ -103,6 +115,7 @@ watch(
user-select: none;
overflow: hidden;
contain: content;
position: relative;
}

.count {
Expand All @@ -118,4 +131,18 @@ watch(
right: 4px;
}
}

.scaleReaction {
@include background-tertiary;
display: flex;
height: 3.5rem;
align-items: flex-start;
padding: 0.125rem 0.25rem;
border-radius: 0.25rem;
user-select: none;
overflow: visible;
contain: content;
position: absolute;
bottom: 105%;
}
</style>
58 changes: 58 additions & 0 deletions src/components/Main/MainView/MessageElement/StampScaledElement.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<div v-show="show" :class="$style.scaleReaction">
<transition name="scale-reaction">
<!-- sizeを46より大きくすると見切れる -->
<a-stamp
:key="stamp.id"
:stamp-id="stamp.id"
:size="46"
:class="$style.stamp"
without-title
/>
</transition>
<stamp-detail-element :class="$style.detail" :stamp="stamp" />
</div>
</template>

<script lang="ts" setup>
import AStamp from '/@/components/UI/AStamp.vue'
import type { MessageStampById } from '/@/lib/messageStampList'
import StampDetailElement from './StampDetailElement.vue'

const props = defineProps<{
stamp: MessageStampById
show: boolean
}>()
</script>

<style lang="scss" module>
.scaleReaction {
@include color-ui-tertiary;
@include background-primary;
display: flex;
border-radius: 4px;
contain: none;
flex-wrap: wrap;
border: solid 2px $theme-ui-tertiary-default;
}
.stamp {
margin: {
right: 0.2rem;
bottom: 0.2rem;
}
display: flex;
}

.detail {
color: var(--specific-count-text);
@include color-ui-primary;
max-width: 500px;
min-width: 0;
overflow: hidden;
overflow: clip;
margin: {
left: 6px;
right: 4px;
}
}
</style>
Loading