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: "やってる"
signup-button: "やる"
timeline: "タイムライン"
announcements: "お知らせ"
photos: "最近の画像"
powered-by-misskey: "Powered by <b>Misskey</b>."
desktop/views/pages/drive.vue:

View file

@ -44,8 +44,7 @@
<div class="photos block">
<header>%fa:images% %i18n:@photos%</header>
<div>
<div v-for="photo in photos">
</div>
<div v-for="photo in photos" :style="`background-image: url(${photo.thumbnailUrl})`"></div>
</div>
</div>
@ -99,6 +98,7 @@ export default Vue.extend({
photos: []
};
},
created() {
(this as any).os.getMeta().then(meta => {
this.name = meta.name;
@ -110,14 +110,30 @@ export default Vue.extend({
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: {
signup() {
this.$modal.show('signup');
},
signin() {
this.$modal.show('signin');
},
dark() {
this.$store.commit('device/set', {
key: 'darkmode',
@ -280,6 +296,19 @@ root(isDark)
grid-row 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
display flex
justify-content center