2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-02-21 16:20:58 +00:00
|
|
|
<template>
|
2023-05-14 01:21:56 +00:00
|
|
|
<div :class="$style.root" :style="{ zIndex, top: `${y - 64}px`, left: `${x - 64}px` }">
|
2020-02-21 17:26:01 +00:00
|
|
|
<svg width="128" height="128" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
|
2023-05-14 01:21:56 +00:00
|
|
|
<circle fill="none" cx="64" cy="64" style="stroke: var(--accent);">
|
2022-09-01 15:22:31 +00:00
|
|
|
<animate
|
|
|
|
attributeName="r"
|
2020-10-17 11:12:00 +00:00
|
|
|
begin="0s" dur="0.5s"
|
|
|
|
values="4; 32"
|
|
|
|
calcMode="spline"
|
|
|
|
keyTimes="0; 1"
|
|
|
|
keySplines="0.165, 0.84, 0.44, 1"
|
|
|
|
repeatCount="1"
|
|
|
|
/>
|
2022-09-01 15:22:31 +00:00
|
|
|
<animate
|
|
|
|
attributeName="stroke-width"
|
2020-10-17 11:12:00 +00:00
|
|
|
begin="0s" dur="0.5s"
|
|
|
|
values="16; 0"
|
|
|
|
calcMode="spline"
|
|
|
|
keyTimes="0; 1"
|
|
|
|
keySplines="0.3, 0.61, 0.355, 1"
|
|
|
|
repeatCount="1"
|
|
|
|
/>
|
2020-02-21 17:26:01 +00:00
|
|
|
</circle>
|
|
|
|
<g fill="none" fill-rule="evenodd">
|
2023-05-14 01:21:56 +00:00
|
|
|
<circle v-for="(particle, i) in particles" :key="i" :fill="particle.color" style="stroke: var(--accent);">
|
2022-09-01 15:22:31 +00:00
|
|
|
<animate
|
|
|
|
attributeName="r"
|
2020-10-17 11:12:00 +00:00
|
|
|
begin="0s" dur="0.8s"
|
|
|
|
:values="`${particle.size}; 0`"
|
|
|
|
calcMode="spline"
|
|
|
|
keyTimes="0; 1"
|
|
|
|
keySplines="0.165, 0.84, 0.44, 1"
|
|
|
|
repeatCount="1"
|
|
|
|
/>
|
2022-09-01 15:22:31 +00:00
|
|
|
<animate
|
|
|
|
attributeName="cx"
|
2020-10-17 11:12:00 +00:00
|
|
|
begin="0s" dur="0.8s"
|
|
|
|
:values="`${particle.xA}; ${particle.xB}`"
|
|
|
|
calcMode="spline"
|
|
|
|
keyTimes="0; 1"
|
|
|
|
keySplines="0.3, 0.61, 0.355, 1"
|
|
|
|
repeatCount="1"
|
|
|
|
/>
|
2022-09-01 15:22:31 +00:00
|
|
|
<animate
|
|
|
|
attributeName="cy"
|
2020-10-17 11:12:00 +00:00
|
|
|
begin="0s" dur="0.8s"
|
|
|
|
:values="`${particle.yA}; ${particle.yB}`"
|
|
|
|
calcMode="spline"
|
|
|
|
keyTimes="0; 1"
|
|
|
|
keySplines="0.3, 0.61, 0.355, 1"
|
|
|
|
repeatCount="1"
|
|
|
|
/>
|
2020-02-21 17:26:01 +00:00
|
|
|
</circle>
|
|
|
|
</g>
|
|
|
|
</svg>
|
|
|
|
</div>
|
2020-02-21 16:20:58 +00:00
|
|
|
</template>
|
|
|
|
|
2022-09-01 15:22:31 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { onMounted } from 'vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import * as os from '@/os.js';
|
2020-02-21 16:20:58 +00:00
|
|
|
|
2022-09-01 15:22:31 +00:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
particle?: boolean;
|
|
|
|
}>(), {
|
|
|
|
particle: true,
|
|
|
|
});
|
2020-02-21 17:26:01 +00:00
|
|
|
|
2022-09-01 15:22:31 +00:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'end'): void;
|
|
|
|
}>();
|
2020-02-21 17:26:01 +00:00
|
|
|
|
2024-01-05 06:25:26 +00:00
|
|
|
const particles: {
|
|
|
|
size: number;
|
|
|
|
xA: number;
|
|
|
|
yA: number;
|
|
|
|
xB: number;
|
|
|
|
yB: number;
|
|
|
|
color: string;
|
|
|
|
}[] = [];
|
2022-09-01 15:22:31 +00:00
|
|
|
const origin = 64;
|
|
|
|
const colors = ['#FF1493', '#00FFFF', '#FFE202'];
|
|
|
|
const zIndex = os.claimZIndex('high');
|
|
|
|
|
|
|
|
if (props.particle) {
|
|
|
|
for (let i = 0; i < 12; i++) {
|
|
|
|
const angle = Math.random() * (Math.PI * 2);
|
|
|
|
const pos = Math.random() * 16;
|
|
|
|
const velocity = 16 + (Math.random() * 48);
|
|
|
|
particles.push({
|
|
|
|
size: 4 + (Math.random() * 8),
|
|
|
|
xA: origin + (Math.sin(angle) * pos),
|
|
|
|
yA: origin + (Math.cos(angle) * pos),
|
|
|
|
xB: origin + (Math.sin(angle) * (pos + velocity)),
|
|
|
|
yB: origin + (Math.cos(angle) * (pos + velocity)),
|
|
|
|
color: colors[Math.floor(Math.random() * colors.length)],
|
2021-12-27 13:59:14 +00:00
|
|
|
});
|
2022-09-01 15:22:31 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-27 13:59:14 +00:00
|
|
|
|
2022-09-01 15:22:31 +00:00
|
|
|
onMounted(() => {
|
|
|
|
window.setTimeout(() => {
|
|
|
|
emit('end');
|
|
|
|
}, 1100);
|
2020-02-21 16:20:58 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2023-05-14 01:21:56 +00:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2020-02-21 16:20:58 +00:00
|
|
|
pointer-events: none;
|
|
|
|
position: fixed;
|
2020-02-21 17:26:01 +00:00
|
|
|
width: 128px;
|
|
|
|
height: 128px;
|
2020-02-21 16:20:58 +00:00
|
|
|
}
|
|
|
|
</style>
|