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

Issue4299 #4434

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 30 additions & 5 deletions src/components/Main/MainView/MessageElement/StampElement.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<template>
<div
:class="$style.body"
:title="tooltip"
:aria-label="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 All @@ -43,10 +53,7 @@ const stampName = computed(

const tooltip = computed(() =>
[
`:${stampName.value}:`,
...props.stamp.users.map(
u => `${usersMap.value.get(u.id)?.displayName ?? ''}(${u.count})`
)
`${stampName.value}, ${props.stamp.sum}件のリアクション, クリック/タップでリアクションを削除`
].join(' ')
)

Expand Down Expand Up @@ -85,6 +92,8 @@ watch(
isProgress.value = false
}
)

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

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

.count {
Expand All @@ -118,4 +128,19 @@ 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%;
z-index: $z-index-message-element-scaled-stamp;
}
</style>
59 changes: 59 additions & 0 deletions src/components/Main/MainView/MessageElement/StampScaledElement.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<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;
flex: 1 1 0;
max-width: 500px;
min-width: 0;
overflow: hidden;
overflow: clip;
margin: {
left: 6px;
right: 4px;
}
}
</style>
1 change: 1 addition & 0 deletions src/styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ $z-index-message-loading: 2;

$z-index-message-element-tools: 3;
$z-index-message-element-tools-menu: 5;
$z-index-message-element-scaled-stamp: 7;

$z-index-main-view-wrapper: 10;
$z-index-sidebar-wrapper: 11;
Expand Down
Loading