add confetti on dialog announcements

This commit is contained in:
bunnybeam 2025-07-08 20:41:07 +01:00
parent e1bd8c5909
commit a8db24e074
No known key found for this signature in database

View file

@ -39,6 +39,7 @@ import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n.js';
import { $i } from '@/i.js';
import { updateCurrentAccountPartial } from '@/accounts.js';
import { confetti } from '@/utility/confetti.js';
const props = defineProps<{
announcement: Misskey.entities.Announcement;
@ -83,6 +84,12 @@ function onBgClick() {
const hasReachedBottom = ref(false);
onMounted(() => {
if (props.announcement.confetti) {
confetti({
duration: 1000 * 3,
});
}
if (bottomEl.value && rootEl.value) {
const bottomElRect = bottomEl.value.getBoundingClientRect();
const rootElRect = rootEl.value.getBoundingClientRect();