sharkey/src/client/app/desktop/views/pages/welcome.vue

509 lines
9.9 KiB
Vue
Raw Normal View History

2018-02-10 14:56:33 +09:00
<template>
2018-02-10 19:57:37 +09:00
<div class="mk-welcome">
2018-09-20 17:21:16 +09:00
<div class="banner" :style="{ backgroundImage: banner ? `url(${banner})` : null }"></div>
2018-05-23 15:48:41 +09:00
<button @click="dark">
<template v-if="$store.state.device.darkmode"><fa icon="moon"/></template>
<template v-else><fa :icon="['far', 'moon']"/></template>
2018-05-23 15:48:41 +09:00
</button>
2018-09-03 23:23:50 +09:00
<mk-forkit class="forkit"/>
2018-09-08 15:11:12 +09:00
<main>
<div class="body">
<div class="main block">
<div>
<h1 v-if="name != 'Misskey'">{{ name }}</h1>
2018-09-28 00:48:17 +09:00
<h1 v-else><img svg-inline src="../../../../assets/title.svg" :alt="name"></h1>
2018-09-08 15:11:12 +09:00
<div class="info">
<span><b>{{ host }}</b> - <span v-html="$t('powered-by-misskey')"></span></span>
2018-09-08 15:11:12 +09:00
<span class="stats" v-if="stats">
<span><fa icon="user"/> {{ stats.originalUsersCount | number }}</span>
<span><fa icon="pencil-alt"/> {{ stats.originalNotesCount | number }}</span>
2018-09-08 15:11:12 +09:00
</span>
</div>
2018-09-05 21:51:31 +09:00
2018-09-08 23:16:02 +09:00
<div class="desc">
<span class="desc" v-html="description || $t('@.about')"></span>
<a class="about" @click="about">{{ $t('about') }}</a>
2018-09-08 23:16:02 +09:00
</div>
2018-09-07 01:18:47 +09:00
2018-09-08 15:11:12 +09:00
<p class="sign">
<span class="signup" @click="signup">{{ $t('signup') }}</span>
2018-09-08 15:11:12 +09:00
<span class="divider">|</span>
<span class="signin" @click="signin">{{ $t('signin') }}</span>
2018-09-08 15:11:12 +09:00
</p>
2018-09-03 23:23:50 +09:00
<img :src="meta.logoUrl || '/assets/ai.png'" alt="" title="藍" class="char">
2018-09-05 21:51:31 +09:00
</div>
</div>
2018-09-03 23:23:50 +09:00
2018-09-08 15:11:12 +09:00
<div class="announcements block">
<header><fa icon="broadcast-tower"/> {{ $t('announcements') }}</header>
2018-09-08 15:11:12 +09:00
<div v-if="announcements && announcements.length > 0">
<div v-for="announcement in announcements">
<h1 v-html="announcement.title"></h1>
<div v-html="announcement.text"></div>
</div>
</div>
2018-09-07 20:21:25 +09:00
</div>
2018-09-08 15:11:12 +09:00
<div class="photos block">
<header><fa :icon="['far', 'images']"/> {{ $t('photos') }}</header>
2018-09-08 15:11:12 +09:00
<div>
<div v-for="photo in photos" :style="`background-image: url(${photo.thumbnailUrl})`"></div>
</div>
2018-09-05 21:51:31 +09:00
</div>
2018-09-03 23:23:50 +09:00
2018-09-08 15:11:12 +09:00
<div class="tag-cloud block">
2018-09-05 21:51:31 +09:00
<div>
2018-09-08 15:11:12 +09:00
<mk-tag-cloud/>
2018-09-05 21:51:31 +09:00
</div>
</div>
2018-09-04 02:09:56 +09:00
2018-09-08 15:11:12 +09:00
<div class="nav block">
2018-09-05 21:51:31 +09:00
<div>
2018-09-08 15:11:12 +09:00
<mk-nav class="nav"/>
2018-09-05 21:51:31 +09:00
</div>
</div>
2018-09-07 20:21:25 +09:00
2018-09-08 15:11:12 +09:00
<div class="side">
<div class="trends block">
<div>
<mk-trends/>
</div>
</div>
<div class="tl block">
<header><fa :icon="['far', 'comment-alt']"/> {{ $t('timeline') }}</header>
2018-09-08 15:11:12 +09:00
<div>
<mk-welcome-timeline class="tl" :max="20"/>
</div>
</div>
<div class="info block">
<header><fa icon="info-circle"/> {{ $t('info') }}</header>
2018-09-08 15:11:12 +09:00
<div>
<div v-if="meta" class="body">
<p>Version: <b>{{ meta.version }}</b></p>
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p>
2018-09-08 15:11:12 +09:00
</div>
2018-09-07 20:21:25 +09:00
</div>
</div>
</div>
2018-09-04 02:09:56 +09:00
</div>
2018-09-08 15:11:12 +09:00
</main>
2018-09-28 00:51:17 +09:00
<modal name="about" class="about modal" width="800px" height="auto" scrollable>
2018-09-08 15:11:12 +09:00
<article class="fpdezooorhntlzyeszemrsqdlgbysvxq">
<h1>{{ $t('@.intro.title') }}</h1>
<p v-html="this.$t('@.intro.about')"></p>
2018-09-08 15:11:12 +09:00
<section>
<h2>{{ $t('@.intro.features') }}</h2>
2018-09-08 15:11:12 +09:00
<section>
<div class="body">
<h3>{{ $t('@.intro.rich-contents') }}</h3>
<p v-html="this.$t('@.intro.rich-contents-desc')"></p>
2018-09-08 15:11:12 +09:00
</div>
<div class="image"><img src="/assets/about/post.png" alt=""></div>
</section>
<section>
<div class="body">
<h3>{{ $t('@.intro.reaction') }}</h3>
<p v-html="this.$t('@.intro.reaction-desc')"></p>
2018-09-08 15:11:12 +09:00
</div>
<div class="image"><img src="/assets/about/reaction.png" alt=""></div>
</section>
<section>
<div class="body">
<h3>{{ $t('@.intro.ui') }}</h3>
<p v-html="this.$t('@.intro.ui-desc')"></p>
2018-09-08 15:11:12 +09:00
</div>
<div class="image"><img src="/assets/about/ui.png" alt=""></div>
</section>
<section>
<div class="body">
<h3>{{ $t('@.intro.drive') }}</h3>
<p v-html="this.$t('@.intro.drive-desc')"></p>
2018-09-08 15:11:12 +09:00
</div>
<div class="image"><img src="/assets/about/drive.png" alt=""></div>
</section>
</section>
<p v-html="this.$t('@.intro.outro')"></p>
2018-09-08 15:11:12 +09:00
</article>
</modal>
2018-09-01 15:38:03 +09:00
2018-09-27 23:55:05 +09:00
<modal name="signup" class="modal" width="450px" height="auto" scrollable>
<header class="formHeader">{{ $t('signup') }}</header>
2018-09-03 23:23:50 +09:00
<mk-signup class="form"/>
</modal>
2018-09-27 23:55:05 +09:00
<modal name="signin" class="modal" width="450px" height="auto" scrollable>
<header class="formHeader">{{ $t('signin') }}</header>
2018-09-03 23:23:50 +09:00
<mk-signin class="form"/>
2018-02-11 12:08:43 +09:00
</modal>
2018-02-10 14:56:33 +09:00
</div>
</template>
2018-02-10 16:22:14 +09:00
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
2018-08-19 21:07:18 +09:00
import { host, copyright } from '../../../config';
2018-09-06 21:31:15 +09:00
import { concat } from '../../../../../prelude/array';
2018-11-11 12:35:30 +09:00
import { toUnicode } from 'punycode';
2018-02-10 16:22:14 +09:00
export default Vue.extend({
i18n: i18n('desktop/views/pages/welcome.vue'),
2018-02-11 12:42:02 +09:00
data() {
return {
2018-09-07 20:21:25 +09:00
meta: null,
2018-06-15 19:56:18 +09:00
stats: null,
2018-09-20 17:21:16 +09:00
banner: null,
2018-06-15 19:56:18 +09:00
copyright,
2018-11-11 12:35:30 +09:00
host: toUnicode(host),
2018-08-19 21:07:18 +09:00
name: 'Misskey',
description: '',
2018-09-06 04:52:42 +09:00
announcements: [],
2018-09-05 21:51:31 +09:00
photos: []
2018-02-11 12:42:02 +09:00
};
},
2018-09-06 04:28:39 +09:00
2018-06-15 19:56:18 +09:00
created() {
2018-11-09 08:13:34 +09:00
this.$root.getMeta().then(meta => {
2018-09-07 20:21:25 +09:00
this.meta = meta;
2018-08-19 21:07:18 +09:00
this.name = meta.name;
this.description = meta.description;
2018-09-06 04:52:42 +09:00
this.announcements = meta.broadcasts;
2018-09-20 17:21:16 +09:00
this.banner = meta.bannerUrl;
2018-08-19 21:07:18 +09:00
});
2018-11-09 08:13:34 +09:00
this.$root.api('stats').then(stats => {
2018-06-15 19:56:18 +09:00
this.stats = stats;
});
2018-09-06 04:28:39 +09:00
const image = [
'image/jpeg',
'image/png',
'image/gif'
];
2018-11-09 08:13:34 +09:00
this.$root.api('notes/local-timeline', {
2018-09-06 04:28:39 +09:00
fileType: image,
2018-09-25 21:09:38 +09:00
excludeNsfw: true,
2018-09-06 04:28:39 +09:00
limit: 6
2018-09-06 21:31:15 +09:00
}).then((notes: any[]) => {
const files = concat(notes.map((n: any): any[] => n.files));
2018-09-06 04:28:39 +09:00
this.photos = files.filter(f => image.includes(f.type)).slice(0, 6);
});
2018-06-15 19:56:18 +09:00
},
2018-09-06 04:28:39 +09:00
2018-02-10 16:22:14 +09:00
methods: {
2018-09-08 15:11:12 +09:00
about() {
this.$modal.show('about');
},
2018-02-10 16:22:14 +09:00
signup() {
2018-09-01 20:47:49 +09:00
this.$modal.show('signup');
2018-02-11 12:08:43 +09:00
},
2018-09-06 04:28:39 +09:00
2018-02-11 12:08:43 +09:00
signin() {
2018-09-01 20:47:49 +09:00
this.$modal.show('signin');
2018-05-23 15:48:41 +09:00
},
2018-09-06 04:28:39 +09:00
2018-05-23 15:48:41 +09:00
dark() {
2018-05-25 15:06:35 +09:00
this.$store.commit('device/set', {
key: 'darkmode',
value: !this.$store.state.device.darkmode
});
2018-02-10 16:22:14 +09:00
}
2018-02-10 14:56:33 +09:00
}
2018-02-10 16:22:14 +09:00
});
</script>
2018-09-03 23:23:50 +09:00
<style lang="stylus">
#wait
right auto
left 15px
.v--modal-overlay
2018-09-04 02:09:56 +09:00
background rgba(0, 0, 0, 0.6)
2018-09-03 23:23:50 +09:00
2018-09-27 23:55:05 +09:00
.modal
2018-09-03 23:23:50 +09:00
.form
padding 24px 48px 48px 48px
.formHeader
text-align center
padding 48px 0 12px 0
margin 0 48px
font-size 1.5em
2018-09-27 23:55:05 +09:00
.v--modal-box
background var(--face)
color var(--text)
.formHeader
border-bottom solid 1px rgba(#000, 0.2)
2018-09-08 15:11:12 +09:00
.v--modal-overlay.about
.v--modal-box.v--modal
margin 32px 0
.fpdezooorhntlzyeszemrsqdlgbysvxq
padding 64px
> p:last-child
margin-bottom 0
> h1
margin-top 0
> section
> h2
2018-09-28 00:51:17 +09:00
border-bottom 1px solid var(--faceDivider)
2018-09-08 15:11:12 +09:00
> section
display grid
grid-template-rows 1fr
grid-template-columns 180px 1fr
gap 32px
margin-bottom 32px
padding-bottom 32px
2018-09-28 00:51:17 +09:00
border-bottom 1px solid var(--faceDivider)
2018-09-08 15:11:12 +09:00
&:nth-child(odd)
grid-template-columns 1fr 180px
> .body
grid-column 1
> .image
grid-column 2
> .body
grid-row 1
grid-column 2
> .image
grid-row 1
grid-column 1
> img
display block
width 100%
height 100%
object-fit cover
2018-02-10 14:56:33 +09:00
</style>
<style lang="stylus" scoped>
2018-09-27 23:55:05 +09:00
.mk-welcome
2018-06-15 19:56:18 +09:00
display flex
2018-06-07 00:53:31 +09:00
min-height 100vh
2018-06-15 19:56:18 +09:00
2018-09-20 17:21:16 +09:00
> .banner
position absolute
top 0
left 0
width 100%
height 400px
background-position center
background-size cover
opacity 0.7
&:after
content ""
display block
position absolute
bottom 0
left 0
width 100%
height 100px
2018-09-27 23:55:05 +09:00
background linear-gradient(transparent, var(--bg))
2018-09-20 17:21:16 +09:00
2018-09-03 23:23:50 +09:00
> .forkit
2018-06-15 19:56:18 +09:00
position absolute
top 0
right 0
2018-03-17 17:47:46 +09:00
2018-05-23 15:48:41 +09:00
> button
2018-05-28 21:31:20 +09:00
position fixed
2018-05-23 15:48:41 +09:00
z-index 1
2018-09-04 02:09:56 +09:00
bottom 16px
left 16px
2018-05-23 15:48:41 +09:00
padding 16px
font-size 18px
2018-09-27 23:55:05 +09:00
color var(--text)
2018-06-15 19:56:18 +09:00
2018-09-08 15:11:12 +09:00
> main
2018-09-03 23:23:50 +09:00
margin 0 auto
padding 64px
2018-09-08 15:11:12 +09:00
width 100%
max-width 1200px
2018-09-03 23:23:50 +09:00
2018-09-04 02:09:56 +09:00
.block
2018-09-27 23:55:05 +09:00
color var(--text)
2018-09-26 20:28:13 +09:00
background var(--face)
2018-09-22 20:39:12 +09:00
box-shadow var(--shadow)
2018-09-03 23:23:50 +09:00
//border-radius 8px
overflow auto
2018-09-05 21:51:31 +09:00
> header
2018-09-06 04:38:07 +09:00
z-index 1
2018-09-05 21:51:31 +09:00
padding 0 16px
line-height 48px
2018-09-26 20:28:13 +09:00
background var(--faceHeader)
2018-09-27 23:55:05 +09:00
box-shadow 0 1px 0px rgba(0, 0, 0, 0.1)
2018-09-06 04:38:07 +09:00
2018-09-05 21:51:31 +09:00
& + div
max-height calc(100% - 48px)
> div
overflow auto
2018-09-08 15:11:12 +09:00
> .body
display grid
2018-09-08 23:16:02 +09:00
grid-template-rows 390px 1fr 256px 64px
2018-09-08 15:11:12 +09:00
grid-template-columns 1fr 1fr 350px
gap 16px
2018-09-08 23:16:02 +09:00
height 1150px
2018-09-03 23:23:50 +09:00
2018-09-08 15:11:12 +09:00
> .main
grid-row 1
grid-column 1 / 3
2018-06-15 19:56:18 +09:00
2018-09-08 15:11:12 +09:00
> div
padding 32px
min-height 100%
2018-09-08 15:11:12 +09:00
> h1
margin 0
2018-09-28 00:48:17 +09:00
> svg
2018-09-08 15:11:12 +09:00
margin -8px 0 0 -16px
2018-09-28 00:48:17 +09:00
width 280px
height 100px
fill currentColor
2018-09-08 15:11:12 +09:00
> .info
margin 0 auto 16px auto
width $width
font-size 14px
2018-06-15 19:56:18 +09:00
2018-09-08 15:11:12 +09:00
> .stats
margin-left 16px
padding-left 16px
2018-09-27 23:55:05 +09:00
border-left solid 1px var(--faceDivider)
2018-06-15 19:56:18 +09:00
2018-09-08 15:11:12 +09:00
> *
margin-right 16px
2018-06-15 19:56:18 +09:00
2018-09-08 23:16:02 +09:00
> .desc
max-width calc(100% - 150px)
2018-09-08 15:11:12 +09:00
> .sign
font-size 120%
2018-09-08 23:16:02 +09:00
margin-bottom 0
2018-06-15 19:56:18 +09:00
2018-09-08 15:11:12 +09:00
> .divider
margin 0 16px
2018-06-16 07:31:35 +09:00
2018-09-08 15:11:12 +09:00
> .signin
> .signup
cursor pointer
2018-06-16 07:31:35 +09:00
2018-09-08 15:11:12 +09:00
&:hover
2018-09-26 20:19:35 +09:00
color var(--primary)
2018-09-07 01:18:47 +09:00
2018-09-08 15:11:12 +09:00
> .char
display block
position absolute
right 16px
2018-09-08 23:16:02 +09:00
bottom 0
height 320px
opacity 0.7
2018-09-07 01:18:47 +09:00
2018-09-08 15:11:12 +09:00
> *:not(.char)
z-index 1
2018-09-03 23:23:50 +09:00
2018-09-08 15:11:12 +09:00
> .announcements
grid-row 2
grid-column 1
2018-09-03 23:23:50 +09:00
2018-09-05 21:51:31 +09:00
> div
2018-09-08 15:11:12 +09:00
padding 32px
2018-09-05 21:51:31 +09:00
2018-09-08 15:11:12 +09:00
> div
padding 0 0 16px 0
margin 0 0 16px 0
2018-09-27 23:55:05 +09:00
border-bottom 1px solid var(--faceDivider)
2018-09-05 21:51:31 +09:00
2018-09-08 15:11:12 +09:00
> h1
margin 0
font-size 1.25em
2018-09-03 23:23:50 +09:00
2018-09-08 15:11:12 +09:00
> .photos
grid-row 2
grid-column 2
2018-09-06 04:28:39 +09:00
> div
2018-09-08 15:11:12 +09:00
display grid
grid-template-rows 1fr 1fr 1fr
grid-template-columns 1fr 1fr
gap 8px
height 100%
padding 16px
2018-09-04 02:09:56 +09:00
2018-09-08 15:11:12 +09:00
> div
//border-radius 4px
background-position center center
background-size cover
2018-02-10 14:56:33 +09:00
2018-09-08 15:11:12 +09:00
> .tag-cloud
2018-09-07 20:21:25 +09:00
grid-row 3
2018-09-08 15:11:12 +09:00
grid-column 1 / 3
2018-09-07 20:21:25 +09:00
> div
2018-09-08 15:11:12 +09:00
height 256px
padding 32px
> .nav
display flex
justify-content center
align-items center
grid-row 4
grid-column 1 / 3
font-size 14px
> .side
display grid
grid-row 1 / 5
grid-column 3
grid-template-rows 1fr 350px
grid-template-columns 1fr
gap 16px
> .tl
grid-row 1
grid-column 1
overflow auto
> .trends
grid-row 2
grid-column 1
padding 8px
2018-09-07 20:21:25 +09:00
2018-09-08 15:11:12 +09:00
> .info
grid-row 3
grid-column 1
> div
padding 16px
> .body
> p
display block
margin 0
2018-09-07 20:21:25 +09:00
2018-02-10 14:56:33 +09:00
</style>