-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implements MsAnimation; Remove lottie
- Loading branch information
Showing
13 changed files
with
70 additions
and
326 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!-- Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS --> | ||
|
||
<template> | ||
<canvas | ||
ref="canvas" | ||
:height="height || 24" | ||
:width="width || 24" | ||
:speed="speed || 1" | ||
/> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { Rive } from '@rive-app/canvas'; | ||
import { onMounted, onUnmounted, ref } from 'vue'; | ||
|
||
const canvas = ref(); | ||
let riveInstance: Rive | null = null; | ||
|
||
const props = defineProps<{ | ||
height?: number; | ||
width?: number; | ||
speed?: number; | ||
src: string; | ||
}>(); | ||
|
||
onMounted(() => { | ||
if (canvas.value) { | ||
fetch(props.src) | ||
.then((response) => response.arrayBuffer()) | ||
.then((buffer) => { | ||
riveInstance = new Rive({ | ||
canvas: canvas.value, | ||
buffer: buffer, | ||
autoplay: true, | ||
}); | ||
}); | ||
} | ||
}); | ||
|
||
onUnmounted(() => { | ||
if (riveInstance) { | ||
riveInstance.cleanup(); | ||
} | ||
}); | ||
</script> | ||
|
||
<style scoped lang="scss"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS | ||
import MsAnimation from '@lib/components/ms-animation/MsAnimation.vue'; | ||
|
||
export { MsAnimation }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.