From 62d16db008df5847f9c77eabea8af4604ae573f0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 22 Feb 2018 20:52:39 +0900 Subject: [PATCH] wip --- .../views/components/activity.calendar.vue | 2 +- .../desktop/views/components/activity.chart.vue | 10 ++++++---- .../desktop/views/components/friends-maker.vue | 10 +++++----- src/web/app/desktop/views/components/timeline.vue | 15 +++++++++++---- .../desktop/views/components/widgets/users.vue | 4 ++-- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/web/app/desktop/views/components/activity.calendar.vue b/src/web/app/desktop/views/components/activity.calendar.vue index d9b852315..72233e9ac 100644 --- a/src/web/app/desktop/views/components/activity.calendar.vue +++ b/src/web/app/desktop/views/components/activity.calendar.vue @@ -37,7 +37,7 @@ export default Vue.extend({ d.x = x; d.date.weekday = (new Date(d.date.year, d.date.month - 1, d.date.day)).getDay(); - d.v = d.total / (peak / 2); + d.v = peak == 0 ? 0 : d.total / (peak / 2); if (d.v > 1) d.v = 1; const ch = d.date.weekday == 0 || d.date.weekday == 6 ? 275 : 170; const cs = d.v * 100; diff --git a/src/web/app/desktop/views/components/activity.chart.vue b/src/web/app/desktop/views/components/activity.chart.vue index e64b181ba..5057786ed 100644 --- a/src/web/app/desktop/views/components/activity.chart.vue +++ b/src/web/app/desktop/views/components/activity.chart.vue @@ -62,10 +62,12 @@ export default Vue.extend({ methods: { render() { const peak = Math.max.apply(null, this.data.map(d => d.total)); - this.pointsPost = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.posts / peak)) * this.viewBoxY}`).join(' '); - this.pointsReply = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.replies / peak)) * this.viewBoxY}`).join(' '); - this.pointsRepost = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.reposts / peak)) * this.viewBoxY}`).join(' '); - this.pointsTotal = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.total / peak)) * this.viewBoxY}`).join(' '); + if (peak != 0) { + this.pointsPost = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.posts / peak)) * this.viewBoxY}`).join(' '); + this.pointsReply = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.replies / peak)) * this.viewBoxY}`).join(' '); + this.pointsRepost = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.reposts / peak)) * this.viewBoxY}`).join(' '); + this.pointsTotal = this.data.map((d, i) => `${(i * this.zoom) + this.pos},${(1 - (d.total / peak)) * this.viewBoxY}`).join(' '); + } }, onMousedown(e) { const clickX = e.clientX; diff --git a/src/web/app/desktop/views/components/friends-maker.vue b/src/web/app/desktop/views/components/friends-maker.vue index 61015b979..ab35efc75 100644 --- a/src/web/app/desktop/views/components/friends-maker.vue +++ b/src/web/app/desktop/views/components/friends-maker.vue @@ -3,20 +3,20 @@

気になるユーザーをフォロー:

- + - +
- {{ user.name }} + {{ user.name }}

@{{ user.username }}

- +

おすすめのユーザーは見つかりませんでした。

%fa:spinner .pulse .fw%読み込んでいます

もっと見る - + diff --git a/src/web/app/desktop/views/components/timeline.vue b/src/web/app/desktop/views/components/timeline.vue index a3f27412d..eef62104e 100644 --- a/src/web/app/desktop/views/components/timeline.vue +++ b/src/web/app/desktop/views/components/timeline.vue @@ -4,8 +4,15 @@
-

%fa:R comments%自分の投稿や、自分がフォローしているユーザーの投稿が表示されます。

- +

+ %fa:R comments%自分の投稿や、自分がフォローしているユーザーの投稿が表示されます。 +

+ +
+ + +
+
@@ -69,8 +76,8 @@ export default Vue.extend({ (this as any).api('posts/timeline', { until_id: this.posts[this.posts.length - 1].id }).then(posts => { + this.posts = this.posts.concat(posts); this.moreFetching = false; - this.posts.unshift(posts); }); }, onPost(post) { @@ -104,7 +111,7 @@ export default Vue.extend({ border solid 1px rgba(0, 0, 0, 0.075) border-radius 6px - > .mk-following-setuper + > .mk-friends-maker border-bottom solid 1px #eee > .fetching diff --git a/src/web/app/desktop/views/components/widgets/users.vue b/src/web/app/desktop/views/components/widgets/users.vue index 4a9ab2aa3..f3a1509cf 100644 --- a/src/web/app/desktop/views/components/widgets/users.vue +++ b/src/web/app/desktop/views/components/widgets/users.vue @@ -7,11 +7,11 @@

%fa:spinner .pulse .fw%%i18n:common.loading%