ripple on renote

This commit is contained in:
ThatOneCalculator 2022-10-25 11:23:59 -07:00
parent f7fdaa128a
commit f258668946
3 changed files with 9 additions and 2 deletions

View File

@ -16,6 +16,7 @@
<script lang="ts" setup>
import { computed, ref } from 'vue';
import * as misskey from 'misskey-js';
import Ripple from '@/components/MkRipple.vue';
import XDetails from '@/components/MkUsersTooltip.vue';
import { pleaseLogin } from '@/scripts/please-login';
import * as os from '@/os';
@ -58,6 +59,13 @@ const renote = (viaKeyboard = false) => {
renoteId: props.note.id,
visibility: props.note.visibility,
});
const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined;
if (el) {
const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2);
os.popup(Ripple, { x, y }, {}, 'end');
}
} else {
os.popupMenu([{
text: i18n.ts.renote,

View File

@ -74,7 +74,7 @@ const emit = defineEmits<{
const particles = [];
const origin = 64;
const colors = ['#FF1493', '#00FFFF', '#FFE202'];
const colors = ['#eb6f92', '#9ccfd8', '#f6c177'];
const zIndex = os.claimZIndex('high');
if (props.particle) {

View File

@ -120,7 +120,6 @@ function onSlideChange() {
function syncSlide(index) {
swiperRef.slideTo(index);
tab = tabs[index];
}
</script>