summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/scripts/streaming/games/reversi/reversi-game.ts6
-rw-r--r--src/client/app/common/scripts/streaming/local-timeline.ts4
-rw-r--r--src/client/app/common/views/components/index.ts2
-rw-r--r--src/client/app/common/views/components/menu.vue22
-rw-r--r--src/client/app/common/views/components/signin.vue2
-rw-r--r--src/client/app/common/views/components/trends.chart.vue (renamed from src/client/app/common/views/widgets/hashtags.chart.vue)0
-rw-r--r--src/client/app/common/views/components/trends.vue105
-rw-r--r--src/client/app/common/views/components/url.vue9
-rw-r--r--src/client/app/common/views/components/welcome-timeline.vue30
-rw-r--r--src/client/app/common/views/pages/follow.vue2
-rw-r--r--src/client/app/common/views/widgets/broadcast.vue27
-rw-r--r--src/client/app/common/views/widgets/hashtags.vue94
-rw-r--r--src/client/app/desktop/views/components/follow-button.vue8
-rw-r--r--src/client/app/desktop/views/components/media-image.vue2
-rw-r--r--src/client/app/desktop/views/components/post-form.vue2
-rw-r--r--src/client/app/desktop/views/pages/admin/admin.announcements.vue41
-rw-r--r--src/client/app/desktop/views/pages/admin/admin.vue6
-rw-r--r--src/client/app/desktop/views/pages/welcome.vue324
-rw-r--r--src/client/app/mios.ts6
-rw-r--r--src/client/app/mobile/views/components/drive-file-chooser.vue19
-rw-r--r--src/client/app/mobile/views/components/follow-button.vue4
-rw-r--r--src/client/app/mobile/views/components/note.vue4
-rw-r--r--src/client/app/mobile/views/components/notify.vue28
23 files changed, 424 insertions, 323 deletions
diff --git a/src/client/app/common/scripts/streaming/games/reversi/reversi-game.ts b/src/client/app/common/scripts/streaming/games/reversi/reversi-game.ts
index e6b02fcfdb..adfa75ff3b 100644
--- a/src/client/app/common/scripts/streaming/games/reversi/reversi-game.ts
+++ b/src/client/app/common/scripts/streaming/games/reversi/reversi-game.ts
@@ -3,8 +3,10 @@ import MiOS from '../../../../../mios';
export class ReversiGameStream extends Stream {
constructor(os: MiOS, me, game) {
- super(os, 'games/reversi-game', {
- i: me ? me.token : null,
+ super(os, 'games/reversi-game', me ? {
+ i: me.token,
+ game: game.id
+ } : {
game: game.id
});
}
diff --git a/src/client/app/common/scripts/streaming/local-timeline.ts b/src/client/app/common/scripts/streaming/local-timeline.ts
index 2834262bdc..41c36aa14c 100644
--- a/src/client/app/common/scripts/streaming/local-timeline.ts
+++ b/src/client/app/common/scripts/streaming/local-timeline.ts
@@ -7,9 +7,9 @@ import MiOS from '../../../mios';
*/
export class LocalTimelineStream extends Stream {
constructor(os: MiOS, me) {
- super(os, 'local-timeline', {
+ super(os, 'local-timeline', me ? {
i: me.token
- });
+ } : {});
}
}
diff --git a/src/client/app/common/views/components/index.ts b/src/client/app/common/views/components/index.ts
index 422a3da050..4700b6269e 100644
--- a/src/client/app/common/views/components/index.ts
+++ b/src/client/app/common/views/components/index.ts
@@ -1,5 +1,6 @@
import Vue from 'vue';
+import trends from './trends.vue';
import analogClock from './analog-clock.vue';
import menu from './menu.vue';
import noteHeader from './note-header.vue';
@@ -40,6 +41,7 @@ import uiSelect from './ui/select.vue';
import formButton from './ui/form/button.vue';
import formRadio from './ui/form/radio.vue';
+Vue.component('mk-trends', trends);
Vue.component('mk-analog-clock', analogClock);
Vue.component('mk-menu', menu);
Vue.component('mk-note-header', noteHeader);
diff --git a/src/client/app/common/views/components/menu.vue b/src/client/app/common/views/components/menu.vue
index 9b16732b9a..e99bfcbd26 100644
--- a/src/client/app/common/views/components/menu.vue
+++ b/src/client/app/common/views/components/menu.vue
@@ -1,5 +1,5 @@
<template>
-<div class="mk-menu">
+<div class="onchrpzrvnoruiaenfcqvccjfuupzzwv">
<div class="backdrop" ref="backdrop" @click="close"></div>
<div class="popover" :class="{ hukidasi }" ref="popover">
<template v-for="item in items">
@@ -119,9 +119,10 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
-$border-color = rgba(27, 31, 35, 0.15)
+root(isDark)
+ $bg-color = isDark ? #2c303c : #fff
+ $border-color = rgba(27, 31, 35, 0.15)
-.mk-menu
position initial
> .backdrop
@@ -131,14 +132,14 @@ $border-color = rgba(27, 31, 35, 0.15)
z-index 10000
width 100%
height 100%
- background rgba(#000, 0.1)
+ background rgba(#000, isDark ? 0.5 : 0.1)
opacity 0
> .popover
position absolute
z-index 10001
padding 8px 0
- background #fff
+ background $bg-color
border 1px solid $border-color
border-radius 4px
box-shadow 0 3px 12px rgba(27, 31, 35, 0.15)
@@ -172,12 +173,13 @@ $border-color = rgba(27, 31, 35, 0.15)
border-top solid $balloon-size transparent
border-left solid $balloon-size transparent
border-right solid $balloon-size transparent
- border-bottom solid $balloon-size #fff
+ border-bottom solid $balloon-size $bg-color
> button
display block
padding 8px 16px
width 100%
+ color isDark ? #d6dce2 : #111
&:hover
color $theme-color-foreground
@@ -191,6 +193,12 @@ $border-color = rgba(27, 31, 35, 0.15)
> div
margin 8px 0
height 1px
- background #eee
+ background isDark ? #1c2023 : #eee
+
+.onchrpzrvnoruiaenfcqvccjfuupzzwv[data-darkmode]
+ root(true)
+
+.onchrpzrvnoruiaenfcqvccjfuupzzwv:not([data-darkmode])
+ root(false)
</style>
diff --git a/src/client/app/common/views/components/signin.vue b/src/client/app/common/views/components/signin.vue
index 5230ac371a..b1c6782e93 100644
--- a/src/client/app/common/views/components/signin.vue
+++ b/src/client/app/common/views/components/signin.vue
@@ -78,7 +78,7 @@ export default Vue.extend({
cursor wait !important
> .avatar
- margin 16px auto 0 auto
+ margin 0 auto 0 auto
width 64px
height 64px
background #ddd
diff --git a/src/client/app/common/views/widgets/hashtags.chart.vue b/src/client/app/common/views/components/trends.chart.vue
index 723a3947f8..723a3947f8 100644
--- a/src/client/app/common/views/widgets/hashtags.chart.vue
+++ b/src/client/app/common/views/components/trends.chart.vue
diff --git a/src/client/app/common/views/components/trends.vue b/src/client/app/common/views/components/trends.vue
new file mode 100644
index 0000000000..627edc3876
--- /dev/null
+++ b/src/client/app/common/views/components/trends.vue
@@ -0,0 +1,105 @@
+<template>
+<div class="csqvmxybqbycalfhkxvyfrgbrdalkaoc">
+ <p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
+ <p class="empty" v-else-if="stats.length == 0">%fa:exclamation-circle%%i18n:@empty%</p>
+ <!-- トランジションを有効にするとなぜかメモリリークする -->
+ <!-- <transition-group v-else tag="div" name="chart"> -->
+ <div>
+ <div v-for="stat in stats" :key="stat.tag">
+ <div class="tag">
+ <router-link :to="`/tags/${ encodeURIComponent(stat.tag) }`" :title="stat.tag">#{{ stat.tag }}</router-link>
+ <p>{{ '%i18n:@count%'.replace('{}', stat.usersCount) }}</p>
+ </div>
+ <x-chart class="chart" :src="stat.chart"/>
+ </div>
+ </div>
+ <!-- </transition-group> -->
+</div>
+</template>
+
+<script lang="ts">
+import Vue from 'vue';
+import XChart from './trends.chart.vue';
+
+export default Vue.extend({
+ components: {
+ XChart
+ },
+ data() {
+ return {
+ stats: [],
+ fetching: true,
+ clock: null
+ };
+ },
+ mounted() {
+ this.fetch();
+ this.clock = setInterval(this.fetch, 1000 * 60);
+ },
+ beforeDestroy() {
+ clearInterval(this.clock);
+ },
+ methods: {
+ fetch() {
+ (this as any).api('hashtags/trend').then(stats => {
+ this.stats = stats;
+ this.fetching = false;
+ });
+ }
+ }
+});
+</script>
+
+<style lang="stylus" scoped>
+root(isDark)
+ > .fetching
+ > .empty
+ margin 0
+ padding 16px
+ text-align center
+ color #aaa
+
+ > [data-fa]
+ margin-right 4px
+
+ > div
+ .chart-move
+ transition transform 1s ease
+
+ > div
+ display flex
+ align-items center
+ padding 14px 16px
+
+ &:not(:last-child)
+ border-bottom solid 1px isDark ? #393f4f : #eee
+
+ > .tag
+ flex 1
+ overflow hidden
+ font-size 14px
+ color isDark ? #9baec8 : #65727b
+
+ > a
+ display block
+ width 100%
+ white-space nowrap
+ overflow hidden
+ text-overflow ellipsis
+ color inherit
+
+ > p
+ margin 0
+ font-size 75%
+ opacity 0.7
+
+ > .chart
+ height 30px
+
+.csqvmxybqbycalfhkxvyfrgbrdalkaoc[data-darkmode]
+ root(true)
+
+.csqvmxybqbycalfhkxvyfrgbrdalkaoc:not([data-darkmode])
+ root(false)
+
+</style>
diff --git a/src/client/app/common/views/components/url.vue b/src/client/app/common/views/components/url.vue
index e6ffe4466d..04a1f30135 100644
--- a/src/client/app/common/views/components/url.vue
+++ b/src/client/app/common/views/components/url.vue
@@ -12,6 +12,7 @@
<script lang="ts">
import Vue from 'vue';
+import { toUnicode as decodePunycode } from 'punycode';
export default Vue.extend({
props: ['url', 'target'],
data() {
@@ -27,11 +28,11 @@ export default Vue.extend({
created() {
const url = new URL(this.url);
this.schema = url.protocol;
- this.hostname = url.hostname;
+ this.hostname = decodePunycode(url.hostname);
this.port = url.port;
- this.pathname = url.pathname;
- this.query = url.search;
- this.hash = url.hash;
+ this.pathname = decodeURIComponent(url.pathname);
+ this.query = decodeURIComponent(url.search);
+ this.hash = decodeURIComponent(url.hash);
}
});
</script>
diff --git a/src/client/app/common/views/components/welcome-timeline.vue b/src/client/app/common/views/components/welcome-timeline.vue
index 5a8b9df476..d4e7902c7b 100644
--- a/src/client/app/common/views/components/welcome-timeline.vue
+++ b/src/client/app/common/views/components/welcome-timeline.vue
@@ -31,15 +31,30 @@ export default Vue.extend({
default: undefined
}
},
+
data() {
return {
fetching: true,
- notes: []
+ notes: [],
+ connection: null,
+ connectionId: null
};
},
+
mounted() {
this.fetch();
+
+ this.connection = (this as any).os.streams.localTimelineStream.getConnection();
+ this.connectionId = (this as any).os.streams.localTimelineStream.use();
+
+ this.connection.on('note', this.onNote);
+ },
+
+ beforeDestroy() {
+ this.connection.off('note', this.onNote);
+ (this as any).os.streams.localTimelineStream.dispose(this.connectionId);
},
+
methods: {
fetch(cb?) {
this.fetching = true;
@@ -49,13 +64,20 @@ export default Vue.extend({
reply: false,
renote: false,
media: false,
- poll: false,
- bot: false
+ poll: false
}).then(notes => {
this.notes = notes;
this.fetching = false;
});
- }
+ },
+
+ onNote(note) {
+ if (note.replyId != null) return;
+ if (note.renoteId != null) return;
+ if (note.poll != null) return;
+
+ this.notes.unshift(note);
+ },
}
});
</script>
diff --git a/src/client/app/common/views/pages/follow.vue b/src/client/app/common/views/pages/follow.vue
index ec74b3a9b9..05c1329f6d 100644
--- a/src/client/app/common/views/pages/follow.vue
+++ b/src/client/app/common/views/pages/follow.vue
@@ -83,7 +83,7 @@ export default Vue.extend({
userId: this.user.id
});
} else {
- if (this.user.isLocked && this.user.hasPendingFollowRequestFromYou) {
+ if (this.user.hasPendingFollowRequestFromYou) {
this.user = await (this as any).api('following/requests/cancel', {
userId: this.user.id
});
diff --git a/src/client/app/common/views/widgets/broadcast.vue b/src/client/app/common/views/widgets/broadcast.vue
index 69b2a54fe9..e4e77263e5 100644
--- a/src/client/app/common/views/widgets/broadcast.vue
+++ b/src/client/app/common/views/widgets/broadcast.vue
@@ -1,5 +1,5 @@
<template>
-<div class="mkw-broadcast"
+<div class="anltbovirfeutcigvwgmgxipejaeozxi"
:data-found="broadcasts.length != 0"
:data-melt="props.design == 1"
:data-mobile="platform == 'mobile'"
@@ -25,7 +25,6 @@
<script lang="ts">
import define from '../../../common/define-widget';
-import { lang } from '../../../config';
export default define({
name: 'broadcast',
@@ -42,15 +41,7 @@ export default define({
},
mounted() {
(this as any).os.getMeta().then(meta => {
- let broadcasts = [];
- if (meta.broadcasts) {
- meta.broadcasts.forEach(broadcast => {
- if (broadcast[lang]) {
- broadcasts.push(broadcast[lang]);
- }
- });
- }
- this.broadcasts = broadcasts;
+ this.broadcasts = meta.broadcasts;
this.fetching = false;
});
},
@@ -75,7 +66,7 @@ export default define({
</script>
<style lang="stylus" scoped>
-.mkw-broadcast
+root(isDark)
padding 10px
border solid 1px #4078c0
border-radius 6px
@@ -142,15 +133,11 @@ export default define({
z-index 1
margin 0
font-size 0.7em
- color #555
+ color isDark ? #fff : #555
&.fetching
text-align center
- a
- color #555
- text-decoration underline
-
> a
display block
font-size 0.7em
@@ -159,4 +146,10 @@ export default define({
> p
color #fff
+.anltbovirfeutcigvwgmgxipejaeozxi[data-darkmode]
+ root(true)
+
+.anltbovirfeutcigvwgmgxipejaeozxi:not([data-darkmode])
+ root(false)
+
</style>
diff --git a/src/client/app/common/views/widgets/hashtags.vue b/src/client/app/common/views/widgets/hashtags.vue
index 56520400b6..0cb6b2df10 100644
--- a/src/client/app/common/views/widgets/hashtags.vue
+++ b/src/client/app/common/views/widgets/hashtags.vue
@@ -4,20 +4,7 @@
<template slot="header">%fa:hashtag%%i18n:@title%</template>
<div class="mkw-hashtags--body" :data-mobile="platform == 'mobile'">
- <p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
- <p class="empty" v-else-if="stats.length == 0">%fa:exclamation-circle%%i18n:@empty%</p>
- <!-- トランジションを有効にするとなぜかメモリリークする -->
- <!-- <transition-group v-else tag="div" name="chart"> -->
- <div>
- <div v-for="stat in stats" :key="stat.tag">
- <div class="tag">
- <router-link :to="`/tags/${ encodeURIComponent(stat.tag) }`" :title="stat.tag">#{{ stat.tag }}</router-link>
- <p>{{ '%i18n:@count%'.replace('{}', stat.usersCount) }}</p>
- </div>
- <x-chart class="chart" :src="stat.chart"/>
- </div>
- </div>
- <!-- </transition-group> -->
+ <mk-trends/>
</div>
</mk-widget-container>
</div>
@@ -25,7 +12,6 @@
<script lang="ts">
import define from '../../../common/define-widget';
-import XChart from './hashtags.chart.vue';
export default define({
name: 'hashtags',
@@ -33,89 +19,11 @@ export default define({
compact: false
})
}).extend({
- components: {
- XChart
- },
- data() {
- return {
- stats: [],
- fetching: true,
- clock: null
- };
- },
- mounted() {
- this.fetch();
- this.clock = setInterval(this.fetch, 1000 * 60);
- },
- beforeDestroy() {
- clearInterval(this.clock);
- },
methods: {
func() {
this.props.compact = !this.props.compact;
this.save();
- },
- fetch() {
- (this as any).api('hashtags/trend').then(stats => {
- this.stats = stats;
- this.fetching = false;
- });
}
}
});
</script>
-
-<style lang="stylus" scoped>
-root(isDark)
- .mkw-hashtags--body
- > .fetching
- > .empty
- margin 0
- padding 16px
- text-align center
- color #aaa
-
- > [data-fa]
- margin-right 4px
-
- > div
- .chart-move
- transition transform 1s ease
-
- > div
- display flex
- align-items center
- padding 14px 16px
-
- &:not(:last-child)
- border-bottom solid 1px isDark ? #393f4f : #eee
-
- > .tag
- flex 1
- overflow hidden
- font-size 14px
- color isDark ? #9baec8 : #65727b
-
- > a
- display block
- width 100%
- white-space nowrap
- overflow hidden
- text-overflow ellipsis
- color inherit
-
- > p
- margin 0
- font-size 75%
- opacity 0.7
-
- > .chart
- height 30px
-
-.mkw-hashtags[data-darkmode]
- root(true)
-
-.mkw-hashtags:not([data-darkmode])
- root(false)
-
-</style>
diff --git a/src/client/app/desktop/views/components/follow-button.vue b/src/client/app/desktop/views/components/follow-button.vue
index 62742a8f39..1db4b0cfa4 100644
--- a/src/client/app/desktop/views/components/follow-button.vue
+++ b/src/client/app/desktop/views/components/follow-button.vue
@@ -55,13 +55,15 @@ export default Vue.extend({
methods: {
onFollow(user) {
if (user.id == this.u.id) {
- this.user.isFollowing = user.isFollowing;
+ this.u.isFollowing = user.isFollowing;
+ this.u.hasPendingFollowRequestFromYou = user.hasPendingFollowRequestFromYou;
}
},
onUnfollow(user) {
if (user.id == this.u.id) {
- this.user.isFollowing = user.isFollowing;
+ this.u.isFollowing = user.isFollowing;
+ this.u.hasPendingFollowRequestFromYou = user.hasPendingFollowRequestFromYou;
}
},
@@ -74,7 +76,7 @@ export default Vue.extend({
userId: this.u.id
});
} else {
- if (this.u.isLocked && this.u.hasPendingFollowRequestFromYou) {
+ if (this.u.hasPendingFollowRequestFromYou) {
this.u = await (this as any).api('following/requests/cancel', {
userId: this.u.id
});
diff --git a/src/client/app/desktop/views/components/media-image.vue b/src/client/app/desktop/views/components/media-image.vue
index 52d029a269..0284872c68 100644
--- a/src/client/app/desktop/views/components/media-image.vue
+++ b/src/client/app/desktop/views/components/media-image.vue
@@ -48,7 +48,7 @@ export default Vue.extend({
const mouseY = e.clientY - rect.top;
const xp = mouseX / this.$el.offsetWidth * 100;
const yp = mouseY / this.$el.offsetHeight * 100;
- this.$el.style.backgroundPosition = `${xp}% ${yp}%';
+ this.$el.style.backgroundPosition = `${xp}% ${yp}%`;
this.$el.style.backgroundImage = `url("${this.image.url}")`;
},
diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue
index eb8b40062a..2ca5484610 100644
--- a/src/client/app/desktop/views/components/post-form.vue
+++ b/src/client/app/desktop/views/components/post-form.vue
@@ -35,7 +35,7 @@
<button class="upload" title="%i18n:@attach-media-from-local%" @click="chooseFile">%fa:upload%</button>
<button class="drive" title="%i18n:@attach-media-from-drive%" @click="chooseFileFromDrive">%fa:cloud%</button>
<button class="kao" title="%i18n:@insert-a-kao%" @click="kao">%fa:R smile%</button>
- <button class="poll" title="%i18n:@create-poll%" @click="poll = true">%fa:chart-pie%</button>
+ <button class="poll" title="%i18n:@create-poll%" @click="poll = !poll">%fa:chart-pie%</button>
<button class="poll" title="%i18n:@hide-contents%" @click="useCw = !useCw">%fa:eye-slash%</button>
<button class="geo" title="%i18n:@attach-location-information%" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
<button class="visibility" title="%i18n:@visibility%" @click="setVisibility" ref="visibilityButton">
diff --git a/src/client/app/desktop/views/pages/admin/admin.announcements.vue b/src/client/app/desktop/views/pages/admin/admin.announcements.vue
new file mode 100644
index 0000000000..532400deb2
--- /dev/null
+++ b/src/client/app/desktop/views/pages/admin/admin.announcements.vue
@@ -0,0 +1,41 @@
+<template>
+<div class="qldxjjsrseehkusjuoooapmsprvfrxyl mk-admin-card">
+ <header>%i18n:@announcements%</header>
+ <textarea v-model="broadcasts"></textarea>
+ <button class="ui" @click="save">%i18n:@save%</button>
+</div>
+</template>
+
+<script lang="ts">
+import Vue from "vue";
+
+export default Vue.extend({
+ data() {
+ return {
+ broadcasts: '',
+ };
+ },
+ created() {
+ (this as any).os.getMeta().then(meta => {
+ this.broadcasts = JSON.stringify(meta.broadcasts, null, ' ');
+ });
+ },
+ methods: {
+ save() {
+ (this as any).api('admin/update-meta', {
+ broadcasts: JSON.parse(this.broadcasts)
+ });
+ }
+ }
+});
+</script>
+
+<style lang="stylus" scoped>
+@import '~const.styl'
+
+.qldxjjsrseehkusjuoooapmsprvfrxyl
+ textarea
+ width 100%
+ min-height 300px
+
+</style>
diff --git a/src/client/app/desktop/views/pages/admin/admin.vue b/src/client/app/desktop/views/pages/admin/admin.vue
index 3438462cd6..a71059c378 100644
--- a/src/client/app/desktop/views/pages/admin/admin.vue
+++ b/src/client/app/desktop/views/pages/admin/admin.vue
@@ -4,6 +4,7 @@
<ul>
<li @click="nav('dashboard')" :class="{ active: page == 'dashboard' }">%fa:chalkboard .fw%%i18n:@dashboard%</li>
<li @click="nav('users')" :class="{ active: page == 'users' }">%fa:users .fw%%i18n:@users%</li>
+ <li @click="nav('announcements')" :class="{ active: page == 'announcements' }">%fa:broadcast-tower .fw%%i18n:@announcements%</li>
<!-- <li @click="nav('drive')" :class="{ active: page == 'drive' }">%fa:cloud .fw%%i18n:@drive%</li> -->
<!-- <li @click="nav('update')" :class="{ active: page == 'update' }">%i18n:@update%</li> -->
</ul>
@@ -13,6 +14,9 @@
<x-dashboard/>
<x-charts/>
</div>
+ <div v-show="page == 'announcements'">
+ <x-announcements/>
+ </div>
<div v-if="page == 'users'">
<x-suspend-user/>
<x-unsuspend-user/>
@@ -28,6 +32,7 @@
<script lang="ts">
import Vue from "vue";
import XDashboard from "./admin.dashboard.vue";
+import XAnnouncements from "./admin.announcements.vue";
import XSuspendUser from "./admin.suspend-user.vue";
import XUnsuspendUser from "./admin.unsuspend-user.vue";
import XVerifyUser from "./admin.verify-user.vue";
@@ -37,6 +42,7 @@ import XCharts from "../../components/charts.vue";
export default Vue.extend({
components: {
XDashboard,
+ XAnnouncements,
XSuspendUser,
XUnsuspendUser,
XVerifyUser,
diff --git a/src/client/app/desktop/views/pages/welcome.vue b/src/client/app/desktop/views/pages/welcome.vue
index ae9bf7e678..0bc5c256e0 100644
--- a/src/client/app/desktop/views/pages/welcome.vue
+++ b/src/client/app/desktop/views/pages/welcome.vue
@@ -1,46 +1,60 @@
<template>
<div class="mk-welcome">
- <img ref="pointer" class="pointer" src="/assets/pointer.png" alt="">
<button @click="dark">
<template v-if="$store.state.device.darkmode">%fa:moon%</template>
<template v-else>%fa:R moon%</template>
</button>
+
+ <mk-forkit class="forkit"/>
+
<div class="body">
- <div class="container">
+ <div class="main block">
+ <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>
+ <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>
- <main>
- <div class="about">
- <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>
- <p class="powerd-by" v-if="name != 'Misskey'" v-html="'%i18n:@powered-by-misskey%'"></p>
- <p class="desc" v-html="description || '%i18n:common.about%'"></p>
- <a ref="signup" @click="signup">📦 %i18n:@signup%</a>
- </div>
- <div class="login">
- <mk-signin/>
- </div>
- </main>
- <div class="hashtags">
- <router-link v-for="tag in tags" :key="tag" :to="`/tags/${ tag }`" :title="tag">#{{ tag }}</router-link>
+
+ <p class="desc" v-html="description || '%i18n:common.about%'"></p>
+
+ <p class="sign">
+ <span class="signup" @click="signup">%i18n:@signup%</span>
+ <span class="divider">|</span>
+ <span class="signin" @click="signin">%i18n:@signin%</span>
+ </p>
+ </div>
+
+ <div class="broadcasts block">
+ <div v-for="broadcast in broadcasts">
+ <h1 v-html="broadcast.title"></h1>
+ <div v-html="broadcast.text"></div>
</div>
+ </div>
+
+ <div class="nav block">
<mk-nav class="nav"/>
</div>
- <mk-forkit class="forkit"/>
- <img src="assets/title.dark.svg" :alt="name">
- </div>
- <div class="tl">
- <mk-welcome-timeline :max="20"/>
+
+ <div class="side">
+ <mk-trends class="trends block"/>
+
+ <mk-welcome-timeline class="tl block" :max="20"/>
+ </div>
</div>
- <modal name="signup" width="500px" height="auto" scrollable>
- <header :class="$style.signupFormHeader">%i18n:@signup%</header>
- <mk-signup :class="$style.signupForm"/>
+ <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"/>
</modal>
</div>
</template>
@@ -57,37 +71,22 @@ export default Vue.extend({
host,
name: 'Misskey',
description: '',
- pointerInterval: null,
- tags: []
+ broadcasts: []
};
},
created() {
(this as any).os.getMeta().then(meta => {
this.name = meta.name;
this.description = meta.description;
+ this.broadcasts = meta.broadcasts;
});
(this as any).api('stats').then(stats => {
this.stats = stats;
});
- (this as any).api('hashtags/trend').then(stats => {
- this.tags = stats.map(x => x.tag);
- });
- },
- mounted() {
- this.point();
- this.pointerInterval = setInterval(this.point, 100);
- },
- beforeDestroy() {
- clearInterval(this.pointerInterval);
},
methods: {
- point() {
- const x = this.$refs.signup.getBoundingClientRect();
- this.$refs.pointer.style.top = x.top + x.height + 'px';
- this.$refs.pointer.style.left = x.left + 'px';
- },
signup() {
this.$modal.show('signup');
},
@@ -104,11 +103,40 @@ export default Vue.extend({
});
</script>
-<style>
-#wait {
- right: auto;
- left: 15px;
-}
+<style lang="stylus">
+#wait
+ right auto
+ left 15px
+
+.v--modal-overlay
+ background rgba(0, 0, 0, 0.6)
+
+.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
+
</style>
<style lang="stylus" scoped>
@@ -117,122 +145,87 @@ export default Vue.extend({
root(isDark)
display flex
min-height 100vh
+ //background-color #00070F
+ //background-image url('/assets/bg.jpg')
+ //background-position center
+ //background-size cover
- > .pointer
- display block
+ > .forkit
position absolute
- z-index 1
top 0
right 0
- width 180px
- margin 0 0 0 -180px
- transform rotateY(180deg) translateX(-10px) translateY(-48px)
- pointer-events none
> button
position fixed
z-index 1
- top 0
- left 0
+ bottom 16px
+ left 16px
padding 16px
font-size 18px
- color #fff
-
- display none // TODO
+ color isDark ? #fff : #444
> .body
- flex 1
- padding 64px 0 0 0
- text-align center
- background #578394
- background-position center
- background-size cover
+ display grid
+ grid-template-rows 0.5fr 0.5fr 64px
+ grid-template-columns 1fr 350px
+ gap 16px
+ width 100%
+ max-width 1200px
+ height 100vh
+ min-height 800px
+ margin 0 auto
+ padding 64px
- &:before
- content ''
- display block
- position absolute
- top 0
- left 0
- right 0
- bottom 0
- background rgba(#000, 0.5)
+ .block
+ color isDark ? #fff : #444
+ background isDark ? #313543 : #fff
+ box-shadow 0 3px 8px rgba(0, 0, 0, 0.2)
+ //border-radius 8px
+ overflow auto
- > .forkit
- position absolute
- top 0
- right 0
+ > .main
+ grid-row 1
+ grid-column 1
+ padding 32px
+ border-top solid 5px $theme-color
- > img
- position absolute
- bottom 16px
- right 16px
- width 150px
+ > h1
+ margin 0
- > .container
- $aboutWidth = 380px
- $loginWidth = 340px
- $width = $aboutWidth + $loginWidth
+ > img
+ margin -8px 0 0 -16px
+ max-width 280px
> .info
margin 0 auto 16px auto
width $width
font-size 14px
- color #fff
> .stats
margin-left 16px
padding-left 16px
- border-left solid 1px #fff
+ border-left solid 1px isDark ? #fff : #444
> *
margin-right 16px
- > main
- display flex
- margin auto
- width $width
- border-radius 8px
- overflow hidden
- box-shadow 0 2px 8px rgba(#000, 0.3)
-
- > .about
- width $aboutWidth
- color #444
- background #fff
-
- > h1
- margin 0 0 16px 0
- padding 32px 32px 0 32px
- color #444
-
- > img
- width 170px
- vertical-align bottom
-
- > .powerd-by
- margin 16px
- opacity 0.7
+ > .sign
+ font-size 120%
- > .desc
- margin 0
- padding 0 32px 16px 32px
+ > .divider
+ margin 0 16px
- > a
- display inline-block
- margin 0 0 32px 0
- font-weight bold
+ > .signin
+ > .signup
+ cursor pointer
- > .login
- width $loginWidth
- padding 16px 32px 32px 32px
- background isDark ? #2e3440 : #f5f5f5
+ &:hover
+ color $theme-color
> .hashtags
margin 16px auto
width $width
font-size 14px
- color #fff
background rgba(#000, 0.3)
border-radius 8px
@@ -240,53 +233,52 @@ root(isDark)
display inline-block
margin 14px
- > .nav
- display block
- margin 16px 0
- font-size 14px
- color #fff
+ > .broadcasts
+ grid-row 2
+ grid-column 1
+ padding 32px
- > .tl
- margin 0
- width 410px
- height 100vh
- text-align left
- background isDark ? #313543 : #fff
+ > div
+ padding 0 0 16px 0
+ margin 0 0 16px 0
+ border-bottom 1px solid isDark ? rgba(#000, 0.2) : rgba(#000, 0.05)
- > *
- max-height 100%
- overflow auto
+ > h1
+ margin 0
+ font-size 1.5em
-.mk-welcome[data-darkmode]
- root(true)
+ > .nav
+ display flex
+ justify-content center
+ align-items center
+ grid-row 3
+ grid-column 1
+ font-size 14px
-.mk-welcome:not([data-darkmode])
- root(false)
+ > .side
+ display grid
+ grid-row 1 / 4
+ grid-column 2
+ grid-template-rows 1fr 350px
+ grid-template-columns 1fr
+ gap 16px
-</style>
-
-<style lang="stylus" module>
-.signupForm
- padding 24px 48px 48px 48px
+ > .tl
+ grid-row 1
+ grid-column 1
+ text-align left
+ max-height 100%
+ overflow auto
-.signupFormHeader
- padding 48px 0 12px 0
- margin: 0 48px
- font-size 1.5em
- color #777
- border-bottom solid 1px #eee
+ > .trends
+ grid-row 2
+ grid-column 1
+ padding 8px
-.signinForm
- padding 24px 48px 48px 48px
+.mk-welcome[data-darkmode]
+ root(true)
-.signinFormHeader
- padding 48px 0 12px 0
- margin: 0 48px
- font-size 1.5em
- color #777
- border-bottom solid 1px #eee
+.mk-welcome:not([data-darkmode])
+ root(false)
-.nav
- a
- color #666
</style>
diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts
index 664848b5e7..c2ec7f1750 100644
--- a/src/client/app/mios.ts
+++ b/src/client/app/mios.ts
@@ -3,7 +3,7 @@ import { EventEmitter } from 'eventemitter3';
import * as uuid from 'uuid';
import initStore from './store';
-import { apiUrl, swPublickey, version, lang, googleMapsApiKey } from './config';
+import { apiUrl, version, lang } from './config';
import Progress from './common/scripts/loading';
import Connection from './common/scripts/streaming/stream';
import { HomeStreamManager } from './common/scripts/streaming/home';
@@ -230,13 +230,13 @@ export default class MiOS extends EventEmitter {
//#region Init stream managers
this.streams.serverStatsStream = new ServerStatsStreamManager(this);
this.streams.notesStatsStream = new NotesStatsStreamManager(this);
+ this.streams.localTimelineStream = new LocalTimelineStreamManager(this, this.store.state.i);
this.once('signedin', () => {
// Init home stream manager
this.stream = new HomeStreamManager(this, this.store.state.i);
// Init other stream manager
- this.streams.localTimelineStream = new LocalTimelineStreamManager(this, this.store.state.i);
this.streams.hybridTimelineStream = new HybridTimelineStreamManager(this, this.store.state.i);
this.streams.globalTimelineStream = new GlobalTimelineStreamManager(this, this.store.state.i);
this.streams.driveStream = new DriveStreamManager(this, this.store.state.i);
@@ -361,7 +361,7 @@ export default class MiOS extends EventEmitter {
// A public key your push server will use to send
// messages to client apps via a push server.
- applicationServerKey: urlBase64ToUint8Array(swPublickey)
+ applicationServerKey: urlBase64ToUint8Array(this.meta.data.swPublickey)
};
// Subscribe push notification
diff --git a/src/client/app/mobile/views/components/drive-file-chooser.vue b/src/client/app/mobile/views/components/drive-file-chooser.vue
index 56e41e31d8..aaa707d8a7 100644
--- a/src/client/app/mobile/views/components/drive-file-chooser.vue
+++ b/src/client/app/mobile/views/components/drive-file-chooser.vue
@@ -1,12 +1,12 @@
<template>
-<div class="mk-drive-file-chooser">
+<div class="cdxzvcfawjxdyxsekbxbfgtplebnoneb">
<div class="body">
<header>
<h1>%i18n:@select-file%<span class="count" v-if="files.length > 0">({{ files.length }})</span></h1>
<button class="close" @click="cancel">%fa:times%</button>
<button v-if="multiple" class="ok" @click="ok">%fa:check%</button>
</header>
- <mk-drive ref="browser"
+ <mk-drive class="drive" ref="browser"
:select-file="true"
:multiple="multiple"
@change-selection="onChangeSelection"
@@ -46,7 +46,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
-.mk-drive-file-chooser
+root(isDark)
position fixed
z-index 20000
top 0
@@ -59,10 +59,11 @@ export default Vue.extend({
> .body
width 100%
height 100%
- background #fff
+ background isDark ? #282c37 : #fff
> header
- border-bottom solid 1px #eee
+ border-bottom solid 1px isDark ? #1b1f29 : #eee
+ color isDark ? #fff : #111
> h1
margin 0
@@ -90,9 +91,15 @@ export default Vue.extend({
line-height 42px
width 42px
- > .mk-drive
+ > .drive
height calc(100% - 42px)
overflow scroll
-webkit-overflow-scrolling touch
+.cdxzvcfawjxdyxsekbxbfgtplebnoneb[data-darkmode]
+ root(true)
+
+.cdxzvcfawjxdyxsekbxbfgtplebnoneb:not([data-darkmode])
+ root(false)
+
</style>
diff --git a/src/client/app/mobile/views/components/follow-button.vue b/src/client/app/mobile/views/components/follow-button.vue
index 360ee91d4b..ff7260edb5 100644
--- a/src/client/app/mobile/views/components/follow-button.vue
+++ b/src/client/app/mobile/views/components/follow-button.vue
@@ -48,12 +48,14 @@ export default Vue.extend({
onFollow(user) {
if (user.id == this.u.id) {
this.u.isFollowing = user.isFollowing;
+ this.u.hasPendingFollowRequestFromYou = user.hasPendingFollowRequestFromYou;
}
},
onUnfollow(user) {
if (user.id == this.u.id) {
this.u.isFollowing = user.isFollowing;
+ this.u.hasPendingFollowRequestFromYou = user.hasPendingFollowRequestFromYou;
}
},
@@ -66,7 +68,7 @@ export default Vue.extend({
userId: this.u.id
});
} else {
- if (this.u.isLocked && this.u.hasPendingFollowRequestFromYou) {
+ if (this.u.hasPendingFollowRequestFromYou) {
this.u = await (this as any).api('following/requests/cancel', {
userId: this.u.id
});
diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue
index d0cea135f9..258433cb3f 100644
--- a/src/client/app/mobile/views/components/note.vue
+++ b/src/client/app/mobile/views/components/note.vue
@@ -471,10 +471,6 @@ root(isDark)
&.reacted
color $theme-color
- &.menu
- @media (max-width 350px)
- display none
-
.note[data-darkmode]
root(true)
diff --git a/src/client/app/mobile/views/components/notify.vue b/src/client/app/mobile/views/components/notify.vue
index 6d4a481dbe..4d9b7c0f6b 100644
--- a/src/client/app/mobile/views/components/notify.vue
+++ b/src/client/app/mobile/views/components/notify.vue
@@ -1,6 +1,8 @@
<template>
<div class="mk-notify">
- <mk-notification-preview :notification="notification"/>
+ <div>
+ <mk-notification-preview :notification="notification"/>
+ </div>
</div>
</template>
@@ -22,7 +24,7 @@ export default Vue.extend({
setTimeout(() => {
anime({
targets: this.$el,
- bottom: '-64px',
+ bottom: `-${this.$el.offsetHeight}px`,
duration: 500,
easing: 'easeOutQuad',
complete: () => this.$destroy()
@@ -35,15 +37,27 @@ export default Vue.extend({
<style lang="stylus" scoped>
.mk-notify
+ $height = 78px
+
position fixed
z-index 1024
- bottom -64px
+ bottom -($height)
left 0
+ right 0
width 100%
- height 64px
+ max-width 500px
+ height $height
+ margin 0 auto
+ padding 8px
pointer-events none
- -webkit-backdrop-filter blur(2px)
- backdrop-filter blur(2px)
- background-color rgba(#000, 0.5)
+ font-size 80%
+
+ > div
+ height 100%
+ -webkit-backdrop-filter blur(2px)
+ backdrop-filter blur(2px)
+ background-color rgba(#000, 0.5)
+ border-radius 7px
+ overflow hidden
</style>