2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-04-22 04:50:54 +03:00
|
|
|
<template>
|
|
|
|
<div v-if="meta" :class="$style.root">
|
2023-04-22 06:50:40 +03:00
|
|
|
<div :class="[$style.main, $style.panel]">
|
2024-02-03 21:19:44 +02:00
|
|
|
<img :src="instance.iconUrl || '/apple-touch-icon.png'" alt="" :class="$style.mainIcon"/>
|
2023-09-30 22:53:52 +03:00
|
|
|
<button class="_button _acrylic" :class="$style.mainMenu" @click="showMenu"><i class="ph-dots-three ph-bold ph-lg"></i></button>
|
2023-04-22 04:50:54 +03:00
|
|
|
<div :class="$style.mainFg">
|
|
|
|
<h1 :class="$style.mainTitle">
|
|
|
|
<!-- 背景色によってはロゴが見えなくなるのでとりあえず無効に -->
|
|
|
|
<!-- <img class="logo" v-if="meta.logoImageUrl" :src="meta.logoImageUrl"><span v-else class="text">{{ instanceName }}</span> -->
|
|
|
|
<span>{{ instanceName }}</span>
|
|
|
|
</h1>
|
|
|
|
<div :class="$style.mainAbout">
|
|
|
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
2024-02-09 14:19:19 +02:00
|
|
|
<div v-html="sanitizeHtml(meta.description) || i18n.ts.headlineMisskey"></div>
|
2023-04-22 04:50:54 +03:00
|
|
|
</div>
|
|
|
|
<div v-if="instance.disableRegistration" :class="$style.mainWarn">
|
|
|
|
<MkInfo warn>{{ i18n.ts.invitationRequiredToRegister }}</MkInfo>
|
|
|
|
</div>
|
2023-10-18 03:41:36 +03:00
|
|
|
<div v-if="instance.approvalRequiredForSignup" :class="$style.mainWarn">
|
2023-10-18 04:00:48 +03:00
|
|
|
<MkInfo warn>{{ i18n.ts.approvalRequiredToRegister }}</MkInfo>
|
2023-10-18 03:41:36 +03:00
|
|
|
</div>
|
2023-04-22 04:50:54 +03:00
|
|
|
<div class="_gaps_s" :class="$style.mainActions">
|
|
|
|
<MkButton :class="$style.mainAction" full rounded gradate data-cy-signup style="margin-right: 12px;" @click="signup()">{{ i18n.ts.joinThisServer }}</MkButton>
|
|
|
|
<MkButton :class="$style.mainAction" full rounded @click="exploreOtherServers()">{{ i18n.ts.exploreOtherServers }}</MkButton>
|
|
|
|
<MkButton :class="$style.mainAction" full rounded data-cy-signin @click="signin()">{{ i18n.ts.login }}</MkButton>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="stats" :class="$style.stats">
|
2023-04-22 06:50:40 +03:00
|
|
|
<div :class="[$style.statsItem, $style.panel]">
|
2023-04-22 04:50:54 +03:00
|
|
|
<div :class="$style.statsItemLabel">{{ i18n.ts.users }}</div>
|
|
|
|
<div :class="$style.statsItemCount"><MkNumber :value="stats.originalUsersCount"/></div>
|
|
|
|
</div>
|
2023-04-22 06:50:40 +03:00
|
|
|
<div :class="[$style.statsItem, $style.panel]">
|
2023-04-22 04:50:54 +03:00
|
|
|
<div :class="$style.statsItemLabel">{{ i18n.ts.notes }}</div>
|
|
|
|
<div :class="$style.statsItemCount"><MkNumber :value="stats.originalNotesCount"/></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-22 06:50:40 +03:00
|
|
|
<div v-if="instance.policies.ltlAvailable" :class="[$style.tl, $style.panel]">
|
2023-04-22 04:50:54 +03:00
|
|
|
<div :class="$style.tlHeader">{{ i18n.ts.letsLookAtTimeline }}</div>
|
|
|
|
<div :class="$style.tlBody">
|
|
|
|
<MkTimeline src="local"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-06-01 11:19:46 +03:00
|
|
|
<div :class="$style.panel">
|
2023-04-22 06:50:40 +03:00
|
|
|
<XActiveUsersChart/>
|
|
|
|
</div>
|
2023-04-22 04:50:54 +03:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-12-07 07:42:09 +02:00
|
|
|
import { ref } from 'vue';
|
2023-09-04 07:33:38 +03:00
|
|
|
import * as Misskey from 'misskey-js';
|
2024-02-09 14:19:19 +02:00
|
|
|
import sanitizeHtml from 'sanitize-html';
|
2023-04-22 04:50:54 +03:00
|
|
|
import XSigninDialog from '@/components/MkSigninDialog.vue';
|
|
|
|
import XSignupDialog from '@/components/MkSignupDialog.vue';
|
|
|
|
import MkButton from '@/components/MkButton.vue';
|
|
|
|
import MkTimeline from '@/components/MkTimeline.vue';
|
|
|
|
import MkInfo from '@/components/MkInfo.vue';
|
2023-09-19 10:37:43 +03:00
|
|
|
import { instanceName } from '@/config.js';
|
|
|
|
import * as os from '@/os.js';
|
2024-01-04 11:32:46 +02:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2023-09-19 10:37:43 +03:00
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { instance } from '@/instance.js';
|
2023-04-22 04:50:54 +03:00
|
|
|
import MkNumber from '@/components/MkNumber.vue';
|
2023-04-22 06:50:40 +03:00
|
|
|
import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.vue';
|
2023-04-22 04:50:54 +03:00
|
|
|
|
2023-12-07 07:42:09 +02:00
|
|
|
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
|
|
|
const stats = ref<Misskey.entities.StatsResponse | null>(null);
|
2023-04-22 04:50:54 +03:00
|
|
|
|
2024-01-04 11:32:46 +02:00
|
|
|
misskeyApi('meta', { detail: true }).then(_meta => {
|
2023-12-07 07:42:09 +02:00
|
|
|
meta.value = _meta;
|
2023-04-22 04:50:54 +03:00
|
|
|
});
|
|
|
|
|
2024-01-04 11:32:46 +02:00
|
|
|
misskeyApi('stats', {}).then((res) => {
|
2023-12-07 07:42:09 +02:00
|
|
|
stats.value = res;
|
2023-04-22 04:50:54 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
function signin() {
|
|
|
|
os.popup(XSigninDialog, {
|
|
|
|
autoSet: true,
|
|
|
|
}, {}, 'closed');
|
|
|
|
}
|
|
|
|
|
|
|
|
function signup() {
|
|
|
|
os.popup(XSignupDialog, {
|
|
|
|
autoSet: true,
|
|
|
|
}, {}, 'closed');
|
|
|
|
}
|
|
|
|
|
|
|
|
function showMenu(ev) {
|
|
|
|
os.popupMenu([{
|
|
|
|
text: i18n.ts.instanceInfo,
|
2023-09-30 22:53:52 +03:00
|
|
|
icon: 'ph-info ph-bold ph-lg',
|
2023-04-22 04:50:54 +03:00
|
|
|
action: () => {
|
|
|
|
os.pageWindow('/about');
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
text: i18n.ts.aboutMisskey,
|
2023-12-05 21:58:53 +02:00
|
|
|
icon: 'sk-icons sk-shark ph-bold',
|
2023-04-22 04:50:54 +03:00
|
|
|
action: () => {
|
2023-09-23 05:34:15 +03:00
|
|
|
os.pageWindow('/about-sharkey');
|
2023-04-22 04:50:54 +03:00
|
|
|
},
|
2023-12-12 03:26:37 +02:00
|
|
|
}, { type: 'divider' }, (instance.impressumUrl) ? {
|
2023-10-07 07:13:13 +03:00
|
|
|
text: i18n.ts.impressum,
|
2023-11-04 00:20:53 +02:00
|
|
|
icon: 'ph-newspaper-clipping ph-bold ph-lg',
|
2023-10-07 07:13:13 +03:00
|
|
|
action: () => {
|
2024-01-30 12:53:53 +02:00
|
|
|
window.open(instance.impressumUrl!, '_blank', 'noopener');
|
2023-10-07 07:13:13 +03:00
|
|
|
},
|
|
|
|
} : undefined, (instance.tosUrl) ? {
|
|
|
|
text: i18n.ts.termsOfService,
|
2023-11-04 00:20:53 +02:00
|
|
|
icon: 'ph-notebook ph-bold ph-lg',
|
2023-10-07 07:13:13 +03:00
|
|
|
action: () => {
|
2024-01-30 12:53:53 +02:00
|
|
|
window.open(instance.tosUrl!, '_blank', 'noopener');
|
2023-10-07 07:13:13 +03:00
|
|
|
},
|
|
|
|
} : undefined, (instance.privacyPolicyUrl) ? {
|
|
|
|
text: i18n.ts.privacyPolicy,
|
2023-11-04 00:20:53 +02:00
|
|
|
icon: 'ph-shield ph-bold ph-lg',
|
2023-10-07 07:13:13 +03:00
|
|
|
action: () => {
|
2024-01-30 12:53:53 +02:00
|
|
|
window.open(instance.privacyPolicyUrl!, '_blank', 'noopener');
|
2023-10-07 07:13:13 +03:00
|
|
|
},
|
2024-01-09 22:32:47 +02:00
|
|
|
} : undefined, (instance.donationUrl) ? {
|
|
|
|
text: i18n.ts.donation,
|
|
|
|
icon: 'ph-hand-coins ph-bold ph-lg',
|
|
|
|
action: () => {
|
|
|
|
window.open(instance.donationUrl, '_blank', 'noopener');
|
|
|
|
},
|
|
|
|
} : undefined, (!instance.impressumUrl && !instance.tosUrl && !instance.privacyPolicyUrl && !instance.donationUrl) ? undefined : { type: 'divider' }, {
|
2023-04-22 04:50:54 +03:00
|
|
|
text: i18n.ts.help,
|
2023-09-30 22:53:52 +03:00
|
|
|
icon: 'ph-question ph-bold ph-lg',
|
2023-04-22 04:50:54 +03:00
|
|
|
action: () => {
|
2023-12-22 13:16:31 +02:00
|
|
|
window.open('https://misskey-hub.net/docs/for-users/', '_blank', 'noopener');
|
2023-04-22 04:50:54 +03:00
|
|
|
},
|
|
|
|
}], ev.currentTarget ?? ev.target);
|
|
|
|
}
|
|
|
|
|
|
|
|
function exploreOtherServers() {
|
2023-12-23 03:09:23 +02:00
|
|
|
window.open('https://joinsharkey.org/#findaninstance', '_blank', 'noopener');
|
2023-04-22 04:50:54 +03:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: 16px;
|
|
|
|
padding: 32px 0 0 0;
|
|
|
|
}
|
|
|
|
|
2023-04-22 06:50:40 +03:00
|
|
|
.panel {
|
2023-04-22 04:50:54 +03:00
|
|
|
position: relative;
|
|
|
|
background: var(--panel);
|
|
|
|
border-radius: var(--radius);
|
|
|
|
box-shadow: 0 12px 32px rgb(0 0 0 / 25%);
|
2023-04-22 06:50:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.main {
|
2023-04-22 04:50:54 +03:00
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mainIcon {
|
|
|
|
width: 85px;
|
|
|
|
margin-top: -47px;
|
|
|
|
vertical-align: bottom;
|
2023-04-22 11:11:13 +03:00
|
|
|
filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
|
2023-04-22 04:50:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.mainMenu {
|
|
|
|
position: absolute;
|
|
|
|
top: 16px;
|
|
|
|
right: 16px;
|
|
|
|
width: 32px;
|
|
|
|
height: 32px;
|
2023-10-31 20:44:34 +02:00
|
|
|
border-radius: var(--radius-sm);
|
2023-04-22 04:50:54 +03:00
|
|
|
font-size: 18px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mainFg {
|
|
|
|
position: relative;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mainTitle {
|
|
|
|
display: block;
|
|
|
|
margin: 0;
|
|
|
|
padding: 16px 32px 24px 32px;
|
|
|
|
font-size: 1.4em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mainLogo {
|
|
|
|
vertical-align: bottom;
|
|
|
|
max-height: 120px;
|
|
|
|
max-width: min(100%, 300px);
|
|
|
|
}
|
|
|
|
|
|
|
|
.mainAbout {
|
|
|
|
padding: 0 32px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mainWarn {
|
|
|
|
padding: 32px 32px 0 32px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mainActions {
|
|
|
|
padding: 32px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mainAction {
|
|
|
|
line-height: 28px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.stats {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
grid-gap: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.statsItem {
|
|
|
|
overflow: clip;
|
2023-04-22 06:19:49 +03:00
|
|
|
padding: 16px 20px;
|
2023-04-22 04:50:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
.statsItemLabel {
|
|
|
|
color: var(--fgTransparentWeak);
|
|
|
|
font-size: 0.9em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.statsItemCount {
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 1.2em;
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
|
|
|
|
.tl {
|
|
|
|
overflow: clip;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tlHeader {
|
|
|
|
padding: 12px 16px;
|
|
|
|
border-bottom: solid 1px var(--divider);
|
|
|
|
}
|
|
|
|
|
|
|
|
.tlBody {
|
|
|
|
height: 350px;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
</style>
|