fix: (friendly) Adjust position of profile icon when header disappears
This commit is contained in:
parent
69e7432ca4
commit
f896812c42
|
@ -35,7 +35,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<article :class="$style.article" @contextmenu.stop="onContextmenu">
|
<article :class="$style.article" @contextmenu.stop="onContextmenu">
|
||||||
<MkAvatar v-once :class="$style.avatar" :user="appearNote.user" link preview/>
|
<MkAvatar :class="[$style.avatar, {[$style.showEl]: showEl}]" :user="appearNote.user" link preview/>
|
||||||
<div :class="$style.main">
|
<div :class="$style.main">
|
||||||
<MkNoteHeader :class="$style.header" :note="appearNote" :mini="true"/>
|
<MkNoteHeader :class="$style.header" :note="appearNote" :mini="true"/>
|
||||||
<MkInstanceTicker v-if="showTicker" :class="$style.ticker" :instance="appearNote.user.instance"/>
|
<MkInstanceTicker v-if="showTicker" :class="$style.ticker" :instance="appearNote.user.instance"/>
|
||||||
|
@ -145,6 +145,9 @@ import { useNoteCapture } from '@/scripts/use-note-capture';
|
||||||
import { deepClone } from '@/scripts/clone';
|
import { deepClone } from '@/scripts/clone';
|
||||||
import { useTooltip } from '@/scripts/use-tooltip';
|
import { useTooltip } from '@/scripts/use-tooltip';
|
||||||
import { claimAchievement } from '@/scripts/achievements';
|
import { claimAchievement } from '@/scripts/achievements';
|
||||||
|
import { eventBus } from '@/scripts/cherrypick/eventBus';
|
||||||
|
|
||||||
|
let showEl = $ref(false);
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
note: misskey.entities.Note;
|
note: misskey.entities.Note;
|
||||||
|
@ -205,6 +208,12 @@ const keymap = {
|
||||||
's': () => showContent.value !== showContent.value,
|
's': () => showContent.value !== showContent.value,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
eventBus.on('showEl', (showEl_receive) => {
|
||||||
|
showEl = showEl_receive;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
useNoteCapture({
|
useNoteCapture({
|
||||||
rootEl: el,
|
rootEl: el,
|
||||||
note: $$(appearNote),
|
note: $$(appearNote),
|
||||||
|
@ -624,6 +633,11 @@ function readPromo() {
|
||||||
width: 46px;
|
width: 46px;
|
||||||
height: 46px;
|
height: 46px;
|
||||||
top: calc(14px + var(--stickyTop, 0px));
|
top: calc(14px + var(--stickyTop, 0px));
|
||||||
|
transition: top 0.5s;
|
||||||
|
|
||||||
|
&.showEl {
|
||||||
|
top: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue