import { inject, onMounted } from "vue";
export default function useUIindexAnims() {
+ interface Done {}
const anime: any = inject("animejs");
const timeline = anime.timeline({ loop: true });
const msgOffset = {
winW = messenger.clientWidth;
});
- async function beforeEnter(el: any) {
+ function getCardHeight(el: SVGSVGElement) {
+ const cardHeight = el.getBBox().height;
+ return cardHeight;
+ }
+
+ async function getAllCardsHeight() {
+ let cards: [];
+ cardsDiv = await document.getElementById("cardsDiv");
+ cards = cardsDiv.querySelectorAll(".message");
+ let totalHeight = 0;
+ for (const card of cards) {
+ let height = getCardHeight(card);
+ totalHeight += height;
+ if (totalHeight >= 500) {
+ console.log("update scroll view");
+ }
+ }
+ }
+
+ async function beforeEnter(el: SVGGElement) {
modifier = el.className.baseVal.substring(0, 2);
}
async function enter(el: SVGGElement, done: any) {
- console.log(done);
+ getAllCardsHeight();
const paddingLeft = 40;
msg = await document.getElementById(el.id);
const rect = msg.getBoundingClientRect();
duration: 500,
offset: 1000
});
+ done;
}
return {
beforeEnter,