2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2022-12-31 13:36:49 +02:00
|
|
|
<template>
|
2022-12-31 14:10:25 +02:00
|
|
|
<span>{{ number(Math.floor(tweened.number)) }}</span>
|
2022-12-31 13:36:49 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-02-16 16:09:41 +02:00
|
|
|
import { reactive, watch } from 'vue';
|
2022-12-31 13:36:49 +02:00
|
|
|
import gsap from 'gsap';
|
2023-09-19 10:37:43 +03:00
|
|
|
import number from '@/filters/number.js';
|
2022-12-31 13:36:49 +02:00
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
value: number;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const tweened = reactive({
|
|
|
|
number: 0,
|
|
|
|
});
|
|
|
|
|
|
|
|
watch(() => props.value, (n) => {
|
2022-12-31 14:10:25 +02:00
|
|
|
gsap.to(tweened, { duration: 1, number: Number(n) || 0 });
|
2022-12-31 13:36:49 +02:00
|
|
|
}, {
|
|
|
|
immediate: true,
|
|
|
|
});
|
|
|
|
</script>
|