From: Enrique Hernandez Date: Tue, 10 Nov 2020 15:00:11 +0000 (-0600) Subject: add thinking animation X-Git-Tag: v0.9~141^2~2 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=e8413604d60c8b42ace7ed759db7b4f131772fa6;p=mime-chat add thinking animation --- diff --git a/src/components/AI/index.vue b/src/components/AI/index.vue index edcc65f..f03f7b1 100644 --- a/src/components/AI/index.vue +++ b/src/components/AI/index.vue @@ -9,7 +9,7 @@ gradientUnits="objectBoundingBox" > - + @@ -55,6 +55,14 @@ export default defineComponent({ onMounted(() => { gradient = document.getElementById("radial-gradient"); + + // anime({ + // targets: gradient, + // cy: "1.3", + // loop: true, + // direction: "alternate", + // easing: "easeInOutCirc", + // }); }); function convertBlock(buffer) { @@ -99,13 +107,37 @@ export default defineComponent({ watch(think, (think, prevThink) => { if (think) { - console.log("think"); + aiOffset.value = 0.7; + anime({ + targets: gradient, + cy: "0.7", + complete: function () { + anime({ + targets: gradient, + cy: "1.3", + loop: true, + direction: "alternate", + easing: "easeInOutCirc", + }); + }, + // loop: true, + // direction: "alternate", + // easing: "easeInOutCirc", + }); } else { - console.log("dont think"); + aiOffset.value = 1; + anime({ + targets: gradient, + cy: "1", + loop: false, + easing: "easeInOutCirc", + offset: "-=100", + }); } }); return { radius, + aiOffset, }; }, });