From 71d6394bc8ba86fc72b71242590c03482613f335 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 14:38:33 +0900 Subject: Refactoring --- src/client/components/link.vue | 4 +- src/client/components/note.vue | 6 +- src/client/components/url-preview-popup.vue | 6 +- src/client/components/url.vue | 4 +- src/client/pages/messaging-room.form.vue | 353 ------------------- src/client/pages/messaging-room.message.vue | 337 ------------------ src/client/pages/messaging-room.vue | 391 --------------------- src/client/pages/messaging.vue | 324 ----------------- src/client/pages/messaging/index.vue | 324 +++++++++++++++++ src/client/pages/messaging/messaging-room.form.vue | 353 +++++++++++++++++++ .../pages/messaging/messaging-room.message.vue | 337 ++++++++++++++++++ src/client/pages/messaging/messaging-room.vue | 391 +++++++++++++++++++++ src/client/router.ts | 6 +- 13 files changed, 1418 insertions(+), 1418 deletions(-) delete mode 100644 src/client/pages/messaging-room.form.vue delete mode 100644 src/client/pages/messaging-room.message.vue delete mode 100644 src/client/pages/messaging-room.vue delete mode 100644 src/client/pages/messaging.vue create mode 100644 src/client/pages/messaging/index.vue create mode 100644 src/client/pages/messaging/messaging-room.form.vue create mode 100644 src/client/pages/messaging/messaging-room.message.vue create mode 100644 src/client/pages/messaging/messaging-room.vue (limited to 'src') diff --git a/src/client/components/link.vue b/src/client/components/link.vue index f4e07c1627..11de688520 100644 --- a/src/client/components/link.vue +++ b/src/client/components/link.vue @@ -13,7 +13,7 @@ import Vue from 'vue'; import { faExternalLinkSquareAlt } from '@fortawesome/free-solid-svg-icons'; import { url as local } from '../config'; -import XUrlPreview from './url-preview-popup.vue'; +import MkUrlPreview from './url-preview-popup.vue'; export default Vue.extend({ props: { @@ -44,7 +44,7 @@ export default Vue.extend({ if (!document.body.contains(this.$el)) return; if (this.preview) return; - this.preview = new XUrlPreview({ + this.preview = new MkUrlPreview({ parent: this, propsData: { url: this.url, diff --git a/src/client/components/note.vue b/src/client/components/note.vue index b3126e0673..48e37c33d3 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -49,7 +49,7 @@ - +
@@ -97,7 +97,7 @@ import XReactionsViewer from './reactions-viewer.vue'; import XMediaList from './media-list.vue'; import XCwButton from './cw-button.vue'; import XPoll from './poll.vue'; -import XUrlPreview from './url-preview.vue'; +import MkUrlPreview from './url-preview.vue'; import MkReactionPicker from './reaction-picker.vue'; import pleaseLogin from '../scripts/please-login'; import { focusPrev, focusNext } from '../scripts/focus'; @@ -115,7 +115,7 @@ export default Vue.extend({ XMediaList, XCwButton, XPoll, - XUrlPreview, + MkUrlPreview, }, props: { diff --git a/src/client/components/url-preview-popup.vue b/src/client/components/url-preview-popup.vue index 26fdbf44a9..938566e9e2 100644 --- a/src/client/components/url-preview-popup.vue +++ b/src/client/components/url-preview-popup.vue @@ -1,19 +1,19 @@ - - diff --git a/src/client/pages/messaging-room.message.vue b/src/client/pages/messaging-room.message.vue deleted file mode 100644 index f26ef449b2..0000000000 --- a/src/client/pages/messaging-room.message.vue +++ /dev/null @@ -1,337 +0,0 @@ - - - - - diff --git a/src/client/pages/messaging-room.vue b/src/client/pages/messaging-room.vue deleted file mode 100644 index 5fca8c0ff3..0000000000 --- a/src/client/pages/messaging-room.vue +++ /dev/null @@ -1,391 +0,0 @@ - - - - - diff --git a/src/client/pages/messaging.vue b/src/client/pages/messaging.vue deleted file mode 100644 index 47d761d895..0000000000 --- a/src/client/pages/messaging.vue +++ /dev/null @@ -1,324 +0,0 @@ - - - - - diff --git a/src/client/pages/messaging/index.vue b/src/client/pages/messaging/index.vue new file mode 100644 index 0000000000..702979a098 --- /dev/null +++ b/src/client/pages/messaging/index.vue @@ -0,0 +1,324 @@ + + + + + diff --git a/src/client/pages/messaging/messaging-room.form.vue b/src/client/pages/messaging/messaging-room.form.vue new file mode 100644 index 0000000000..0cd3dfcc85 --- /dev/null +++ b/src/client/pages/messaging/messaging-room.form.vue @@ -0,0 +1,353 @@ + + + + + diff --git a/src/client/pages/messaging/messaging-room.message.vue b/src/client/pages/messaging/messaging-room.message.vue new file mode 100644 index 0000000000..4988b70a22 --- /dev/null +++ b/src/client/pages/messaging/messaging-room.message.vue @@ -0,0 +1,337 @@ + + + + + diff --git a/src/client/pages/messaging/messaging-room.vue b/src/client/pages/messaging/messaging-room.vue new file mode 100644 index 0000000000..0a20c56c29 --- /dev/null +++ b/src/client/pages/messaging/messaging-room.vue @@ -0,0 +1,391 @@ + + + + + diff --git a/src/client/router.ts b/src/client/router.ts index 3b2bbe9c80..83445fea7e 100644 --- a/src/client/router.ts +++ b/src/client/router.ts @@ -31,9 +31,9 @@ export const router = new VueRouter({ { path: '/my/favorites', component: page('favorites') }, { path: '/my/messages', component: page('messages') }, { path: '/my/mentions', component: page('mentions') }, - { path: '/my/messaging', name: 'messaging', component: page('messaging') }, - { path: '/my/messaging/:user', component: page('messaging-room') }, - { path: '/my/messaging/group/:group', component: page('messaging-room') }, + { path: '/my/messaging', name: 'messaging', component: page('messaging/index') }, + { path: '/my/messaging/:user', component: page('messaging/messaging-room') }, + { path: '/my/messaging/group/:group', component: page('messaging/messaging-room') }, { path: '/my/drive', name: 'drive', component: page('drive') }, { path: '/my/drive/folder/:folder', component: page('drive') }, { path: '/my/pages', name: 'pages', component: page('pages') }, -- cgit v1.2.3-freya From 15050018f2d18a07f7090e5deba57f3dcd4443c2 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 14:45:33 +0900 Subject: :art: --- src/client/app.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/app.vue b/src/client/app.vue index 1e9fd6c0a9..53347dfb8b 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -622,12 +622,12 @@ export default Vue.extend({ .mk-app { $header-height: 60px; $nav-width: 250px; - $nav-icon-only-width: 74px; + $nav-icon-only-width: 80px; $main-width: 650px; $ui-font-size: 1em; $nav-icon-only-threshold: 1300px; - $nav-hide-threshold: 700px; - $side-hide-threshold: 1100px; + $nav-hide-threshold: 650px; + $side-hide-threshold: 1070px; min-height: 100vh; box-sizing: border-box; -- cgit v1.2.3-freya From 43e3ce1ed509da391fa4727885dffedfa19ac76b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 14:57:21 +0900 Subject: Fix #6085 --- src/client/app.vue | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/app.vue b/src/client/app.vue index 53347dfb8b..5a38082262 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -43,7 +43,6 @@ -
@@ -822,8 +821,6 @@ export default Vue.extend({ z-index: 1001; width: $nav-width; height: 100vh; - padding: 16px 0; - padding-bottom: calc(3.7rem + 24px); box-sizing: border-box; overflow: auto; background: var(--navBg); @@ -836,13 +833,21 @@ export default Vue.extend({ @media (max-width: $nav-icon-only-threshold) and (min-width: $nav-hide-threshold + 1px) { width: $nav-icon-only-width; - padding: 8px 0; - padding-bottom: calc(3.7rem + 24px); > .divider { margin: 8px auto; width: calc(100% - 32px); } + + > .item { + &:first-child { + margin-bottom: 8px; + } + + &:last-child { + margin-top: 8px; + } + } } > .item { @@ -892,15 +897,25 @@ export default Vue.extend({ color: var(--navActive); } + &:first-child { + position: sticky; + z-index: 1; + top: 0; + padding-top: 8px; + padding-bottom: 8px; + margin-bottom: 16px; + background: var(--navBg); + border-bottom: solid 1px var(--divider); + } + &:last-child { - position: fixed; + position: sticky; bottom: 0; - width: inherit; padding-top: 8px; padding-bottom: 8px; + margin-top: 16px; background: var(--navBg); border-top: solid 1px var(--divider); - border-right: solid 1px var(--divider); } @media (max-width: $nav-icon-only-threshold) and (min-width: $nav-hide-threshold + 1px) { -- cgit v1.2.3-freya From 76f992906d237f276252060ba94d3e8d57e9ec6b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 15:11:16 +0900 Subject: Add account setting link --- src/client/pages/preferences/index.vue | 2 ++ src/client/style.scss | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/pages/preferences/index.vue b/src/client/pages/preferences/index.vue index 7cf6f4b4b2..2b1b3083a4 100644 --- a/src/client/pages/preferences/index.vue +++ b/src/client/pages/preferences/index.vue @@ -3,6 +3,8 @@ {{ $t('clinetSettings') }} + {{ $t('accountSettings') }} +
diff --git a/src/client/style.scss b/src/client/style.scss index fee64c7ca8..7b509e5b51 100644 --- a/src/client/style.scss +++ b/src/client/style.scss @@ -292,7 +292,7 @@ main ._panel { box-shadow: 0 1px 0 0 var(--divider), 0 -1px 0 0 var(--divider); } -._panel._button { +.__panelButton { display: flex; width: 100%; min-height: 48px; @@ -300,6 +300,24 @@ main ._panel { justify-content: center; } +._panel._button { + @extend .__panelButton; +} + +._panel._buttonPrimary { + @extend .__panelButton; + color: var(--accent); + background: var(--panel); + + &:not(:disabled):hover { + background: var(--panel); + } + + &:not(:disabled):active { + background: var(--panel); + } +} + ._card { @extend ._panel; -- cgit v1.2.3-freya From f82c6f7ab411eea80fdc7706ece725166c92c6e1 Mon Sep 17 00:00:00 2001 From: okpierre <1679025+okpierre@users.noreply.github.com> Date: Sun, 22 Mar 2020 04:59:14 -0400 Subject: Add files via upload (#6116) --- src/client/assets/unread.svg | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/client/assets/unread.svg (limited to 'src') diff --git a/src/client/assets/unread.svg b/src/client/assets/unread.svg new file mode 100644 index 0000000000..8c3cc9f475 --- /dev/null +++ b/src/client/assets/unread.svg @@ -0,0 +1,7 @@ + + + + + + -- cgit v1.2.3-freya From 92f47cc9cbb2aaa021f2c9925f3cbe283a20b84a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 18:18:34 +0900 Subject: Remove smooth option to improve performance --- src/client/components/analog-clock.vue | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/client/components/analog-clock.vue b/src/client/components/analog-clock.vue index b689266780..81c6598c7a 100644 --- a/src/client/components/analog-clock.vue +++ b/src/client/components/analog-clock.vue @@ -38,13 +38,6 @@ import Vue from 'vue'; import * as tinycolor from 'tinycolor2'; export default Vue.extend({ - props: { - smooth: { - type: Boolean, - default: false - } - }, - data() { return { now: new Date(), @@ -83,9 +76,6 @@ export default Vue.extend({ return tinycolor(this.computedStyle.getPropertyValue('--accent')).toHexString(); }, - ms(): number { - return this.now.getMilliseconds() * (this.smooth ? 1 : 0); - }, s(): number { return this.now.getSeconds(); }, @@ -97,13 +87,13 @@ export default Vue.extend({ }, hAngle(): number { - return Math.PI * (this.h % 12 + (this.m + (this.s + this.ms / 1000) / 60) / 60) / 6; + return Math.PI * (this.h % 12 + (this.m + this.s / 60) / 60) / 6; }, mAngle(): number { - return Math.PI * (this.m + (this.s + this.ms / 1000) / 60) / 30; + return Math.PI * (this.m + this.s / 60) / 30; }, sAngle(): number { - return Math.PI * (this.s + this.ms / 1000) / 30; + return Math.PI * this.s / 30; }, graduations(): any { @@ -121,7 +111,7 @@ export default Vue.extend({ const update = () => { if (this.enabled) { this.tick(); - requestAnimationFrame(update); + setTimeout(update, 1000); } }; update(); -- cgit v1.2.3-freya From b44e1820a2b9cca7ecac2a9604d8fdcb831f3b92 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Mar 2020 18:39:37 +0900 Subject: ダークモードの同期を強化 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app.vue | 5 ----- src/client/init.ts | 6 ++++++ src/client/scripts/is-device-darkmode.ts | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/app.vue b/src/client/app.vue index 5a38082262..b47c092ed2 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -163,7 +163,6 @@ import { v4 as uuid } from 'uuid'; import i18n from './i18n'; import { host, instanceName } from './config'; import { search } from './scripts/search'; -import { isDeviceDarkmode } from './scripts/is-device-darkmode'; import MkToast from './components/toast.vue'; const DESKTOP_THRESHOLD = 1100; @@ -224,10 +223,6 @@ export default Vue.extend({ }, created() { - if (this.$store.state.device.syncDeviceDarkMode) { - this.$store.commit('device/set', { key: 'darkMode', value: isDeviceDarkmode() }); - } - if (this.$store.getters.isSignedIn) { this.connection = this.$root.stream.useSharedConnection('main'); this.connection.on('notification', this.onNotification); diff --git a/src/client/init.ts b/src/client/init.ts index f1790ac4d9..d7b693e4c8 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -144,6 +144,12 @@ os.init(async () => { } }, false) + window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', mql => { + if (os.store.state.device.syncDeviceDarkMode) { + os.store.commit('device/set', { key: 'darkMode', value: mql.matches }); + } + }); + if ('Notification' in window && os.store.getters.isSignedIn) { // 許可を得ていなかったらリクエスト if (Notification.permission === 'default') { diff --git a/src/client/scripts/is-device-darkmode.ts b/src/client/scripts/is-device-darkmode.ts index 21c26823c7..854f38e517 100644 --- a/src/client/scripts/is-device-darkmode.ts +++ b/src/client/scripts/is-device-darkmode.ts @@ -1,3 +1,3 @@ export function isDeviceDarkmode() { - return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; + return window.matchMedia('(prefers-color-scheme: dark)').matches; } -- cgit v1.2.3-freya