2023-07-12 08:23:44 +02:00
|
|
|
<template>
|
2023-07-12 09:23:54 +02:00
|
|
|
<transition name="slide-fade">
|
2023-07-12 09:36:24 +02:00
|
|
|
<div v-if="show" class="_panel _shadow _acrylic" :class="$style.root">
|
2023-07-12 09:23:54 +02:00
|
|
|
<div :class="$style.icon">
|
|
|
|
<i class="ph-hand-heart ph-bold ph-5x" />
|
2023-07-12 08:23:44 +02:00
|
|
|
</div>
|
2023-07-12 09:23:54 +02:00
|
|
|
<div :class="$style.main">
|
|
|
|
<div :class="$style.title">
|
|
|
|
{{ i18n.ts._aboutMisskey.donateTitle }}
|
|
|
|
</div>
|
|
|
|
<div :class="$style.text">
|
|
|
|
{{ i18n.ts._aboutMisskey.pleaseDonateToCalckey }}
|
|
|
|
<p v-if="instance.donationLink">
|
|
|
|
{{
|
|
|
|
i18n.t("_aboutMisskey.pleaseDonateToHost", {
|
|
|
|
host: hostname,
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="_flexList">
|
|
|
|
<MkButton
|
|
|
|
primary
|
|
|
|
@click="
|
|
|
|
openExternal('https://opencollective.com/calckey')
|
|
|
|
"
|
|
|
|
>{{ i18n.ts._aboutMisskey.donate }}</MkButton
|
|
|
|
>
|
|
|
|
<MkButton
|
|
|
|
v-if="instance.donationLink"
|
|
|
|
primary
|
|
|
|
@click="openExternal(instance.donationLink)"
|
|
|
|
>{{
|
|
|
|
i18n.t("_aboutMisskey.donateHost", {
|
|
|
|
host: hostname,
|
|
|
|
})
|
|
|
|
}}</MkButton
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="_flexList" style="margin-top: 0.6rem">
|
|
|
|
<MkButton @click="close">{{
|
|
|
|
i18n.ts.remindMeLater
|
|
|
|
}}</MkButton>
|
|
|
|
<MkButton @click="neverShow">{{
|
|
|
|
i18n.ts.neverShow
|
|
|
|
}}</MkButton>
|
|
|
|
</div>
|
2023-07-12 08:23:44 +02:00
|
|
|
</div>
|
2023-07-12 09:23:54 +02:00
|
|
|
<button class="_button" :class="$style.close" @click="close">
|
|
|
|
<i class="ph-x ph-bold ph-lg"></i>
|
|
|
|
</button>
|
2023-07-12 08:23:44 +02:00
|
|
|
</div>
|
2023-07-12 09:23:54 +02:00
|
|
|
</transition>
|
2023-07-12 08:23:44 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-07-12 09:23:54 +02:00
|
|
|
import { ref } from "vue";
|
2023-07-12 08:23:44 +02:00
|
|
|
import MkButton from "@/components/MkButton.vue";
|
|
|
|
import { host } from "@/config";
|
|
|
|
import { i18n } from "@/i18n";
|
|
|
|
import * as os from "@/os";
|
|
|
|
import { instance } from "@/instance";
|
|
|
|
|
2023-07-12 09:23:54 +02:00
|
|
|
let show = ref(true);
|
|
|
|
|
2023-07-12 08:23:44 +02:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: "closed"): void;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const hostname = instance.name?.length <= 20 ? instance.name : host;
|
|
|
|
|
|
|
|
const zIndex = os.claimZIndex("low");
|
|
|
|
|
|
|
|
function close() {
|
|
|
|
localStorage.setItem("latestDonationInfoShownAt", Date.now().toString());
|
|
|
|
emit("closed");
|
2023-07-12 09:23:54 +02:00
|
|
|
show.value = false;
|
2023-07-12 08:23:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function neverShow() {
|
|
|
|
localStorage.setItem("neverShowDonationInfo", "true");
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
2023-07-12 08:42:59 +02:00
|
|
|
function openExternal(link) {
|
2023-07-12 08:23:44 +02:00
|
|
|
window.open(link, "_blank");
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2023-07-12 09:36:24 +02:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
.slide-fade-enter {
|
|
|
|
opacity: 1;
|
|
|
|
transform: translateY(0);
|
|
|
|
}
|
|
|
|
.slide-fade-enter-active {
|
|
|
|
transition: opacity 0.5s, transform 0.5s;
|
|
|
|
}
|
|
|
|
.slide-fade-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
transform: translateY(100%);
|
|
|
|
}
|
|
|
|
.slide-fade-leave-active {
|
|
|
|
transition: opacity 0.5s, transform 0.5s;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2023-07-12 08:23:44 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
|
|
|
position: fixed;
|
|
|
|
z-index: v-bind(zIndex);
|
|
|
|
bottom: var(--margin);
|
2023-07-12 09:36:24 +02:00
|
|
|
left: 2%;
|
|
|
|
bottom: 2%;
|
2023-07-12 08:23:44 +02:00
|
|
|
margin: auto;
|
|
|
|
box-sizing: border-box;
|
|
|
|
width: calc(100% - (var(--margin) * 2));
|
|
|
|
max-width: 500px;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
text-align: center;
|
|
|
|
padding-top: 25px;
|
|
|
|
width: 100px;
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 500px) {
|
|
|
|
.icon {
|
|
|
|
width: 80px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 450px) {
|
|
|
|
.icon {
|
|
|
|
width: 70px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.main {
|
|
|
|
padding: 25px 25px 25px 0;
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.close {
|
|
|
|
position: absolute;
|
|
|
|
top: 8px;
|
|
|
|
right: 8px;
|
|
|
|
padding: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
.text {
|
|
|
|
margin: 0.7em 0 1em 0;
|
|
|
|
}
|
|
|
|
</style>
|