diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-03-17 03:33:36 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-03-17 03:33:36 +0900 |
| commit | 128b56da28f40d8d398ebb2f08dff47c51385063 (patch) | |
| tree | a2d57a51280fb5b7d445463cfb498ff1920461db /src/web/app | |
| parent | v4182 (diff) | |
| download | sharkey-128b56da28f40d8d398ebb2f08dff47c51385063.tar.gz sharkey-128b56da28f40d8d398ebb2f08dff47c51385063.tar.bz2 sharkey-128b56da28f40d8d398ebb2f08dff47c51385063.zip | |
:v:
Diffstat (limited to 'src/web/app')
| -rw-r--r-- | src/web/app/common/views/components/index.ts | 2 | ||||
| -rw-r--r-- | src/web/app/common/views/components/welcome-timeline.vue | 115 | ||||
| -rw-r--r-- | src/web/app/desktop/views/pages/welcome.vue | 127 | ||||
| -rw-r--r-- | src/web/app/mobile/views/pages/welcome.vue | 48 |
4 files changed, 234 insertions, 58 deletions
diff --git a/src/web/app/common/views/components/index.ts b/src/web/app/common/views/components/index.ts index 25f4e461df..fbf9d22a0b 100644 --- a/src/web/app/common/views/components/index.ts +++ b/src/web/app/common/views/components/index.ts @@ -23,6 +23,7 @@ import twitterSetting from './twitter-setting.vue'; import fileTypeIcon from './file-type-icon.vue'; import Switch from './switch.vue'; import Othello from './othello.vue'; +import welcomeTimeline from './welcome-timeline.vue'; Vue.component('mk-signin', signin); Vue.component('mk-signup', signup); @@ -47,3 +48,4 @@ Vue.component('mk-twitter-setting', twitterSetting); Vue.component('mk-file-type-icon', fileTypeIcon); Vue.component('mk-switch', Switch); Vue.component('mk-othello', Othello); +Vue.component('mk-welcome-timeline', welcomeTimeline); diff --git a/src/web/app/common/views/components/welcome-timeline.vue b/src/web/app/common/views/components/welcome-timeline.vue new file mode 100644 index 0000000000..ab402f126a --- /dev/null +++ b/src/web/app/common/views/components/welcome-timeline.vue @@ -0,0 +1,115 @@ +<template> +<div class="mk-welcome-timeline"> + <div v-for="post in posts"> + <router-link class="avatar-anchor" :to="`/${post.user.username}`"> + <img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=96`" alt="avatar"/> + </router-link> + <div class="body"> + <header> + <router-link class="name" :to="`/${post.user.username}`">{{ post.user.name }}</router-link> + <span class="username">@{{ post.user.username }}</span> + <div class="info"> + <router-link class="created-at" :to="`/${post.user.username}/${post.id}`"> + <mk-time :time="post.created_at"/> + </router-link> + </div> + </header> + <div class="text"> + <mk-post-html :ast="post.ast"/> + </div> + </div> + </div> +</div> +</template> + +<script lang="ts"> +import Vue from 'vue'; + +export default Vue.extend({ + data() { + return { + fetching: true, + posts: [] + }; + }, + mounted() { + this.fetch(); + }, + methods: { + fetch(cb?) { + this.fetching = true; + (this as any).api('posts', { + reply: false, + repost: false, + media: false, + poll: false, + bot: false + }).then(posts => { + this.posts = posts; + this.fetching = false; + }); + } + } +}); +</script> + +<style lang="stylus" scoped> +.mk-welcome-timeline + background #fff + + > div + padding 16px + overflow-wrap break-word + font-size .9em + color #4C4C4C + border-bottom 1px solid rgba(0, 0, 0, 0.05) + + &:after + content "" + display block + clear both + + > .avatar-anchor + display block + float left + position -webkit-sticky + position sticky + top 16px + + > img + display block + width 36px + height 36px + border-radius 6px + + > .body + float right + width calc(100% - 36px) + padding-left 8px + + > header + display flex + align-items center + margin-bottom 4px + white-space nowrap + + > .name + display block + margin 0 .5em 0 0 + padding 0 + overflow hidden + font-weight bold + text-overflow ellipsis + + > .username + margin 0 .5em 0 0 + color #ccc + + > .info + margin-left auto + font-size 0.9em + + > .created-at + color #c0c0c0 + +</style> diff --git a/src/web/app/desktop/views/pages/welcome.vue b/src/web/app/desktop/views/pages/welcome.vue index 9f69305204..53ea99598d 100644 --- a/src/web/app/desktop/views/pages/welcome.vue +++ b/src/web/app/desktop/views/pages/welcome.vue @@ -1,13 +1,20 @@ <template> <div class="mk-welcome"> <main> - <div> - <h1>Share<br>Everything!</h1> - <p>ようこそ! <b>Misskey</b>はTwitter風ミニブログSNSです――思ったこと、共有したいことをシンプルに書き残せます。タイムラインを見れば、皆の反応や皆がどう思っているのかもすぐにわかります。<a>詳しく...</a></p> - <p><button class="signup" @click="signup">はじめる</button><button class="signin" @click="signin">ログイン</button></p> - </div> - <div> - + <div class="top"> + <div> + <div> + <h1>Share<br>Everything!</h1> + <p>ようこそ! <b>Misskey</b>はTwitter風ミニブログSNSです。思ったことや皆と共有したいことを投稿しましょう。タイムラインを見れば、皆の関心事をすぐにチェックすることもできます。<a>詳しく...</a></p> + <p><button class="signup" @click="signup">はじめる</button><button class="signin" @click="signin">ログイン</button></p> + </div> + <div> + <div> + <header>%fa:comments R% タイムライン</header> + <mk-welcome-timeline/> + </div> + </div> + </div> </div> </main> <mk-forkit/> @@ -69,61 +76,85 @@ export default Vue.extend({ > main display flex flex 1 - max-width $width - margin 0 auto - padding 80px 0 0 0 - > div:first-child - margin 0 auto 0 0 - width calc(100% - 500px) - color #777 + > .top + display flex + width 100% + background-image url('/assets/welcome.svg') + background-size cover + background-position top center + + > div + display flex + max-width $width + margin 0 auto + padding 80px 0 0 0 - > h1 - margin 0 - font-weight normal - font-variant small-caps - letter-spacing 12px + > div:first-child + margin 0 48px 0 0 + color #777 - > p - margin 0.5em 0 - line-height 2em + > h1 + margin 0 + font-weight normal + font-variant small-caps + letter-spacing 12px - button - padding 8px 16px - font-size inherit + > p + margin 0.5em 0 + line-height 2em - .signup - color $theme-color - border solid 2px $theme-color - border-radius 4px + button + padding 8px 16px + font-size inherit - &:focus - box-shadow 0 0 0 3px rgba($theme-color, 0.2) + .signup + color $theme-color + border solid 2px $theme-color + border-radius 4px - &:hover - color $theme-color-foreground - background $theme-color + &:focus + box-shadow 0 0 0 3px rgba($theme-color, 0.2) - &:active - color $theme-color-foreground - background darken($theme-color, 10%) - border-color darken($theme-color, 10%) + &:hover + color $theme-color-foreground + background $theme-color - .signin - &:focus - color #444 + &:active + color $theme-color-foreground + background darken($theme-color, 10%) + border-color darken($theme-color, 10%) - &:hover - color #444 + .signin + &:focus + color #444 - &:active - color #333 + &:hover + color #444 - > div:last-child - margin 0 0 0 auto + &:active + color #333 + + > div:last-child + + > div + width 410px + background #fff + border-radius 8px + overflow hidden + + > header + z-index 1 + padding 12px 16px + color #888d94 + box-shadow 0 1px 0px rgba(0, 0, 0, 0.1) + + > .mk-welcome-timeline + max-height 350px + overflow auto > footer - color #666 + color #949ea5 background #fff > div diff --git a/src/web/app/mobile/views/pages/welcome.vue b/src/web/app/mobile/views/pages/welcome.vue index 84e5ae5507..cb8756f3b6 100644 --- a/src/web/app/mobile/views/pages/welcome.vue +++ b/src/web/app/mobile/views/pages/welcome.vue @@ -1,9 +1,9 @@ <template> <div class="welcome"> <h1><b>Misskey</b>へようこそ</h1> - <p>Twitter風ミニブログSNS、Misskeyへようこそ。思ったことを投稿したり、タイムラインでみんなの投稿を読むこともできます。</p> + <p>Twitter風ミニブログSNS、Misskeyへようこそ。思ったことを投稿したり、タイムラインでみんなの投稿を読むこともできます。<a href="/signup">アカウントを作成する</a></p> <div class="form"> - <p>ログイン</p> + <p>%fa:lock% ログイン</p> <div> <form @submit.prevent="onSubmit"> <input v-model="username" type="text" pattern="^[a-zA-Z0-9-]+$" placeholder="ユーザー名" autofocus required @change="onUsernameChange"/> @@ -16,13 +16,19 @@ </div> </div> </div> - <a href="/signup">アカウントを作成する</a> + <div class="tl"> + <p>%fa:comments R% タイムラインを見てみる</p> + <mk-welcome-timeline/> + </div> + <footer> + <small>{{ copyright }}</small> + </footer> </div> </template> <script lang="ts"> import Vue from 'vue'; -import { apiUrl } from '../../../config'; +import { apiUrl, copyright } from '../../../config'; export default Vue.extend({ data() { @@ -32,7 +38,8 @@ export default Vue.extend({ username: '', password: '', token: '', - apiUrl + apiUrl, + copyright }; }, mounted() { @@ -83,16 +90,12 @@ export default Vue.extend({ color #949fa9 .form + margin-bottom 16px background #fff border solid 1px rgba(0, 0, 0, 0.2) border-radius 8px overflow hidden - & + a - display block - margin-top 16px - text-align center - > p margin 0 padding 12px 20px @@ -143,4 +146,29 @@ export default Vue.extend({ padding 16px text-align center + .tl + background #fff + border solid 1px rgba(0, 0, 0, 0.2) + border-radius 8px + overflow hidden + + > p + margin 0 + padding 12px 20px + color #555 + background #f5f5f5 + border-bottom solid 1px #ddd + + > .mk-welcome-timeline + max-height 300px + overflow auto + + > footer + text-align center + color #949fa9 + + > small + display block + margin 16px 0 0 0 + </style> |