2023-07-27 00:31:52 -05:00
|
|
|
<!--
|
2024-02-13 09:50:11 -06:00
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
2023-07-27 00:31:52 -05:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-01-08 02:41:09 -06:00
|
|
|
<template>
|
|
|
|
<div :class="$style.root" :style="{ zIndex, top: `${y - 64}px`, left: `${x - 64}px` }">
|
2024-01-06 05:15:28 -06:00
|
|
|
<span class="text" :class="{ up }">+{{ value }}</span>
|
2023-01-08 02:41:09 -06:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-12-06 23:42:09 -06:00
|
|
|
import { onMounted, ref } from 'vue';
|
2023-09-19 02:37:43 -05:00
|
|
|
import * as os from '@/os.js';
|
2023-01-08 02:41:09 -06:00
|
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
x: number;
|
|
|
|
y: number;
|
2024-01-12 05:38:04 -06:00
|
|
|
value?: number | string;
|
2023-01-08 02:41:09 -06:00
|
|
|
}>(), {
|
2024-01-06 05:15:28 -06:00
|
|
|
value: 1,
|
2023-01-08 02:41:09 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'end'): void;
|
|
|
|
}>();
|
|
|
|
|
2023-12-06 23:42:09 -06:00
|
|
|
const up = ref(false);
|
2023-01-08 02:41:09 -06:00
|
|
|
const zIndex = os.claimZIndex('middle');
|
|
|
|
const angle = (45 - (Math.random() * 90)) + 'deg';
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
window.setTimeout(() => {
|
2023-12-06 23:42:09 -06:00
|
|
|
up.value = true;
|
2023-01-08 02:41:09 -06:00
|
|
|
}, 10);
|
|
|
|
|
|
|
|
window.setTimeout(() => {
|
|
|
|
emit('end');
|
|
|
|
}, 1100);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2024-01-07 01:32:52 -06:00
|
|
|
user-select: none;
|
2023-01-08 02:41:09 -06:00
|
|
|
pointer-events: none;
|
|
|
|
position: fixed;
|
|
|
|
width: 128px;
|
|
|
|
height: 128px;
|
|
|
|
|
|
|
|
&:global {
|
|
|
|
> .text {
|
|
|
|
display: block;
|
|
|
|
height: 1em;
|
|
|
|
text-align: center;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
margin: auto;
|
|
|
|
color: #fff;
|
|
|
|
text-shadow: 0 0 6px #000;
|
|
|
|
font-size: 18px;
|
|
|
|
font-weight: bold;
|
|
|
|
transform: translateY(0px);
|
|
|
|
transition: transform 1s cubic-bezier(0,.5,0,1), opacity 1s cubic-bezier(.5,0,1,.5);
|
|
|
|
will-change: opacity, transform;
|
|
|
|
|
|
|
|
&.up {
|
|
|
|
opacity: 0;
|
|
|
|
transform: translateY(-50px) rotateZ(v-bind(angle));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|