Skip to content

Commit 77e65d9

Browse files
added colors in navbar transparent dropdown default
fix design for alert added new function for animations for bar charts fixed issue with charts drawing on resize (still need a better solution) removed images sass
1 parent 96c15a8 commit 77e65d9

11 files changed

+99
-87
lines changed

assets/css/material-dashboard.css

Lines changed: 47 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/material-dashboard.css.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/demo.js

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,13 @@ demo = {
151151
md.startAnimationForLineChart(completedTasksChart);
152152

153153

154-
155154
var dataEmailsSubscriptionChart = {
156155
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
157156
series: [
158157
[542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]
159158

160159
]
161160
};
162-
163161
var optionsEmailsSubscriptionChart = {
164162
axisX: {
165163
showGrid: false
@@ -168,7 +166,6 @@ demo = {
168166
high: 1000,
169167
chartPadding: { top: 0, right: 5, bottom: 0, left: 0}
170168
};
171-
172169
var responsiveOptions = [
173170
['screen and (max-width: 640px)', {
174171
seriesBarDistance: 5,
@@ -179,28 +176,10 @@ demo = {
179176
}
180177
}]
181178
];
182-
183179
var emailsSubscriptionChart = Chartist.Bar('#emailsSubscriptionChart', dataEmailsSubscriptionChart, optionsEmailsSubscriptionChart, responsiveOptions);
184180

185-
186-
// Emails Subscriptions Chart Animation
187-
188-
var seq3 = 0, delays3 = 80, durations3 = 500;
189-
190-
emailsSubscriptionChart.on('draw', function(data) {
191-
if(data.type === 'bar'){
192-
seq3++;
193-
data.element.animate({
194-
opacity: {
195-
begin: seq3 * delays3,
196-
dur: durations3,
197-
from: 0,
198-
to: 1,
199-
easing: 'ease'
200-
}
201-
});
202-
}
203-
});
181+
//start animation for the Emails Subscription Chart
182+
md.startAnimationForBarChart(emailsSubscriptionChart);
204183

205184
},
206185

@@ -228,7 +207,7 @@ demo = {
228207
color = Math.floor((Math.random() * 4) + 1);
229208

230209
$.notify({
231-
icon: "add_alert",
210+
icon: "notifications",
232211
message: "Welcome to <b>Material Dashboard</b> - a beautiful freebie for every web developer."
233212

234213
},{

assets/js/material-dashboard.js

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ var mobile_menu_visible = 0,
99
toggle_initialized = false,
1010
bootstrap_nav_initialized = false;
1111

12+
var seq = 0, delays = 80, durations = 500;
13+
var seq2 = 0, delays2 = 80, durations2 = 500;
14+
15+
1216
$(document).ready(function(){
1317

1418
$sidebar = $('.sidebar');
@@ -47,6 +51,9 @@ $(document).ready(function(){
4751
$(window).resize(function(){
4852
md.initSidebarsCheck();
4953

54+
// reset the seq for charts drawing animations
55+
seq = seq2 = 0;
56+
5057
});
5158

5259
md = {
@@ -265,8 +272,6 @@ md = {
265272
}, 500),
266273

267274
startAnimationForLineChart: function(chart){
268-
// Completed Tasks Chart Animation
269-
var seq2 = 0, delays2 = 80, durations2 = 500;
270275

271276
chart.on('draw', function(data) {
272277
if(data.type === 'line' || data.type === 'area') {
@@ -280,18 +285,42 @@ md = {
280285
}
281286
});
282287
} else if(data.type === 'point') {
283-
seq2++;
288+
seq++;
284289
data.element.animate({
285290
opacity: {
286-
begin: seq2 * delays2,
287-
dur: durations2,
291+
begin: seq * delays,
292+
dur: durations,
288293
from: 0,
289294
to: 1,
290295
easing: 'ease'
291296
}
292297
});
298+
console.log('seq:' + seq);
293299
}
294300
});
301+
302+
seq = 0;
303+
},
304+
startAnimationForBarChart: function(chart){
305+
console.log('chart:', chart);
306+
307+
chart.on('draw', function(data) {
308+
if(data.type === 'bar'){
309+
seq2++;
310+
data.element.animate({
311+
opacity: {
312+
begin: seq2 * delays2,
313+
dur: durations2,
314+
from: 0,
315+
to: 1,
316+
easing: 'ease'
317+
}
318+
});
319+
console.log('seq:' + seq2);
320+
}
321+
});
322+
323+
seq2 = 0;
295324
}
296325
}
297326

assets/sass/material-dashboard.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
@import "md/mixins";
44
@import "md/shadows";
55

6-
76
//plugin css
87
@import "md/plugins/_plugin-nouislider";
98
@import "md/plugins/_animate";
@@ -27,11 +26,9 @@
2726
@import "md/popups";
2827
@import "md/footers";
2928

30-
3129
// Fancy Stuff
3230
@import "md/dropdown";
3331
@import "md/cards";
34-
@import "md/images";
3532
@import "md/tabs";
3633
@import "md/chartist";
3734
@import "md/responsive";

0 commit comments

Comments
 (0)