diff --git a/resources/assets/js/components/toggle-switch.vue b/resources/assets/js/components/toggle-switch.vue new file mode 100644 index 000000000..d677f6650 --- /dev/null +++ b/resources/assets/js/components/toggle-switch.vue @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/resources/assets/js/global.js b/resources/assets/js/global.js index a6fca8dbd..a3a2acf3b 100644 --- a/resources/assets/js/global.js +++ b/resources/assets/js/global.js @@ -40,6 +40,7 @@ Vue.use(require('vue-resource')); // Vue Components Vue.component('image-manager', require('./components/image-manager.vue')); Vue.component('image-picker', require('./components/image-picker.vue')); +Vue.component('toggle-switch', require('./components/toggle-switch.vue')); // Vue Controllers if(elemExists('#book-dashboard')) { diff --git a/resources/assets/sass/_forms.scss b/resources/assets/sass/_forms.scss index 11eac26a5..9f73fc272 100644 --- a/resources/assets/sass/_forms.scss +++ b/resources/assets/sass/_forms.scss @@ -47,6 +47,39 @@ input[type="text"], input[type="number"], input[type="email"], input[type="searc @extend .input-base; } +.toggle-switch { + display: inline-block; + background-color: #BBB; + width: 36px; + height: 14px; + border-radius: 7px; + position: relative; + transition: all ease-in-out 120ms; + cursor: pointer; + user-select: none; + .switch-handle { + display: block; + position: relative; + left: 0; + margin-top: -3px; + width: 20px; + height: 20px; + border-radius: 50%; + background-color: #fafafa; + border: 1px solid #CCC; + box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12); + transition: all ease-in-out 120ms; + } + &.active { + background-color: rgba($positive, 0.4); + .switch-handle { + left: 16px; + background-color: $positive; + border: darken($positive, 20%); + } + } +} + .form-group { margin-bottom: $-s; } diff --git a/resources/assets/sass/_grid.scss b/resources/assets/sass/_grid.scss index 4532cca6f..ddba1ee03 100644 --- a/resources/assets/sass/_grid.scss +++ b/resources/assets/sass/_grid.scss @@ -242,7 +242,7 @@ div[class^="col-"] img { .col-xs-offset-0 { margin-left: 0%; } -@media (min-width: 768px) { +@media (min-width: $screen-sm) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { float: left; } @@ -400,7 +400,7 @@ div[class^="col-"] img { margin-left: 0%; } } -@media (min-width: 992px) { +@media (min-width: $screen-md) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } @@ -558,7 +558,7 @@ div[class^="col-"] img { margin-left: 0%; } } -@media (min-width: 1200px) { +@media (min-width: $screen-lg) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } diff --git a/resources/assets/sass/_header.scss b/resources/assets/sass/_header.scss index 2e423250c..2035a1822 100644 --- a/resources/assets/sass/_header.scss +++ b/resources/assets/sass/_header.scss @@ -17,6 +17,9 @@ header { display: inline-block; vertical-align: top; margin-right: $-xl; + @include smaller-than($screen-md) { + margin-right: $-m; + } } .links a { display: inline-block; @@ -25,23 +28,63 @@ header { &:last-child { padding-right: 0; } + @include smaller-than($screen-md) { + padding: $-l $-s; + } } .avatar, .user-name { display: inline-block; } .avatar { - margin-top: (45px/2); + //margin-top: (45px/2); width: 30px; height: 30px; } .user-name { vertical-align: top; - padding-top: 25.5px; - padding-left: $-m; + padding-top: $-l; display: inline-block; cursor: pointer; - i { + > * { + vertical-align: top; + } + > span, > i { padding-left: $-xs; + display: inline-block; + } + > span { + padding-top: $-xxs; + } + > i { + padding-top: $-xs*1.2; + } + @include smaller-than($screen-md) { + padding-left: $-xs; + .name { + display: none; + } + i { + font-size: 2em; + padding-left: 0; + padding-top: 0; + } + } + } + @include smaller-than($screen-md) { + text-align: center; + .float.right { + float: none; + } + } + @include smaller-than($screen-sm) { + .links a { + padding: $-s; + } + form.search-box { + margin-top: 0; + } + .user-name { + padding-top: $-s; } } } @@ -117,6 +160,7 @@ form.search-box { min-width: 180px; padding: $-xs 0; color: #555; + text-align: left !important; a { display: block; padding: $-xs $-m; diff --git a/resources/assets/sass/_variables.scss b/resources/assets/sass/_variables.scss index 095a0e0dc..29a46302b 100644 --- a/resources/assets/sass/_variables.scss +++ b/resources/assets/sass/_variables.scss @@ -12,8 +12,8 @@ $m: 800px; $s: 600px; $xs: 400px; $xxs: 360px; -$screen-md: 992px; $screen-lg: 1200px; +$screen-md: 992px; $screen-sm: 768px; // Spacing (Margins+Padding) diff --git a/resources/views/base.blade.php b/resources/views/base.blade.php index 6a9da2099..80086a413 100644 --- a/resources/views/base.blade.php +++ b/resources/views/base.blade.php @@ -35,7 +35,7 @@