-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtoastNotifications.less
More file actions
executable file
·173 lines (166 loc) · 3.73 KB
/
toastNotifications.less
File metadata and controls
executable file
·173 lines (166 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
// Color Variables
// Should be moved to toastNotifications.vars.less
@toastBackground: #3C3C3C;
@toastBorder: #BABABA;
@white: #FFFFFF;
@red: #C70207;
// Animations
// Fade in
.enterFrames(){
0%{
opacity:0;
height:0;
padding:0;
line-height:0;
//overflow:hidden;
}
40%{
opacity:0;
height:auto;
padding:15px;
line-height:normal;
//overflow:hidden;
}
100%{
opacity:1;
height:auto;
padding:15px;
line-height:normal;
//overflow:auto;
}
}
@keyframes toastEnter { .enterFrames(); }
@-webkit-keyframes toastEnter { .enterFrames(); }
// Fade out
.exitFrames(){
0%{
opacity:1;
height:auto;
padding:15px;
line-height:normal;
//overflow:auto;
}
60%{
opacity:0;
height:auto;
padding:15px;
line-height:normal;
//overflow:auto;
}
100%{
opacity:0;
height:0;
padding:0;
line-height:0;
//overflow:hidden;
}
}
@keyframes toastExit { .exitFrames(); }
@-webkit-keyframes toastExit { .exitFrames(); }
// END Animations
// Mixins
.animation(@arguments){
-webkit-animation: @arguments;
-moz-animation: @arguments;
animation: @arguments;
}
.animation-fill-mode(@arguments){
animation-fill-mode:@arguments;
-webkit-animation-fill-mode:@arguments;
-moz-animation-fill-mode:@arguments;
-o-animation-fill-mode:@arguments;
}
.transition(@duration: 0.2s, @ease: ease-out, @delay: 0s) {
-webkit-transition: all @duration @ease @delay;
-moz-transition: all @duration @ease @delay; // FF 4-15
-ms-transition: all @duration @ease @delay;
-o-transition: all @duration @ease @delay; // Opera 10.5-12.00
transition: all @duration @ease @delay; // FF 16+, Operal 12.50+
}
// Use this to use a sprite sheet for Toast Icons
.Sprite() {
// first param is the name of the sprite sheet
// second param is the path to the image folder the sprite sheet is located in
@url: %("%s/sprite.png", 'img');
background-image: url(@url);
background-repeat: no-repeat;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
// END Mixins
// Styles
.toastNotificationCenter{
&:empty{ opacity:0; line-height:0; }
display:block;
position:fixed;
top:70px; bottom:auto;
left:auto; right:50px;
width:500px;
padding:0; margin:0;
background-color:@toastBackground;
border:1px solid @toastBorder;
border-radius:4px;
box-shadow:2px 2px 5px 0px @toastBackground;
font-family: Helvetica, sans-serif;
overflow:hidden;
opacity:1;
z-index:10;
.transition(all 2800ms linear 0);
.toast{
display:block;
padding:15px;
height:auto;
background-color: @toastBackground;
color: @white;
border-bottom:1px solid @toastBorder;
position:relative;
overflow:hidden;
opacity:1;
.transition(all 2800ms linear 0);
.animation-fill-mode(forwards);
&:last-child{ border-bottom:0 none; }
&:before{
//content:"";
display:inline-block;
width:29px; height:28px;
position:absolute;
.Sprite();
background-position:-575px -261px;
}
&.info{
&:before{ content:""; background-position:-575px -261px; }
}
&.error{
&:before{ content:""; background-position:-605px -261px; }
}
&.success{
&:before{ content:""; background-position:-634px -261px; }
}
div.msg{
display:inline-block;
margin:7px 0 0 43px;
}
a{
cursor:pointer;
text-decoration:none;
color: @red;
&:hover, &:focus, &:active{ text-decoration:underline; }
}
&:not(.close) > span.close{ display:none; }
&>span.close{
display:block;
width:16px;
height:16px;
.Sprite();
background-position:-608px -292px;
position:absolute;
top:5px;
right:5px;
cursor:pointer;
&:hover, &:active, &:focus{
background-position:-608px -310px;
}
}
}
}