Procházet zdrojové kódy

Applied updated design for notifications

j8
Maxim Voloshin před 9 roky
rodič
revize
abb1482456
4 změnil soubory, kde provedl 150 přidání a 206 odebrání
  1. 77
    38
      css/_mixins.scss
  2. 61
    167
      css/_toastr.scss
  3. 11
    0
      css/_variables.scss
  4. 1
    1
      css/buttons/_button-control.scss

+ 77
- 38
css/_mixins.scss Zobrazit soubor

@@ -19,11 +19,11 @@
19 19
 }
20 20
 
21 21
 @mixin flex() {
22
-    display: -webkit-box;
23
-    display: -moz-box;
24
-    display: -ms-flexbox;
25
-    display: -webkit-flex;
26
-    display: flex;
22
+  display: -webkit-box;
23
+  display: -moz-box;
24
+  display: -ms-flexbox;
25
+  display: -webkit-flex;
26
+  display: flex;
27 27
 }
28 28
 
29 29
 /**
@@ -45,53 +45,92 @@
45 45
 }
46 46
 
47 47
 @mixin circle($diameter) {
48
-    width: $diameter;
49
-    height: $diameter;
50
-    border-radius: 50%;
48
+  width: $diameter;
49
+  height: $diameter;
50
+  border-radius: 50%;
51 51
 }
52 52
 
53 53
 @mixin absoluteAligning($sizeX, $sizeY) {
54
-    top: 50%;
55
-    left: 50%;
56
-    position: absolute;
57
-    @include transform(translate(-#{$sizeX / 2}, -#{$sizeY / 2}))
54
+  top: 50%;
55
+  left: 50%;
56
+  position: absolute;
57
+  @include transform(translate(-#{$sizeX / 2}, -#{$sizeY / 2}))
58 58
 }
59 59
 
60 60
 @mixin transform($func) {
61
-    -moz-transform: $func;
62
-    -ms-transform: $func;
63
-    -webkit-transform: $func;
64
-    -o-transform: $func;
65
-    transform: $func;
61
+  -moz-transform: $func;
62
+  -ms-transform: $func;
63
+  -webkit-transform: $func;
64
+  -o-transform: $func;
65
+  transform: $func;
66 66
 }
67 67
 
68 68
 @mixin transition($transition...) {
69
-    -moz-transition:    $transition;
70
-    -o-transition:      $transition;
71
-    -webkit-transition: $transition;
72
-    transition:         $transition;
73
-}
74
-
75
-@mixin box-shadow($type, $h, $y, $blur, $color) {
76
-    -webkit-box-shadow: $type $h $y $blur $color;
77
-    -moz-box-shadow: $type $h $y $blur $color;
78
-    box-shadow: $type $h $y $blur $color;
69
+  -moz-transition:    $transition;
70
+  -o-transition:      $transition;
71
+  -webkit-transition: $transition;
72
+  transition:         $transition;
79 73
 }
80 74
 
81 75
 /**
82 76
 * Mixin styling placeholder
83 77
 **/
84 78
 @mixin placeholder() {
85
-    $selectors: (
86
-        "::-webkit-input-placeholder",
87
-        "::-moz-placeholder",
88
-        ":-moz-placeholder",
89
-        ":-ms-input-placeholder"
90
-    );
91
-
92
-    @each $selector in $selectors {
93
-        #{$selector} {
94
-            @content;
95
-        }
79
+  $selectors: (
80
+          "::-webkit-input-placeholder",
81
+          "::-moz-placeholder",
82
+          ":-moz-placeholder",
83
+          ":-ms-input-placeholder"
84
+  );
85
+
86
+  @each $selector in $selectors {
87
+    #{$selector} {
88
+      @content;
96 89
     }
90
+  }
91
+}
92
+
93
+@mixin box-shadow($h, $y, $blur, $color, $inset: false) {
94
+  @if $inset {
95
+    -webkit-box-shadow: inset $h $y $blur $color;
96
+    -moz-box-shadow: inset $h $y $blur $color;
97
+    box-shadow: inset $h $y $blur $color;
98
+  } @else {
99
+    -webkit-box-shadow: $h $y $blur $color;
100
+    -moz-box-shadow: $h $y $blur $color;
101
+    box-shadow: $h $y $blur $color;
102
+  }
103
+}
104
+
105
+@mixin no-box-shadow {
106
+  -webkit-box-shadow: none;
107
+  -moz-box-shadow: none;
108
+  box-shadow: none;
109
+}
110
+
111
+@mixin box-sizing($box-model) {
112
+  -webkit-box-sizing: $box-model; // Safari <= 5
113
+     -moz-box-sizing: $box-model; // Firefox <= 19
114
+          box-sizing: $box-model;
115
+}
116
+
117
+@mixin border-radius($radius) {
118
+  -webkit-border-radius: $radius;
119
+  border-radius: $radius;
120
+  /* stops bg color from leaking outside the border: */
121
+  background-clip: padding-box;
122
+}
123
+
124
+@mixin opacity($opacity) {
125
+  opacity: $opacity;
126
+  $opacity-ie: $opacity * 100;
127
+  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=$opacity-ie);
128
+  filter: alpha(opacity=$opacity-ie); //IE8
129
+}
130
+
131
+@mixin text-truncate {
132
+  display: block;
133
+  overflow: hidden;
134
+  text-overflow: ellipsis;
135
+  white-space: nowrap;
97 136
 }

+ 61
- 167
css/_toastr.scss Zobrazit soubor

@@ -7,206 +7,100 @@
7 7
  *
8 8
  * Author: John Papa and Hans Fjällemark
9 9
  * Project: https://github.com/CodeSeven/toastr
10
+ * 
11
+ * Last updated: October 13, 2016
10 12
  */
11
-.toast-title {
13
+
14
+.toast-title,
15
+.toast-message .nickname {
12 16
   font-weight: bold;
17
+  margin: 0 0 3px;
18
+  @include text-truncate;
13 19
 }
20
+
14 21
 .toast-message {
15 22
   -ms-word-wrap: break-word;
16 23
   word-wrap: break-word;
17 24
 }
25
+
18 26
 .toast-message a,
19
-.toast-message label {
20
-  color: #ffffff;
27
+.toast-message label,
28
+.toast-message .connected,
29
+.toast-message .disconnected {
30
+  color: $notificationLinkColor;
31
+  text-decoration: none;
21 32
 }
22 33
 
23
-.toast-message .nickname {
24
-  font-weight: bold;
34
+.toast-message a:hover {
35
+  text-decoration: underline;
25 36
 }
26 37
 
27
-.toast-message a:hover {
28
-  color: #cccccc;
29
-  text-decoration: none;
38
+.toast-message br {
39
+  display: none;
30 40
 }
31 41
 
42
+// close button
32 43
 .toast-close-button {
33
-  position: relative;
34
-  right: -0.3em;
35
-  top: -0.3em;
36
-  float: right;
44
+  color: $notificationColor;
45
+  background: transparent;
46
+
37 47
   font-size: 15px;
38
-  height: 15px;
39
-  width: 15px;
40
-  font-weight: bold;
41
-  color: #ffffff;
42
-  background: transparent !important;
43
-  -webkit-text-shadow: 0 1px 0 #ffffff;
44
-  text-shadow: 0 1px 0 #ffffff;
45
-  opacity: 0.8;
46
-  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
47
-  filter: alpha(opacity=80);
48
-}
48
+  line-height: 1.2;
49 49
 
50
-.toast-close-button:hover,
51
-.toast-close-button:focus {
52
-  color: #ffffff;
53
-  text-decoration: none;
54
-  cursor: pointer;
55
-  opacity: 1;
56
-  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
57
-  filter: alpha(opacity=100);
58
-}
59
-/*Additional properties for button version
60
- iOS requires the button element instead of an anchor tag.
61
- If you want the anchor version, it requires `href="#"`.*/
62
-button.toast-close-button {
50
+  height: 20px;
51
+  width: 20px;
63 52
   padding: 0;
64
-  cursor: pointer;
65
-  background: transparent;
66 53
   border: 0;
67
-  -webkit-appearance: none;
68
-}
69
-.toast-top-full-width {
70
-  top: 0;
71
-  right: 0;
72
-  width: 100%;
73
-}
74
-.toast-bottom-full-width {
75
-  bottom: 0;
76
-  right: 0;
77
-  width: 100%;
78
-}
79
-.toast-top-left {
80
-  top: 12px;
81
-  left: 12px;
82
-}
83
-.toast-top-right {
84
-  top: 12px;
85
-  right: 12px;
86
-}
87
-.toast-bottom-right {
88
-  right: 12px;
89
-  bottom: 12px;
90
-}
91
-.toast-bottom-left {
92
-  bottom: 12px;
93
-  left: 12px;
94
-}
95
-#toast-container {
96
-  position: fixed;
97
-  z-index: 1012;
98
-  /*overrides*/
54
+  margin: -6px -10px 0 0;
55
+  float: right;
99 56
 
100
-}
101
-#toast-container * {
102
-  -moz-box-sizing: border-box;
103
-  -webkit-box-sizing: border-box;
104
-  box-sizing: border-box;
105
-}
106
-#toast-container > div {
107
-  margin: 0 0 6px;
108
-  padding: 15px 15px 15px 15px;
109
-  width: 300px;
110
-  -moz-border-radius: 3px 3px 3px 3px;
111
-  -webkit-border-radius: 3px 3px 3px 3px;
112
-  border-radius: 3px 3px 3px 3px;
113
-  background-position: 15px center;
114
-  background-repeat: no-repeat;
115
-  -moz-box-shadow: 0 0 12px #999999;
116
-  -webkit-box-shadow: 0 0 12px #999999;
117
-  box-shadow: 0 0 12px #999999;
118
-  color: #ffffff;
119
-  opacity: 0.8;
120
-  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
121
-  filter: alpha(opacity=80);
122
-}
123
-#toast-container > :hover {
124
-  -moz-box-shadow: 0 0 12px #000000;
125
-  -webkit-box-shadow: 0 0 12px #000000;
126
-  box-shadow: 0 0 12px #000000;
127
-  opacity: 1;
128
-  -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
129
-  filter: alpha(opacity=100);
130 57
   cursor: pointer;
131
-}
132
-#toast-container .toast-info,
133
-#toast-container .toast-success,
134
-#toast-container .toast-error,
135
-#toast-container .toast-warning
136
-{
137
-  padding: 10px 10px 10px 10px !important;
58
+  @include opacity(0.4);
59
+  /* Additional properties for button version
60
+  iOS requires the button element instead of an anchor tag.
61
+  If you want the anchor version, it requires `href="#"`. */
62
+  -webkit-appearance: none;
138 63
 }
139 64
 
140
-#toast-container.toast-top-full-width > div,
141
-#toast-container.toast-bottom-full-width > div {
142
-  width: 100%;
143
-  margin: auto;
65
+.toast-close-button:hover,
66
+.toast-close-button:focus {
67
+  @include opacity(1);
144 68
 }
69
+
70
+
145 71
 .toast {
146
-  background-color: #030303;
147
-}
148
-.toast-success {
149
-  background-color: #51a351;
150
-}
151
-.toast-error {
152
-  background-color: #bd362f;
153
-}
154
-.toast-info {
155
-  background-color: #2f96b4;
156
-}
157
-.toast-warning {
158
-  background-color: #f89406;
159
-}
160
-/*Responsive Design*/
161
-@media all and (max-width: 240px) {
162
-  #toast-container > div {
163
-    padding: 8px 8px 8px 8px;
164
-    width: 11em;
165
-  }
166
-  #toast-container .toast-close-button {
167
-    right: -0.2em;
168
-    top: -0.2em;
169
-  }
170
-}
171
-@media all and (min-width: 241px) and (max-width: 480px) {
172
-  #toast-container > div {
173
-    padding: 8px 8px 8px 8px;
174
-    width: 18em;
175
-  }
176
-  #toast-container .toast-close-button {
177
-    right: -0.2em;
178
-    top: -0.2em;
179
-  }
180
-}
181
-@media all and (min-width: 481px) and (max-width: 768px) {
182
-  #toast-container > div {
183
-    padding: 15px 15px 15px 15px;
184
-    width: 25em;
185
-  }
72
+  color: $notificationColor;
73
+  background-color: $notificationBackground;
74
+
75
+  font-size: $notificationFontSize;
76
+
77
+  padding: $notificationPadding;
78
+  border: 1px solid lighten($notificationBackground, 10%);
79
+
80
+  @include border-radius($notificationBorderRadius); 
81
+  @include box-shadow(1px, 1px, 2px, rgba(0,0,0,0.3));
82
+  @include opacity(0.9);
186 83
 }
187 84
 
188
-#toast-container.notification-bottom-right {
189
-  bottom: 140px;
190
-  right: 5px;
85
+.toast:hover {
86
+  @include opacity(1);
191 87
 }
192 88
 
193
-#toast-container.notification-bottom-right-center {
194
-  right: 205px;
89
+#toast-container {
90
+  position: fixed;
91
+  z-index: $notificationZ;
195 92
 }
196 93
 
197
-#toast-container .toast-info {
198
-  -webkit-box-shadow: none;
199
-  box-shadow: none;
94
+#toast-container.notification-bottom-right {
95
+  bottom: 135px;
96
+  right: 13px;
200 97
 }
201 98
 
202
-.toast-close-button {
203
-  right: -7px;
204
-  top: -19px;
99
+#toast-container * {
100
+  @include box-sizing(border-box);
205 101
 }
206 102
 
207
-#toast-container .toast-info {
208
-  background-color: black;
209
-  border: 1px solid #3a3a3a;
210
-  width: 220px;
211
-  padding: 10px 10px 10px 50px;
103
+#toast-container .toast {
104
+  width: 200px;
105
+  margin: 0 0 8px;
212 106
 }

+ 11
- 0
css/_variables.scss Zobrazit soubor

@@ -66,6 +66,16 @@ $rateStarActivity: #165ecc;
66 66
 $rateStarSize: 34px;
67 67
 $feedbackCancelFontColor: #333;
68 68
 
69
+// Notifications
70
+$notificationFontSize: 13px;
71
+$notificationColor: #FFFFFF;
72
+$notificationBackground: $tooltipBg;
73
+$notificationTitleColor: $notificationColor;
74
+$notificationMessageColor: $notificationColor;
75
+$notificationPadding: 15px 20px;
76
+$notificationBorderRadius: 4px;
77
+$notificationLinkColor: $notificationColor;
78
+
69 79
 /**
70 80
  * Misc.
71 81
  */
@@ -79,6 +89,7 @@ $sidebarWidth: 200px;
79 89
 $tooltipsZ: 901;
80 90
 $toolbarZ: 900;
81 91
 $overlayZ: 800;
92
+$notificationZ: 1012;
82 93
 
83 94
 /**
84 95
  * Font Colors TODO: Change colors when general dialogs are implemented.

+ 1
- 1
css/buttons/_button-control.scss Zobrazit soubor

@@ -34,7 +34,7 @@
34 34
     }
35 35
 
36 36
     &:active {
37
-        @include box-shadow(inset, 0, 0, 1px, $buttonShadowColor);
37
+        @include box-shadow(0, 0, 1px, $buttonShadowColor, true);
38 38
     }
39 39
 
40 40
     &_light {

Načítá se…
Zrušit
Uložit