firefish/src/client/app/desktop/views/pages/welcome.vue
syuilo f0a29721c9
Use PostgreSQL instead of MongoDB (#4572)
* wip

* Update note.ts

* Update timeline.ts

* Update core.ts

* wip

* Update generate-visibility-query.ts

* wip

* wip

* wip

* wip

* wip

* Update global-timeline.ts

* wip

* wip

* wip

* Update vote.ts

* wip

* wip

* Update create.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update files.ts

* wip

* wip

* Update CONTRIBUTING.md

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update read-notification.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update cancel.ts

* wip

* wip

* wip

* Update show.ts

* wip

* wip

* Update gen-id.ts

* Update create.ts

* Update id.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Docker: Update files about Docker (#4599)

* Docker: Use cache if files used by `yarn install` was not updated

This patch reduces the number of times to installing node_modules.
For example, `yarn install` step will be skipped when only ".config/default.yml" is updated.

* Docker: Migrate MongoDB to Postgresql

Misskey uses Postgresql as a database instead of Mongodb since version 11.

* Docker: Uncomment about data persistence

This patch will save a lot of databases.

* wip

* wip

* wip

* Update activitypub.ts

* wip

* wip

* wip

* Update logs.ts

* wip

* Update drive-file.ts

* Update register.ts

* wip

* wip

* Update mentions.ts

* wip

* wip

* wip

* Update recommendation.ts

* wip

* Update index.ts

* wip

* Update recommendation.ts

* Doc: Update docker.ja.md and docker.en.md (#1) (#4608)

Update how to set up misskey.

* wip

* ✌️

* wip

* Update note.ts

* Update postgre.ts

* wip

* wip

* wip

* wip

* Update add-file.ts

* wip

* wip

* wip

* Clean up

* Update logs.ts

* wip

* 🍕

* wip

* Ad notes

* wip

* Update api-visibility.ts

* Update note.ts

* Update add-file.ts

* tests

* tests

* Update postgre.ts

* Update utils.ts

* wip

* wip

* Refactor

* wip

* Refactor

* wip

* wip

* Update show-users.ts

* Update update-instance.ts

* wip

* Update feed.ts

* Update outbox.ts

* Update outbox.ts

* Update user.ts

* wip

* Update list.ts

* Update update-hashtag.ts

* wip

* Update update-hashtag.ts

* Refactor

* Update update.ts

* wip

* wip

* ✌️

* clean up

* docs

* Update push.ts

* wip

* Update api.ts

* wip

* ✌️

* Update make-pagination-query.ts

* ✌️

* Delete hashtags.ts

* Update instances.ts

* Update instances.ts

* Update create.ts

* Update search.ts

* Update reversi-game.ts

* Update signup.ts

* Update user.ts

* id

* Update example.yml

* 🎨

* objectid

* fix

* reversi

* reversi

* Fix bug of chart engine

* Add test of chart engine

* Improve test

* Better testing

* Improve chart engine

* Refactor

* Add test of chart engine

* Refactor

* Add chart test

* Fix bug

* コミットし忘れ

* Refactoring

* ✌️

* Add tests

* Add test

* Extarct note tests

* Refactor

* 存在しないユーザーにメンションできなくなっていた問題を修正

* Fix bug

* Update update-meta.ts

* Fix bug

* Update mention.vue

* Fix bug

* Update meta.ts

* Update CONTRIBUTING.md

* Fix bug

* Fix bug

* Fix bug

* Clean up

* Clean up

* Update notification.ts

* Clean up

* Add mute tests

* Add test

* Refactor

* Add test

* Fix test

* Refactor

* Refactor

* Add tests

* Update utils.ts

* Update utils.ts

* Fix test

* Update package.json

* Update update.ts

* Update manifest.ts

* Fix bug

* Fix bug

* Add test

* 🎨

* Update endpoint permissions

* Updaye permisison

* Update person.ts

#4299

* データベースと同期しないように

* Fix bug

* Fix bug

* Update reversi-game.ts

* Use a feature of Node v11.7.0 to extract a public key (#4644)

* wip

* wip

* ✌️

* Refactoring

#1540

* test

* test

* test

* test

* test

* test

* test

* Fix bug

* Fix test

* 🍣

* wip

* #4471

* Add test for #4335

* Refactor

* Fix test

* Add tests

* 🕓

* Fix bug

* Add test

* Add test

* rename

* Fix bug
2019-04-07 21:50:36 +09:00

507 lines
9.9 KiB
Vue

<template>
<div class="mk-welcome">
<div class="banner" :style="{ backgroundImage: banner ? `url(${banner})` : null }"></div>
<button @click="dark">
<template v-if="$store.state.device.darkmode"><fa icon="moon"/></template>
<template v-else><fa :icon="['far', 'moon']"/></template>
</button>
<mk-forkit class="forkit"/>
<main>
<div class="body">
<div class="main block">
<div>
<h1 v-if="name != null">{{ name }}</h1>
<h1 v-else><img svg-inline src="../../../../assets/title.svg" alt="Misskey"></h1>
<div class="info">
<span><b>{{ host }}</b> - <span v-html="$t('powered-by-misskey')"></span></span>
<span class="stats" v-if="stats">
<span><fa icon="user"/> {{ stats.originalUsersCount | number }}</span>
<span><fa icon="pencil-alt"/> {{ stats.originalNotesCount | number }}</span>
</span>
</div>
<div class="desc">
<span class="desc" v-html="description || $t('@.about')"></span>
<a class="about" @click="about">{{ $t('about') }}</a>
</div>
<p class="sign">
<span class="signup" @click="signup">{{ $t('@.signup') }}</span>
<span class="divider">|</span>
<span class="signin" @click="signin">{{ $t('@.signin') }}</span>
</p>
<img v-if="meta" :src="meta.mascotImageUrl" alt="" title="藍" class="char">
</div>
</div>
<div class="announcements block">
<header><fa icon="broadcast-tower"/> {{ $t('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>
</div>
<div class="photos block">
<header><fa :icon="['far', 'images']"/> {{ $t('photos') }}</header>
<div>
<div v-for="photo in photos" :style="`background-image: url(${photo.thumbnailUrl})`"></div>
</div>
</div>
<div class="tag-cloud block">
<div>
<mk-tag-cloud/>
</div>
</div>
<div class="nav block">
<div>
<mk-nav class="nav"/>
</div>
</div>
<div class="side">
<div class="trends block">
<div>
<mk-trends/>
</div>
</div>
<div class="tl block">
<header><fa :icon="['far', 'comment-alt']"/> {{ $t('timeline') }}</header>
<div>
<mk-welcome-timeline class="tl" :max="20"/>
</div>
</div>
<div class="info block">
<header><fa icon="info-circle"/> {{ $t('info') }}</header>
<div>
<div v-if="meta" class="body">
<p>Version: <b>{{ meta.version }}</b></p>
<p>Maintainer: <b><a :href="'mailto:' + meta.maintainerEmail" target="_blank">{{ meta.maintainerName }}</a></b></p>
</div>
</div>
</div>
</div>
</div>
</main>
<modal name="about" class="about modal" width="800px" height="auto" scrollable>
<article class="fpdezooorhntlzyeszemrsqdlgbysvxq">
<h1>{{ $t('@.intro.title') }}</h1>
<p v-html="this.$t('@.intro.about')"></p>
<section>
<h2>{{ $t('@.intro.features') }}</h2>
<section>
<div class="body">
<h3>{{ $t('@.intro.rich-contents') }}</h3>
<p v-html="this.$t('@.intro.rich-contents-desc')"></p>
</div>
<div class="image"><img src="/assets/about/post.png" alt=""></div>
</section>
<section>
<div class="body">
<h3>{{ $t('@.intro.reaction') }}</h3>
<p v-html="this.$t('@.intro.reaction-desc')"></p>
</div>
<div class="image"><img src="/assets/about/reaction.png" alt=""></div>
</section>
<section>
<div class="body">
<h3>{{ $t('@.intro.ui') }}</h3>
<p v-html="this.$t('@.intro.ui-desc')"></p>
</div>
<div class="image"><img src="/assets/about/ui.png" alt=""></div>
</section>
<section>
<div class="body">
<h3>{{ $t('@.intro.drive') }}</h3>
<p v-html="this.$t('@.intro.drive-desc')"></p>
</div>
<div class="image"><img src="/assets/about/drive.png" alt=""></div>
</section>
</section>
<p v-html="this.$t('@.intro.outro')"></p>
</article>
</modal>
<modal name="signup" class="modal" width="450px" height="auto" scrollable>
<header class="formHeader">{{ $t('@.signup') }}</header>
<mk-signup class="form"/>
</modal>
<modal name="signin" class="modal" width="450px" height="auto" scrollable>
<header class="formHeader">{{ $t('@.signin') }}</header>
<mk-signin class="form"/>
</modal>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
import { host, copyright } from '../../../config';
import { concat } from '../../../../../prelude/array';
import { toUnicode } from 'punycode';
export default Vue.extend({
i18n: i18n('desktop/views/pages/welcome.vue'),
data() {
return {
meta: null,
stats: null,
banner: null,
copyright,
host: toUnicode(host),
name: null,
description: '',
announcements: [],
photos: []
};
},
created() {
this.$root.getMeta().then(meta => {
this.meta = meta;
this.name = meta.name;
this.description = meta.description;
this.announcements = meta.announcements;
this.banner = meta.bannerUrl;
});
this.$root.api('stats').then(stats => {
this.stats = stats;
});
const image = [
'image/jpeg',
'image/png',
'image/gif'
];
this.$root.api('notes/local-timeline', {
fileType: image,
excludeNsfw: true,
limit: 6
}).then((notes: any[]) => {
const files = concat(notes.map((n: any): any[] => n.files));
this.photos = files.filter(f => image.includes(f.type)).slice(0, 6);
});
},
methods: {
about() {
this.$modal.show('about');
},
signup() {
this.$modal.show('signup');
},
signin() {
this.$modal.show('signin');
},
dark() {
this.$store.commit('device/set', {
key: 'darkmode',
value: !this.$store.state.device.darkmode
});
}
}
});
</script>
<style lang="stylus">
#wait
right auto
left 15px
.v--modal-overlay
background rgba(0, 0, 0, 0.6)
.modal
.form
padding 24px 48px 48px 48px
.formHeader
text-align center
padding 48px 0 12px 0
margin 0 48px
font-size 1.5em
.v--modal-box
background var(--face)
color var(--text)
.formHeader
border-bottom solid 1px rgba(#000, 0.2)
.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 var(--faceDivider)
> section
display grid
grid-template-rows 1fr
grid-template-columns 180px 1fr
gap 32px
margin-bottom 32px
padding-bottom 32px
border-bottom 1px solid var(--faceDivider)
&: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
</style>
<style lang="stylus" scoped>
.mk-welcome
display flex
min-height 100vh
> .banner
position absolute
top 0
left 0
width 100%
height 400px
background-position center
background-size cover
opacity 0.7
&:after
content ""
display block
position absolute
bottom 0
left 0
width 100%
height 100px
background linear-gradient(transparent, var(--bg))
> .forkit
position absolute
top 0
right 0
> button
position fixed
z-index 1
bottom 16px
left 16px
padding 16px
font-size 18px
color var(--text)
> main
margin 0 auto
padding 64px
width 100%
max-width 1200px
.block
color var(--text)
background var(--face)
overflow auto
> header
z-index 1
padding 0 16px
line-height 48px
background var(--faceHeader)
box-shadow 0 1px 0px rgba(0, 0, 0, 0.1)
& + div
max-height calc(100% - 48px)
> div
overflow auto
> .body
display grid
grid-template-rows 390px 1fr 256px 64px
grid-template-columns 1fr 1fr 350px
gap 16px
height 1150px
> .main
grid-row 1
grid-column 1 / 3
> div
padding 32px
min-height 100%
> h1
margin 0
> svg
margin -8px 0 0 -16px
width 280px
height 100px
fill currentColor
> .info
margin 0 auto 16px auto
width $width
font-size 14px
> .stats
margin-left 16px
padding-left 16px
border-left solid 1px var(--faceDivider)
> *
margin-right 16px
> .desc
max-width calc(100% - 150px)
> .sign
font-size 120%
margin-bottom 0
> .divider
margin 0 16px
> .signin
> .signup
cursor pointer
&:hover
color var(--primary)
> .char
display block
position absolute
right 16px
bottom 0
height 320px
opacity 0.7
> *:not(.char)
z-index 1
> .announcements
grid-row 2
grid-column 1
> div
padding 32px
> div
padding 0 0 16px 0
margin 0 0 16px 0
border-bottom 1px solid var(--faceDivider)
> h1
margin 0
font-size 1.25em
> .photos
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
> .tag-cloud
grid-row 3
grid-column 1 / 3
> div
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
> .info
grid-row 3
grid-column 1
> div
padding 16px
> .body
> p
display block
margin 0
</style>