forked from GetmeUK/ContentTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_flashes.scss
More file actions
118 lines (104 loc) · 2.69 KB
/
Copy path_flashes.scss
File metadata and controls
118 lines (104 loc) · 2.69 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
/**
* Flashes are used to display a visual confirmation to the user that an action
* has completed successfully (or failed).
*/
.ct-widget {
/**
* The flash animation displays an icon in the center of the user's screen
* that flashes into view and then out.
*/
$flash-timer: 2s;
@include keyframes(flash) {
0% {
opacity: 0;
font-size: 32px;
@include transform(font-size);
}
25% {
font-size: 320px;
opacity: 1;
@include transform(all);
}
50% {
font-size: 320px;
opacity: 1;
@include transform(all);
}
75% {
font-size: 320px;
opacity: 1;
@include transform(all);
}
100% {
opacity: 0;
@include transform(all);
}
}
@mixin animation--flash() {
@include animation(flash $flash-timer ease-in);
@include animation-iteration-count(1);
@include animation-fill-mode(forwards);
}
/**
* The flash timer animation is used purely to indicated to the Javascript
* that created the flash element that the animation has finished.
*/
@include keyframes(flash-timer) {
0% {
opacity: 1;
@include transform(opacity);
}
99% {
opacity: 1;
@include transform(opacity);
}
100% {
opacity: 0;
@include transform(opacity);
}
}
@mixin animation--flash-timer() {
@include animation(flash-timer $flash-timer ease-in);
@include animation-iteration-count(1);
@include animation-fill-mode(forwards);
}
/**
* The icon that is flashed.
*/
&.ct-flash {
color: rgba(white, 0.9);
height: 0;
left: 0;
position: fixed;
@include type-icons;
top: 0;
width: 0;
z-index: $base-z-index + 1000;
&:before {
left: 50%;
opacity: 0;
position: fixed;
text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
top: 50%;
transform: translate(-50%, -50%);
}
&--active {
@include animation--flash-timer();
&:before {
@include animation--flash();
// Fallback for IE9
font-size: 320px;
opacity: 1;
}
}
/**
* Modifiers that can be applied to the flash to change it's appearance.
*/
&--ok:before {
content: '\ea10';
}
&--no:before {
content: '\ea0f';
}
}
}