Skip to content

Commit 16a1644

Browse files
committed
feat: Implements MsAnimation; Remove lottie
1 parent 31cfab5 commit 16a1644

File tree

13 files changed

+70
-326
lines changed

13 files changed

+70
-326
lines changed

lib/assets/spinner.json

Lines changed: 0 additions & 266 deletions
This file was deleted.

lib/assets/spinner.riv

944 Bytes
Binary file not shown.

lib/components/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export * from '@lib/components/ms-input';
1818
// ** ms-modal ** //
1919
export * from '@lib/components/ms-modal';
2020

21+
// ** ms-animation ** //
22+
export * from '@lib/components/ms-animation';
23+
2124
// ** ms-sorter ** //
2225
export * from '@lib/components/ms-sorter';
2326

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!-- Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS -->
2+
3+
<template>
4+
<canvas
5+
ref="canvas"
6+
:height="height || 24"
7+
:width="width || 24"
8+
:speed="speed || 1"
9+
/>
10+
</template>
11+
12+
<script setup lang="ts">
13+
import { Rive } from '@rive-app/canvas';
14+
import { onMounted, onUnmounted, ref } from 'vue';
15+
16+
const canvas = ref();
17+
let riveInstance: Rive | null = null;
18+
19+
const props = defineProps<{
20+
height?: number;
21+
width?: number;
22+
speed?: number;
23+
src: string;
24+
}>();
25+
26+
onMounted(() => {
27+
if (canvas.value) {
28+
fetch(props.src)
29+
.then((response) => response.arrayBuffer())
30+
.then((buffer) => {
31+
riveInstance = new Rive({
32+
canvas: canvas.value,
33+
buffer: buffer,
34+
autoplay: true,
35+
});
36+
});
37+
}
38+
});
39+
40+
onUnmounted(() => {
41+
if (riveInstance) {
42+
riveInstance.cleanup();
43+
}
44+
});
45+
</script>
46+
47+
<style scoped lang="scss"></style>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS
2+
import MsAnimation from '@lib/components/ms-animation/MsAnimation.vue';
3+
4+
export { MsAnimation };

lib/components/ms-spinner/MsSpinner.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@
88
>
99
{{ $msTranslate(title) }}
1010
</ion-text>
11-
<vue3-lottie
11+
<ms-animation
1212
class="container-spinner"
13-
:animation-data="SpinnerJSON"
13+
src="/lib/assets/spinner.riv"
1414
:height="height || 24"
1515
:width="width || 24"
1616
:speed="speed || 1"
17-
:loop="true"
1817
/>
1918
</div>
2019
</template>
2120

2221
<script setup lang="ts">
23-
import SpinnerJSON from '@lib/assets/spinner.json';
22+
import MsAnimation from '@lib/components/ms-animation/MsAnimation.vue';
2423
import { Translatable } from '@lib/services/translation';
2524
import { IonText } from '@ionic/vue';
2625

lib/plugin.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
import { TranslationPlugin } from '@lib/services';
44
import { App } from 'vue';
5-
import Vue3Lottie from 'vue3-lottie';
65

76
export const MegaSharkPlugin = {
87
install: (app: App<any>): void => {
98
app.use(TranslationPlugin);
10-
app.use(Vue3Lottie);
119
},
1210
};

lib/theme/components/lottie.scss

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/theme/global.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ http://ionicframework.com/docs/theming/ */
2020
@import 'components/cards';
2121
@import 'components/inputs';
2222
@import 'components/list';
23-
@import 'components/lottie';
2423
@import 'components/modals';
2524
@import 'components/notifications';
2625
@import 'components/toasts';

0 commit comments

Comments
 (0)