Improve welcome page

This commit is contained in:
syuilo 2018-09-07 20:41:12 +09:00
parent 8b3a0a524b
commit 9e3abb9989
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
1 changed files with 18 additions and 14 deletions

View File

@ -15,7 +15,7 @@
<mk-welcome-timeline/> <mk-welcome-timeline/>
</div> </div>
<div class="hashtags"> <div class="hashtags">
<router-link v-for="tag in tags" :key="tag" :to="`/tags/${ tag }`" :title="tag">#{{ tag }}</router-link> <mk-tag-cloud/>
</div> </div>
<div class="photos"> <div class="photos">
<div v-for="photo in photos" :style="`background-image: url(${photo.thumbnailUrl})`"></div> <div v-for="photo in photos" :style="`background-image: url(${photo.thumbnailUrl})`"></div>
@ -30,6 +30,10 @@
<div v-html="announcement.text"></div> <div v-html="announcement.text"></div>
</article> </article>
</div> </div>
<div class="info" v-if="meta">
<p>Version: <b>{{ meta.version }}</b></p>
<p>Maintainer: <b><a :href="meta.maintainer.url" target="_blank">{{ meta.maintainer.name }}</a></b></p>
</div>
<footer> <footer>
<small>{{ copyright }}</small> <small>{{ copyright }}</small>
</footer> </footer>
@ -39,25 +43,25 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import { apiUrl, copyright, host } from '../../../config'; import { copyright, host } from '../../../config';
import { concat } from '../../../../../prelude/array'; import { concat } from '../../../../../prelude/array';
export default Vue.extend({ export default Vue.extend({
data() { data() {
return { return {
apiUrl, meta: null,
copyright, copyright,
stats: null, stats: null,
host, host,
name: 'Misskey', name: 'Misskey',
description: '', description: '',
tags: [],
photos: [], photos: [],
announcements: [] announcements: []
}; };
}, },
created() { created() {
(this as any).os.getMeta().then(meta => { (this as any).os.getMeta().then(meta => {
this.meta = meta;
this.name = meta.name; this.name = meta.name;
this.description = meta.description; this.description = meta.description;
this.announcements = meta.broadcasts; this.announcements = meta.broadcasts;
@ -67,10 +71,6 @@ export default Vue.extend({
this.stats = stats; this.stats = stats;
}); });
(this as any).api('hashtags/trend').then(stats => {
this.tags = stats.map(x => x.tag);
});
const image = [ const image = [
'image/jpeg', 'image/jpeg',
'image/png', 'image/png',
@ -165,12 +165,8 @@ root(isDark)
-webkit-overflow-scrolling touch -webkit-overflow-scrolling touch
> .hashtags > .hashtags
padding 16px 0 padding 0 8px
border solid 2px #ddd height 200px
border-radius 8px
> *
margin 0 16px
> .photos > .photos
display grid display grid
@ -210,6 +206,14 @@ root(isDark)
> .title > .title
font-weight bold font-weight bold
> .info
padding 16px 0
border solid 2px #ddd
border-radius 8px
> *
margin 0 16px
> footer > footer
text-align center text-align center
color #444 color #444