summaryrefslogtreecommitdiff
path: root/src/web/app
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-12-09 23:03:34 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-12-09 23:03:34 +0900
commit42aef0abe0a98e46acb0e9278dbd4347b79a7b53 (patch)
tree746f412276961de0fdcb44ea2b962c7a5784217b /src/web/app
parentUse ImageMagick instead of GraphicsMagick (diff)
downloadsharkey-42aef0abe0a98e46acb0e9278dbd4347b79a7b53.tar.gz
sharkey-42aef0abe0a98e46acb0e9278dbd4347b79a7b53.tar.bz2
sharkey-42aef0abe0a98e46acb0e9278dbd4347b79a7b53.zip
:v:
Diffstat (limited to 'src/web/app')
-rw-r--r--src/web/app/desktop/tags/settings.tag68
1 files changed, 67 insertions, 1 deletions
diff --git a/src/web/app/desktop/tags/settings.tag b/src/web/app/desktop/tags/settings.tag
index 63458baa2c..9f71da6876 100644
--- a/src/web/app/desktop/tags/settings.tag
+++ b/src/web/app/desktop/tags/settings.tag
@@ -3,7 +3,7 @@
<p class={ active: page == 'profile' } onmousedown={ setPage.bind(null, 'profile') }>%fa:user .fw%%i18n:desktop.tags.mk-settings.profile%</p>
<p class={ active: page == 'web' } onmousedown={ setPage.bind(null, 'web') }>%fa:desktop .fw%Web</p>
<p class={ active: page == 'notification' } onmousedown={ setPage.bind(null, 'notification') }>%fa:R bell .fw%通知</p>
- <p class={ active: page == 'drive' } onmousedown={ setPage.bind(null, 'drive') }>%fa:cloud .fw%ドライブ</p>
+ <p class={ active: page == 'drive' } onmousedown={ setPage.bind(null, 'drive') }>%fa:cloud .fw%%i18n:desktop.tags.mk-settings.drive%</p>
<p class={ active: page == 'apps' } onmousedown={ setPage.bind(null, 'apps') }>%fa:puzzle-piece .fw%アプリ</p>
<p class={ active: page == 'twitter' } onmousedown={ setPage.bind(null, 'twitter') }>%fa:B twitter .fw%Twitter</p>
<p class={ active: page == 'security' } onmousedown={ setPage.bind(null, 'security') }>%fa:unlock-alt .fw%%i18n:desktop.tags.mk-settings.security%</p>
@@ -20,6 +20,11 @@
<a href="/i/customize-home" class="ui button">ホームをカスタマイズ</a>
</section>
+ <section class="drive" show={ page == 'drive' }>
+ <h1>%i18n:desktop.tags.mk-settings.drive%</h1>
+ <mk-drive-setting/>
+ </section>
+
<section class="apps" show={ page == 'apps' }>
<h1>アプリケーション</h1>
<mk-authorized-apps/>
@@ -308,3 +313,64 @@
};
</script>
</mk-2fa-setting>
+
+<mk-drive-setting>
+ <svg viewBox="0 0 1 1" preserveAspectRatio="none">
+ <circle
+ riot-r={ r }
+ cx="50%" cy="50%"
+ fill="none"
+ stroke-width="0.1"
+ stroke="rgba(0, 0, 0, 0.05)"/>
+ <circle
+ riot-r={ r }
+ cx="50%" cy="50%"
+ riot-stroke-dasharray={ Math.PI * (r * 2) }
+ riot-stroke-dashoffset={ strokeDashoffset }
+ fill="none"
+ stroke-width="0.1"
+ riot-stroke={ color }/>
+ <text x="50%" y="50%" dy="0.05" text-anchor="middle">{ (usageP * 100).toFixed(0) }%</text>
+ </svg>
+
+ <style>
+ :scope
+ display block
+ color #4a535a
+
+ > svg
+ display block
+ height 128px
+
+ > circle
+ transform-origin center
+ transform rotate(-90deg)
+ transition stroke-dashoffset 0.5s ease
+
+ > text
+ font-size 0.15px
+ fill rgba(0, 0, 0, 0.6)
+
+ </style>
+ <script>
+ this.mixin('api');
+
+ this.r = 0.4;
+
+ this.on('mount', () => {
+ this.api('drive').then(info => {
+ const usageP = info.usage / info.capacity * 100;
+ const color = `hsl(${180 - (usageP * 180)}, 80%, 70%)`;
+ const strokeDashoffset = (1 - usageP) * (Math.PI * (this.r * 2));
+
+ this.update({
+ color,
+ strokeDashoffset,
+ usageP,
+ usage: info.usage,
+ capacity: info.capacity
+ });
+ });
+ });
+ </script>
+</mk-drive-setting>