From a1ae832129e8bfe8c082064349e2b9973be5f0e5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 14 Jun 2018 14:52:37 +0900 Subject: [PATCH] wip --- .../app/common/views/components/index.ts | 12 +- .../app/common/views/components/signup.vue | 182 +++------------ .../components/{material => ui}/button.vue | 8 +- .../app/common/views/components/ui/form.vue | 28 +++ .../app/common/views/components/ui/group.vue | 23 ++ .../app/common/views/components/ui/input.vue | 215 ++++++++++++++++++ .../app/common/views/components/ui/switch.vue | 199 ++++++++++++++++ .../{material/input.vue => ui/textarea.vue} | 74 +++--- .../app/mobile/views/pages/settings.vue | 170 ++++++-------- .../views/pages/settings/settings.profile.vue | 83 +++---- src/client/app/mobile/views/pages/signup.vue | 2 +- src/client/app/mobile/views/pages/welcome.vue | 8 +- 12 files changed, 658 insertions(+), 346 deletions(-) rename src/client/app/common/views/components/{material => ui}/button.vue (83%) create mode 100644 src/client/app/common/views/components/ui/form.vue create mode 100644 src/client/app/common/views/components/ui/group.vue create mode 100644 src/client/app/common/views/components/ui/input.vue create mode 100644 src/client/app/common/views/components/ui/switch.vue rename src/client/app/common/views/components/{material/input.vue => ui/textarea.vue} (64%) diff --git a/src/client/app/common/views/components/index.ts b/src/client/app/common/views/components/index.ts index 5dc466857c..060af388b3 100644 --- a/src/client/app/common/views/components/index.ts +++ b/src/client/app/common/views/components/index.ts @@ -29,8 +29,12 @@ import fileTypeIcon from './file-type-icon.vue'; import Switch from './switch.vue'; import Othello from './othello.vue'; import welcomeTimeline from './welcome-timeline.vue'; -import uiInput from './material/input.vue'; -import uiButton from './material/button.vue'; +import uiInput from './ui/input.vue'; +import uiButton from './ui/button.vue'; +import uiGroup from './ui/group.vue'; +import uiForm from './ui/form.vue'; +import uiTextarea from './ui/textarea.vue'; +import uiSwitch from './ui/switch.vue'; Vue.component('mk-analog-clock', analogClock); Vue.component('mk-menu', menu); @@ -63,3 +67,7 @@ Vue.component('mk-othello', Othello); Vue.component('mk-welcome-timeline', welcomeTimeline); Vue.component('ui-input', uiInput); Vue.component('ui-button', uiButton); +Vue.component('ui-group', uiGroup); +Vue.component('ui-form', uiForm); +Vue.component('ui-textarea', uiTextarea); +Vue.component('ui-switch', uiSwitch); diff --git a/src/client/app/common/views/components/signup.vue b/src/client/app/common/views/components/signup.vue index 3adb10f2c3..d1621a4848 100644 --- a/src/client/app/common/views/components/signup.vue +++ b/src/client/app/common/views/components/signup.vue @@ -1,50 +1,40 @@ @@ -112,7 +102,6 @@ export default Vue.extend({ const strength = getPasswordStrength(this.password); this.passwordStrength = strength > 0.7 ? 'high' : strength > 0.3 ? 'medium' : 'low'; - (this.$refs.passwordMetar as any).style.width = `${strength * 100}%`; }, onChangePasswordRetype() { if (this.retypedPassword == '') { @@ -156,100 +145,6 @@ export default Vue.extend({ .mk-signup min-width 302px - label - display block - margin 0 0 16px 0 - - > .caption - margin 0 0 4px 0 - color #828888 - font-size 0.95em - - > [data-fa] - margin-right 0.25em - color #96adac - - > .info - display block - margin 4px 0 - font-size 0.8em - - > [data-fa] - margin-right 0.3em - - &.username - .profile-page-url-preview - display block - margin 4px 8px 0 4px - font-size 0.8em - color #888 - - &:empty - display none - - &:not(:empty) + .info - margin-top 0 - - &.password - .meter - display block - margin-top 8px - width 100% - height 8px - - &[data-strength=''] - display none - - &[data-strength='low'] - > .value - background #d73612 - - &[data-strength='medium'] - > .value - background #d7ca12 - - &[data-strength='high'] - > .value - background #61bb22 - - > .value - display block - width 0% - height 100% - background transparent - border-radius 4px - transition all 0.1s ease - - [type=text], [type=password] - user-select text - display inline-block - cursor auto - padding 0 12px - margin 0 - width 100% - line-height 44px - font-size 1em - color #333 !important - background #fff !important - outline none - border solid 1px rgba(#000, 0.1) - border-radius 4px - box-shadow 0 0 0 114514px #fff inset - transition all .3s ease - - &:hover - border-color rgba(#000, 0.2) - transition all .1s ease - - &:focus - color $theme-color !important - border-color $theme-color - box-shadow 0 0 0 1024px #fff inset, 0 0 0 4px rgba($theme-color, 10%) - transition all 0s ease - - &:disabled - opacity 0.5 - .agree-tou padding 4px border-radius 4px @@ -267,19 +162,4 @@ export default Vue.extend({ display inline color #555 - button - margin 0 - padding 16px - width 100% - font-size 1em - color #fff - background $theme-color - border-radius 3px - - &:hover - background lighten($theme-color, 5%) - - &:active - background darken($theme-color, 5%) - diff --git a/src/client/app/common/views/components/material/button.vue b/src/client/app/common/views/components/ui/button.vue similarity index 83% rename from src/client/app/common/views/components/material/button.vue rename to src/client/app/common/views/components/ui/button.vue index 8dacedbac6..57747fd469 100644 --- a/src/client/app/common/views/components/material/button.vue +++ b/src/client/app/common/views/components/ui/button.vue @@ -25,7 +25,7 @@ export default Vue.extend({ > button display block width 100% - margin 32px 0 16px 0 + margin 0 padding 0 color $theme-color-foreground font-weight bold @@ -37,4 +37,10 @@ export default Vue.extend({ outline none box-shadow none + &:hover + background lighten($theme-color, 5%) + + &:active + background darken($theme-color, 5%) + diff --git a/src/client/app/common/views/components/ui/form.vue b/src/client/app/common/views/components/ui/form.vue new file mode 100644 index 0000000000..0893af1bce --- /dev/null +++ b/src/client/app/common/views/components/ui/form.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/src/client/app/common/views/components/ui/group.vue b/src/client/app/common/views/components/ui/group.vue new file mode 100644 index 0000000000..fb29458ce8 --- /dev/null +++ b/src/client/app/common/views/components/ui/group.vue @@ -0,0 +1,23 @@ + + + + + diff --git a/src/client/app/common/views/components/ui/input.vue b/src/client/app/common/views/components/ui/input.vue new file mode 100644 index 0000000000..7461aac7fe --- /dev/null +++ b/src/client/app/common/views/components/ui/input.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/src/client/app/common/views/components/ui/switch.vue b/src/client/app/common/views/components/ui/switch.vue new file mode 100644 index 0000000000..2cac6262f1 --- /dev/null +++ b/src/client/app/common/views/components/ui/switch.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/src/client/app/common/views/components/material/input.vue b/src/client/app/common/views/components/ui/textarea.vue similarity index 64% rename from src/client/app/common/views/components/material/input.vue rename to src/client/app/common/views/components/ui/textarea.vue index 6564b3aa6c..0a9f60f1bc 100644 --- a/src/client/app/common/views/components/material/input.vue +++ b/src/client/app/common/views/components/ui/textarea.vue @@ -1,17 +1,17 @@