Improve welcome page

This commit is contained in:
syuilo 2018-09-06 04:28:39 +09:00
parent e2c6227f47
commit 451acb77df
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 33 additions and 2 deletions

View file

@ -990,6 +990,8 @@ desktop/views/pages/welcome.vue:
signin-button: "やってる" signin-button: "やってる"
signup-button: "やる" signup-button: "やる"
timeline: "タイムライン" timeline: "タイムライン"
announcements: "お知らせ"
photos: "最近の画像"
powered-by-misskey: "Powered by <b>Misskey</b>." powered-by-misskey: "Powered by <b>Misskey</b>."
desktop/views/pages/drive.vue: desktop/views/pages/drive.vue:

View file

@ -44,8 +44,7 @@
<div class="photos block"> <div class="photos block">
<header>%fa:images% %i18n:@photos%</header> <header>%fa:images% %i18n:@photos%</header>
<div> <div>
<div v-for="photo in photos"> <div v-for="photo in photos" :style="`background-image: url(${photo.thumbnailUrl})`"></div>
</div>
</div> </div>
</div> </div>
@ -99,6 +98,7 @@ export default Vue.extend({
photos: [] photos: []
}; };
}, },
created() { created() {
(this as any).os.getMeta().then(meta => { (this as any).os.getMeta().then(meta => {
this.name = meta.name; this.name = meta.name;
@ -110,14 +110,30 @@ export default Vue.extend({
this.stats = stats; this.stats = stats;
}); });
const image = [
'image/jpeg',
'image/png',
'image/gif'
];
(this as any).api('notes/local-timeline', {
fileType: image,
limit: 6
}).then(notes => {
const files = [].concat(...notes.map(n => n.files));
this.photos = files.filter(f => image.includes(f.type)).slice(0, 6);
});
}, },
methods: { methods: {
signup() { signup() {
this.$modal.show('signup'); this.$modal.show('signup');
}, },
signin() { signin() {
this.$modal.show('signin'); this.$modal.show('signin');
}, },
dark() { dark() {
this.$store.commit('device/set', { this.$store.commit('device/set', {
key: 'darkmode', key: 'darkmode',
@ -280,6 +296,19 @@ root(isDark)
grid-row 2 grid-row 2
grid-column 2 grid-column 2
> div
display grid
grid-template-rows 1fr 1fr 1fr
grid-template-columns 1fr 1fr
gap 8px
height 100%
padding 16px
> div
//border-radius 4px
background-position center center
background-size cover
> .nav > .nav
display flex display flex
justify-content center justify-content center