8d06a6475e
* chore: 著作権とライセンスについての情報を各ファイルに追加する * chore: Add the SPDX information to each file Add copyright and licensing information as defined in version 3.0 of the REUSE Specification. * tweak format --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> * chore: Add SPDX-License-Identifier [skip ci] * add missing SPDX-License-Identifier * remove unused file --------- Co-authored-by: Shun Sakai <sorairolake@protonmail.ch> Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> Co-authored-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
75 lines
1.6 KiB
Vue
75 lines
1.6 KiB
Vue
<!--
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
|
|
<template>
|
|
<div>
|
|
<Transition
|
|
:enterActiveClass="defaultStore.state.animation ? $style.transition_toast_enterActive : ''"
|
|
:leaveActiveClass="defaultStore.state.animation ? $style.transition_toast_leaveActive : ''"
|
|
:enterFromClass="defaultStore.state.animation ? $style.transition_toast_enterFrom : ''"
|
|
:leaveToClass="defaultStore.state.animation ? $style.transition_toast_leaveTo : ''"
|
|
appear @afterLeave="emit('closed')"
|
|
>
|
|
<div v-if="showing" class="_acrylic" :class="$style.root" :style="{ zIndex }">
|
|
<div style="padding: 16px 24px;">
|
|
{{ message }}
|
|
</div>
|
|
</div>
|
|
</Transition>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { onMounted } from 'vue';
|
|
import * as os from '@/os';
|
|
import { defaultStore } from '@/store';
|
|
|
|
defineProps<{
|
|
message: string;
|
|
}>();
|
|
|
|
const emit = defineEmits<{
|
|
(ev: 'closed'): void;
|
|
}>();
|
|
|
|
const zIndex = os.claimZIndex('high');
|
|
let showing = $ref(true);
|
|
|
|
onMounted(() => {
|
|
window.setTimeout(() => {
|
|
showing = false;
|
|
}, 4000);
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" module>
|
|
.transition_toast_enterActive,
|
|
.transition_toast_leaveActive {
|
|
transition: opacity 0.3s, transform 0.3s !important;
|
|
}
|
|
.transition_toast_enterFrom,
|
|
.transition_toast_leaveTo {
|
|
opacity: 0;
|
|
transform: translateY(-100%);
|
|
}
|
|
|
|
.root {
|
|
position: fixed;
|
|
left: 0;
|
|
right: 0;
|
|
top: 50px;
|
|
margin: 0 auto;
|
|
margin-top: 16px;
|
|
min-width: 300px;
|
|
max-width: calc(100% - 32px);
|
|
width: min-content;
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
|
border-radius: 8px;
|
|
overflow: clip;
|
|
text-align: center;
|
|
pointer-events: none;
|
|
}
|
|
</style>
|