9 | {{#icon}}
10 |
{{{.}}}
11 | {{/icon}}
12 |
{{{msg}}}
13 | {{#btns}}
14 |
21 | {{/btns}}
22 | {{^btns}}
23 |
{{{closeIcon}}}
24 | {{/btns}}
25 |
26 |
`;
27 | };
28 |
29 | TOAST.tmpl = {
30 | "toastDisplay": toastDisplay,
31 |
32 | get: function (tmplName, data, columnKeys) {
33 | return ax5.mustache.render(TOAST.tmpl[tmplName].call(this, columnKeys), data);
34 | }
35 | };
36 |
37 | })();
--------------------------------------------------------------------------------
/src/scss/_ax5toast.scss:
--------------------------------------------------------------------------------
1 | @mixin ax-toast() {
2 | box-sizing: $ax5toast-box-model;
3 | border: $ax5toast-border;
4 | opacity: $ax5toast-opacity;
5 |
6 | @include ax-border-radius($ax5toast-border-radius);
7 | box-shadow: $ax5toast-box-shadow;
8 | position: relative;
9 | margin: $ax5toast-box-margin;
10 | }
11 |
12 | @mixin ax-toast-section() {
13 | display: table;
14 | padding: $ax5toast-body-padding;
15 | .ax-toast-icon {
16 | display: table-cell;
17 | padding: $ax5toast-body-padding;
18 | text-align: left;
19 | font-size: $ax5toast-icon-size;
20 | width: $ax5toast-icon-size;
21 | vertical-align: middle;
22 | }
23 | .ax-toast-body {
24 | display: table-cell;
25 | padding: $ax5toast-body-padding;
26 | text-align: left;
27 | vertical-align: middle;
28 | }
29 | .ax-toast-buttons {
30 | display: table-cell;
31 | padding: $ax5toast-body-padding;
32 | text-align: right;
33 | vertical-align: middle;
34 | button {
35 | &:not(:last-child) {
36 | margin-right: 3px;
37 | }
38 | }
39 | }
40 | .ax-toast-close {
41 | display: table-cell;
42 | padding: $ax5toast-body-padding;
43 | text-align: right;
44 | vertical-align: top;
45 | text-decoration: none;
46 | cursor: pointer;
47 | }
48 | }
49 |
50 | @mixin toast-variant($text-color, $bg-color, $color) {
51 | background: $bg-color;
52 | color: $text-color;
53 | .ax-toast-icon {
54 | color: $color;
55 | }
56 | .ax-toast-close {
57 | color: $text-color;
58 | }
59 | }
60 |
61 | @include keyframes(ax-toast-bottom) {
62 | from {
63 | @include transform(translateY(-100px) scale(0.7));
64 | }
65 | to {
66 | //@include opacity($mask-bg-opacity);
67 | @include transform(translateY(0px) scale(1))
68 | }
69 | }
70 |
71 | @include keyframes(ax-toast-top) {
72 | from {
73 | @include transform(translateY(100px) scale(0.7));
74 | }
75 | to {
76 | //@include opacity($mask-bg-opacity);
77 | @include transform(translateY(0px) scale(1))
78 | }
79 | }
80 |
81 | @include keyframes(ax-toast-removed-bottom) {
82 | from {
83 | @include transform(translateY(0px));
84 | opacity: 1.0;
85 | }
86 | to {
87 | @include transform(translateY(10px) scale(0.7));
88 | opacity: 0.0;
89 | }
90 | }
91 |
92 | @include keyframes(ax-toast-removed-top) {
93 | from {
94 | @include transform(translateY(0px));
95 | opacity: 1.0;
96 | }
97 | to {
98 | @include transform(translateY(-10px) scale(0.7));
99 | opacity: 0.0;
100 | }
101 | }
102 |
103 | @include keyframes(ax-toast-destroy) {
104 | from {
105 | @include transform(scale(1));
106 | opacity: 1.0;
107 | }
108 | to {
109 | @include transform(scale(1.5));
110 | opacity: 0.0;
111 | }
112 | }
113 |
114 | // mixins --------------------------------------------- end
115 |
116 | .ax5-ui-toast-container {
117 | z-index: $ax5toast-z-index;
118 | position: fixed;
119 | width: $ax5toast-container-width;
120 | padding: $ax5toast-container-padding;
121 |
122 | box-sizing: border-box;
123 | *,
124 | *:before,
125 | *:after {
126 | box-sizing: border-box;
127 | }
128 |
129 | .ax5-ui-toast {
130 | @include ax-toast();
131 | @include ax-toast-section();
132 | @include transition(all $ax5toast-easing-time ease-in-out);
133 |
134 | @include toast-variant($ax5toast-default-text, $ax5toast-default-bg, $ax5toast-default-color);
135 |
136 | &.primary {
137 | @include toast-variant($ax5toast-primary-text, $ax5toast-primary-bg, $ax5toast-primary-color);
138 | }
139 | &.success {
140 | @include toast-variant($ax5toast-success-text, $ax5toast-success-bg, $ax5toast-success-color);
141 | }
142 | &.info {
143 | @include toast-variant($ax5toast-info-text, $ax5toast-info-bg, $ax5toast-info-color);
144 | }
145 | &.warning {
146 | @include toast-variant($ax5toast-warning-text, $ax5toast-warning-bg, $ax5toast-warning-color);
147 | }
148 | &.danger {
149 | @include toast-variant($ax5toast-danger-text, $ax5toast-danger-bg, $ax5toast-danger-color);
150 | }
151 | }
152 |
153 | &.bottom-left {
154 | left: 0;
155 | bottom: 0;
156 |
157 | .ax5-ui-toast {
158 | @include animation(ax-toast-top $ax5toast-easing-time $ax5toast-easing);
159 | &.removed {
160 | @include animation(ax-toast-removed-bottom $ax5toast-easing-time ease forwards);
161 | }
162 | &.destroy {
163 | @include animation(ax-toast-destroy $ax5toast-easing-time ease forwards);
164 | }
165 | }
166 | }
167 | &.bottom-right {
168 | right: 0;
169 | bottom: 0;
170 |
171 | .ax5-ui-toast {
172 | @include animation(ax-toast-top $ax5toast-easing-time $ax5toast-easing);
173 | &.removed {
174 | @include animation(ax-toast-removed-bottom $ax5toast-easing-time ease forwards);
175 | }
176 | &.destroy {
177 | @include animation(ax-toast-destroy $ax5toast-easing-time ease forwards);
178 | }
179 | }
180 |
181 | }
182 |
183 | &.top-left {
184 | left: 0;
185 | top: 0;
186 |
187 | .ax5-ui-toast {
188 | @include animation(ax-toast-bottom $ax5toast-easing-time $ax5toast-easing);
189 |
190 | &.removed {
191 | @include animation(ax-toast-removed-top $ax5toast-easing-time ease forwards);
192 | }
193 | &.destroy {
194 | @include animation(ax-toast-destroy $ax5toast-easing-time ease forwards);
195 | }
196 | }
197 | }
198 |
199 | &.top-right {
200 | right: 0;
201 | top: 0;
202 |
203 | .ax5-ui-toast {
204 | @include animation(ax-toast-bottom $ax5toast-easing-time $ax5toast-easing);
205 | &.removed {
206 | @include animation(ax-toast-removed-top $ax5toast-easing-time ease forwards);
207 | }
208 | &.destroy {
209 | @include animation(ax-toast-destroy $ax5toast-easing-time ease forwards);
210 | }
211 | }
212 | }
213 |
214 | }
215 |
216 |
--------------------------------------------------------------------------------
/src/scss/_ax5toast_variables.scss:
--------------------------------------------------------------------------------
1 | $gray-base: #000 !default;
2 | $gray-darker: lighten($gray-base, 13.5%) !default; // #222
3 | $gray-dark: lighten($gray-base, 20%) !default; // #333
4 | $gray: lighten($gray-base, 33.5%) !default; // #555
5 | $gray-light: lighten($gray-base, 46.7%) !default; // #777
6 | $gray-lighter: lighten($gray-base, 93.5%) !default; // #eee
7 |
8 | $brand-primary: #616161 !default; // #337ab7
9 | $brand-success: #00C6AE !default;
10 | $brand-info: #44ADF9 !default;
11 | $brand-fn1: #6977CF !default;
12 | $brand-fn2: #485398 !default;
13 | $brand-warning: #FFB802 !default;
14 | $brand-danger: #E97426 !default;
15 |
16 | $border-radius-base: 3px !default;
17 | $border-radius-large: 5px !default;
18 | $border-radius-small: 2px !default;
19 |
20 |
21 | //== Form states and alerts
22 | //
23 | //## Define colors for form feedback states and, by default, alerts.
24 |
25 | $state-success-text: #3c763d !default;
26 | $state-success-bg: #dff0d8 !default;
27 | $state-success-border: darken(adjust-hue($state-success-bg, -10), 5%) !default;
28 |
29 | $state-info-text: #31708f !default;
30 | $state-info-bg: #d9edf7 !default;
31 | $state-info-border: darken(adjust-hue($state-info-bg, -10), 7%) !default;
32 |
33 | $state-warning-text: #8a6d3b !default;
34 | $state-warning-bg: #fcf8e3 !default;
35 | $state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%) !default;
36 |
37 | $state-danger-text: #a94442 !default;
38 | $state-danger-bg: #f2dede !default;
39 | $state-danger-border: darken(adjust-hue($state-danger-bg, -10), 5%) !default;
40 |
41 | //== Panels
42 | //
43 | //##
44 |
45 | $panel-bg: #fff !default;
46 | $panel-body-padding: 15px !default;
47 | $panel-heading-padding: 10px 15px !default;
48 | $panel-footer-padding: $panel-heading-padding !default;
49 | $panel-border-radius: $border-radius-base !default;
50 |
51 | //** Border color for elements within panels
52 | $panel-inner-border: #ddd !default;
53 | $panel-footer-bg: #f5f5f5 !default;
54 |
55 | $panel-default-text: $gray-dark !default;
56 | $panel-default-border: #ddd !default;
57 | $panel-default-heading-bg: #f5f5f5 !default;
58 |
59 | $panel-primary-text: #fff !default;
60 | $panel-primary-border: $brand-primary !default;
61 | $panel-primary-heading-bg: $brand-primary !default;
62 |
63 | $panel-success-text: $state-success-text !default;
64 | $panel-success-border: $state-success-border !default;
65 | $panel-success-heading-bg: $state-success-bg !default;
66 |
67 | $panel-info-text: $state-info-text !default;
68 | $panel-info-border: $state-info-border !default;
69 | $panel-info-heading-bg: $state-info-bg !default;
70 |
71 | $panel-warning-text: $state-warning-text !default;
72 | $panel-warning-border: $state-warning-border !default;
73 | $panel-warning-heading-bg: $state-warning-bg !default;
74 |
75 | $panel-danger-text: $state-danger-text !default;
76 | $panel-danger-border: $state-danger-border !default;
77 | $panel-danger-heading-bg: $state-danger-bg !default;
78 |
79 |
80 | //============== toast
81 | $ax5toast-z-index: 2000;
82 | // 0:left,top / 1:right,top / 2:right,bottom / 3:left,bottom
83 | $ax5toast-container-width: auto !default;
84 | $ax5toast-container-padding: 10px !default;
85 | $ax5toast-box-model: border-box !default;
86 | $ax5toast-border: 1px solid rgb(255/2, 255/2, 255/2) !default;
87 | $ax5toast-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.175) !default;
88 | $ax5toast-body-padding: 6px !default;
89 | $ax5toast-border-radius: 8px !default;
90 | $ax5toast-opacity: 0.9 !default;
91 | $ax5toast-box-margin: 5px 0px 5px 0px !default;
92 | $ax5toast-icon-size: 24px;
93 | $ax5toast-easing: $ease-in-out-quint;
94 | $ax5toast-easing-time: 0.3s;
95 |
96 | //** Border color for elements within toast
97 | $ax5toast-default-text: $panel-default-text !default;
98 | $ax5toast-default-bg: $panel-bg !default;
99 | $ax5toast-default-color: $text-color !default;
100 |
101 | $ax5toast-primary-text: $brand-primary !default;
102 | $ax5toast-primary-bg: $panel-bg !default;
103 | $ax5toast-primary-color: $brand-primary !default;
104 |
105 | $ax5toast-success-text: $brand-success !default;
106 | $ax5toast-success-bg: $panel-bg !default;
107 | $ax5toast-success-color: $brand-success !default;
108 |
109 | $ax5toast-info-text: $brand-info !default;
110 | $ax5toast-info-bg: $panel-bg !default;
111 | $ax5toast-info-color: $brand-info !default;
112 |
113 | $ax5toast-warning-text: $brand-warning !default;
114 | $ax5toast-warning-bg: $panel-bg !default;
115 | $ax5toast-warning-color: $brand-warning !default;
116 |
117 | $ax5toast-danger-text: $brand-danger !default;
118 | $ax5toast-danger-bg: $panel-bg !default;
119 | $ax5toast-danger-color: $brand-danger !default;
--------------------------------------------------------------------------------
/test/README.md:
--------------------------------------------------------------------------------
1 | # STEP 01
2 | ```
3 | $ bower install
4 | ```
5 | `test/bower_components` folder is created, plug-ins required will be downloaded.
6 |
7 | # STEP 02
8 | It'll add the plugin resources to html> head.
9 | ```html
10 |
11 |
12 |
13 |