summaryrefslogtreecommitdiff
path: root/src/client/pages/index.welcome.entrance.vue
blob: 9bb2e85fc32dc3c3cd13102beb698f63b4f89715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<template>
<div class="rsqzvsbo">
	<div class="_panel about" v-if="meta">
		<div class="banner" :style="{ backgroundImage: `url(${ meta.bannerUrl })` }"></div>
		<div class="body">
			<h1 class="name" v-html="meta.name || host"></h1>
			<div class="desc" v-html="meta.description || $t('introMisskey')"></div>
			<mk-button @click="signup()" style="display: inline-block; margin-right: 16px;" primary>{{ $t('signup') }}</mk-button>
			<mk-button @click="signin()" style="display: inline-block;">{{ $t('login') }}</mk-button>
		</div>
	</div>
	<x-notes :pagination="featuredPagination"/>
</div>
</template>

<script lang="ts">
import Vue from 'vue';
import { toUnicode } from 'punycode';
import XSigninDialog from '../components/signin-dialog.vue';
import XSignupDialog from '../components/signup-dialog.vue';
import MkButton from '../components/ui/button.vue';
import XNotes from '../components/notes.vue';
import { host } from '../config';

export default Vue.extend({
	components: {
		MkButton,
		XNotes,
	},

	data() {
		return {
			featuredPagination: {
				endpoint: 'notes/featured',
				limit: 10,
				noPaging: true,
			},
			host: toUnicode(host),
		};
	},

	computed: {
		meta() {
			return this.$store.state.instance.meta;
		},
	},

	created() {
		this.$root.api('stats').then(stats => {
			this.stats = stats;
		});
	},

	methods: {
		signin() {
			this.$root.new(XSigninDialog, {
				autoSet: true
			});
		},

		signup() {
			this.$root.new(XSignupDialog, {
				autoSet: true
			});
		}
	}
});
</script>

<style lang="scss" scoped>
.rsqzvsbo {
	> .about {
		overflow: hidden;
		margin-bottom: var(--margin);

		> .banner {
			height: 170px;
			background-size: cover;
			background-position: center center;
		}

		> .body {
			padding: 32px;

			@media (max-width: 500px) {
				padding: 16px;
			}

			> .name {
				margin: 0 0 0.5em 0;
			}
		}
	}
}
</style>