center renderer + add min build config

This commit is contained in:
riqo 2020-12-06 16:38:02 -06:00
commit 5cc44f1c2a
10 changed files with 30 additions and 11 deletions

View file

@ -14,7 +14,7 @@ export default function useMessageRenderer() {
function animateMessage(el: SVGGElement): void {
const transform = {
initialTranslate: `translate(${messageOffset.x} ${messageOffset.y})`,
finalTranslate: `translate(${messageOffset.x} ${messageOffset.y + 5})`
finalTranslate: `translate(${messageOffset.x} ${messageOffset.y})`
}
shift ? shiftAnimate(el, transform, shiftValue, messageList) : stackAnimate(el, transform);
}
@ -29,11 +29,11 @@ export default function useMessageRenderer() {
}
function afterEnter(el: SVGGElement) {
const messagePadding = 10;
const messagePadding = 15;
if (message) {
messageOffset = calculateMessageOffsets(message);
shift = messageOffset.y > 450 ? true : false;
shift = messageOffset.y > 445 ? true : false;
}
if (shift) {
shiftValue -= el.getBBox().height + messagePadding;

View file

@ -2,9 +2,9 @@ import { ref } from "vue";
export default function useOffsetCalculator() {
const xOffset = ref(0);
const yOffset = ref(0);
const firstChildMarginTop = 40;
const firstChildMarginTop = 0;
let previousMessageHeight = 0;
const messagePadding = 10;
const messagePadding = 15;
function setXoffset(message: HTMLElement): void {
const computedQuery = window.getComputedStyle(message)

View file

@ -37,6 +37,8 @@ export default function useRendererAnims() {
anime({
targets: el,
transform: transform.finalTranslate,
easing: "easeInOutQuad",
duration: 500,
offset: 1000
});
}

View file

@ -8,7 +8,7 @@ export default function useScroller({ targetId }: {targetId: string}) {
const clampedScroll = computed(() => {
if (targetHeight.value === 0) { return 0; }
topBound = -targetHeight.value + 440;
topBound = -targetHeight.value + 450;
return Math.max(topBound, Math.min(scroll.value, 0)) as number;
})