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

503 lines
9.9 KiB
Vue
Raw Normal View History

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