2020-02-21 17:20:58 +01:00
|
|
|
<template>
|
2023-04-08 02:01:42 +02:00
|
|
|
<div
|
|
|
|
class="vswabwbm"
|
|
|
|
:style="{ zIndex, top: `${y - 64}px`, left: `${x - 64}px` }"
|
|
|
|
>
|
|
|
|
<svg
|
|
|
|
width="128"
|
|
|
|
height="128"
|
|
|
|
viewBox="0 0 128 128"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
>
|
|
|
|
<circle fill="none" cx="64" cy="64">
|
2022-09-01 17:22:31 +02:00
|
|
|
<animate
|
|
|
|
attributeName="r"
|
2023-04-08 02:01:42 +02:00
|
|
|
begin="0s"
|
|
|
|
dur="0.5s"
|
|
|
|
values="4; 32"
|
2020-10-17 13:12:00 +02:00
|
|
|
calcMode="spline"
|
|
|
|
keyTimes="0; 1"
|
|
|
|
keySplines="0.165, 0.84, 0.44, 1"
|
|
|
|
repeatCount="1"
|
|
|
|
/>
|
2022-09-01 17:22:31 +02:00
|
|
|
<animate
|
2023-04-08 02:01:42 +02:00
|
|
|
attributeName="stroke-width"
|
|
|
|
begin="0s"
|
|
|
|
dur="0.5s"
|
|
|
|
values="16; 0"
|
2020-10-17 13:12:00 +02:00
|
|
|
calcMode="spline"
|
|
|
|
keyTimes="0; 1"
|
|
|
|
keySplines="0.3, 0.61, 0.355, 1"
|
|
|
|
repeatCount="1"
|
|
|
|
/>
|
2020-02-21 18:26:01 +01:00
|
|
|
</circle>
|
2023-04-08 02:01:42 +02:00
|
|
|
<g fill="none" fill-rule="evenodd">
|
|
|
|
<circle
|
|
|
|
v-for="(particle, i) in particles"
|
|
|
|
:key="i"
|
|
|
|
:fill="particle.color"
|
|
|
|
>
|
|
|
|
<animate
|
|
|
|
attributeName="r"
|
|
|
|
begin="0s"
|
|
|
|
dur="0.8s"
|
|
|
|
:values="`${particle.size}; 0`"
|
|
|
|
calcMode="spline"
|
|
|
|
keyTimes="0; 1"
|
|
|
|
keySplines="0.165, 0.84, 0.44, 1"
|
|
|
|
repeatCount="1"
|
|
|
|
/>
|
|
|
|
<animate
|
|
|
|
attributeName="cx"
|
|
|
|
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"
|
|
|
|
/>
|
|
|
|
<animate
|
|
|
|
attributeName="cy"
|
|
|
|
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"
|
|
|
|
/>
|
|
|
|
</circle>
|
|
|
|
</g>
|
|
|
|
</svg>
|
|
|
|
</div>
|
2020-02-21 17:20:58 +01:00
|
|
|
</template>
|
|
|
|
|
2022-09-01 17:22:31 +02:00
|
|
|
<script lang="ts" setup>
|
2023-04-08 02:01:42 +02:00
|
|
|
import { onMounted } from "vue";
|
|
|
|
import * as os from "@/os";
|
2020-02-21 17:20:58 +01:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
const props = withDefaults(
|
|
|
|
defineProps<{
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
particle?: boolean;
|
|
|
|
}>(),
|
|
|
|
{
|
|
|
|
particle: true,
|
|
|
|
}
|
|
|
|
);
|
2020-02-21 18:26:01 +01:00
|
|
|
|
2022-09-01 17:22:31 +02:00
|
|
|
const emit = defineEmits<{
|
2023-04-08 02:01:42 +02:00
|
|
|
(ev: "end"): void;
|
2022-09-01 17:22:31 +02:00
|
|
|
}>();
|
2020-02-21 18:26:01 +01:00
|
|
|
|
2022-09-01 17:22:31 +02:00
|
|
|
const particles = [];
|
|
|
|
const origin = 64;
|
2023-04-08 02:01:42 +02:00
|
|
|
const colors = ["#eb6f92", "#9ccfd8", "#f6c177"];
|
|
|
|
const zIndex = os.claimZIndex("high");
|
2022-09-01 17:22:31 +02:00
|
|
|
|
|
|
|
if (props.particle) {
|
|
|
|
for (let i = 0; i < 12; i++) {
|
|
|
|
const angle = Math.random() * (Math.PI * 2);
|
|
|
|
const pos = Math.random() * 16;
|
2023-04-08 02:01:42 +02:00
|
|
|
const velocity = 16 + Math.random() * 48;
|
2022-09-01 17:22:31 +02:00
|
|
|
particles.push({
|
2023-04-08 02:01:42 +02:00
|
|
|
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),
|
2022-09-01 17:22:31 +02:00
|
|
|
color: colors[Math.floor(Math.random() * colors.length)],
|
2021-12-27 14:59:14 +01:00
|
|
|
});
|
2022-09-01 17:22:31 +02:00
|
|
|
}
|
|
|
|
}
|
2021-12-27 14:59:14 +01:00
|
|
|
|
2022-09-01 17:22:31 +02:00
|
|
|
onMounted(() => {
|
|
|
|
window.setTimeout(() => {
|
2023-04-08 02:01:42 +02:00
|
|
|
emit("end");
|
2022-09-01 17:22:31 +02:00
|
|
|
}, 1100);
|
2020-02-21 17:20:58 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.vswabwbm {
|
|
|
|
pointer-events: none;
|
|
|
|
position: fixed;
|
2020-02-21 18:26:01 +01:00
|
|
|
width: 128px;
|
|
|
|
height: 128px;
|
2020-02-21 17:20:58 +01:00
|
|
|
|
2020-02-21 18:26:01 +01:00
|
|
|
> svg {
|
|
|
|
> circle {
|
|
|
|
stroke: var(--accent);
|
|
|
|
}
|
2020-02-21 17:20:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|