2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-01-21 04:14:55 +00:00
|
|
|
<template>
|
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><MkPageHeader/></template>
|
2023-05-19 07:20:53 +00:00
|
|
|
<MkSpacer :contentMax="1200">
|
2023-01-21 04:14:55 +00:00
|
|
|
<MkAchievements :user="$i"/>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-02-16 14:09:41 +00:00
|
|
|
import { onActivated, onDeactivated, onMounted, onUnmounted } from 'vue';
|
2023-01-21 04:14:55 +00:00
|
|
|
import MkAchievements from '@/components/MkAchievements.vue';
|
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
|
|
|
import { $i } from '@/account';
|
2023-01-21 07:06:49 +00:00
|
|
|
import { claimAchievement } from '@/scripts/achievements';
|
|
|
|
|
2023-01-21 07:57:23 +00:00
|
|
|
let timer: number | null;
|
2023-01-21 07:06:49 +00:00
|
|
|
|
|
|
|
function viewAchievements3min() {
|
|
|
|
claimAchievement('viewAchievements3min');
|
|
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
if (timer == null) timer = window.setTimeout(viewAchievements3min, 1000 * 60 * 3);
|
|
|
|
});
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
2023-01-21 07:57:23 +00:00
|
|
|
if (timer != null) {
|
|
|
|
window.clearTimeout(timer);
|
|
|
|
timer = null;
|
|
|
|
}
|
2023-01-21 07:06:49 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
onActivated(() => {
|
|
|
|
if (timer == null) timer = window.setTimeout(viewAchievements3min, 1000 * 60 * 3);
|
|
|
|
});
|
|
|
|
|
|
|
|
onDeactivated(() => {
|
2023-01-21 07:57:23 +00:00
|
|
|
if (timer != null) {
|
|
|
|
window.clearTimeout(timer);
|
|
|
|
timer = null;
|
|
|
|
}
|
2023-01-21 07:06:49 +00:00
|
|
|
});
|
2023-01-21 04:14:55 +00:00
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.achievements,
|
2023-01-24 05:10:26 +00:00
|
|
|
icon: 'ti ti-medal',
|
2023-01-21 04:14:55 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
|
|
|
|
</style>
|