diff --git a/css/main.css b/css/main.css index 142ca33..0a6dd99 100644 --- a/css/main.css +++ b/css/main.css @@ -73,6 +73,10 @@ body { margin-right: auto; } +#toggle-btn{ + text-align: center; +} + #icon-up-arrow{ width: 1%; height: 1%; diff --git a/index.html b/index.html index 38840cf..d6a0945 100644 --- a/index.html +++ b/index.html @@ -60,7 +60,7 @@
- + @@ -68,16 +68,13 @@
-
- Diagramm - +
diff --git a/js/main.js b/js/main.js index 4336640..2c6f790 100644 --- a/js/main.js +++ b/js/main.js @@ -31,8 +31,8 @@ var slyelement = { }; -preprocessor.load(function(data) { - slyelement.obj = new Sly($(slyelement.el), slyelement.options); +preprocessor.load(function(data) { + slyelement.obj = new Sly($(slyelement.el), slyelement.options); slyelement.obj.init(); // Some sample code for a year selector - TODO: Improve a lot and move somewhere else @@ -41,7 +41,7 @@ preprocessor.load(function(data) { var seasons = processor.getSeasonsWithLapData(); for(var season in seasons){ yearSelector.append(""); } - + // Someone chose a year yearSelector.change(function(event) { var selectedYear = $(event.target).val(); @@ -62,7 +62,7 @@ preprocessor.load(function(data) { $("#lineGraphBox").empty(); createLineGraph("#lineGraphBox", rdata); }); - slyelement.obj.reload(); + slyelement.obj.reload(); } slyelement.obj.reload(); @@ -82,6 +82,30 @@ preprocessor.load(function(data) { slyelement.obj.reload(); }); + $( "#toggle-btn" ).click(function() { + if ( $( "#selector-card .card-body" ).is( ":hidden" ) ) { + $( "#selector-card .card-body" ).slideDown(); + $('#icon-up-arrow').animate({ borderSpacing: 0 - 90 }, { + step: function(now,fx) { + $(this).css('-webkit-transform','rotate('+now+'deg)'); + $(this).css('-moz-transform','rotate('+now+'deg)'); + $(this).css('transform','rotate('+now+'deg)'); + }, + duration: 150 + },'linear'); + } else { + $( "#selector-card .card-body" ).slideUp(); + $('#icon-up-arrow').animate({ borderSpacing: 180 - 90 }, { + step: function(now,fx) { + $(this).css('-webkit-transform','rotate('+now+'deg)'); + $(this).css('-moz-transform','rotate('+now+'deg)'); + $(this).css('transform','rotate('+now+'deg)'); + }, + duration: 150 + },'linear'); + } + }); + $("#seasonByYearSelector").trigger("change"); });