-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
85 lines (52 loc) · 1.57 KB
/
script.js
File metadata and controls
85 lines (52 loc) · 1.57 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
// Sliders
var slider = document.getElementById('song-progress');
noUiSlider.create(slider, {
start: [ 20 ],
range: {
'min': [ 0 ],
'max': [ 100 ]
}
});
var slider = document.getElementById('song-volume');
noUiSlider.create(slider, {
start: [ 90 ],
range: {
'min': [ 0 ],
'max': [ 100 ]
}
});
// Tooltips
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
// Viewport Heights
$(window).on("resize load", function(){
var totalHeight = $(window).height();
var headerHeight = $('.header').outerHeight();
var footerHeight = $('.current-track').outerHeight();
var playlistHeight = $('.playlist').outerHeight();
var nowPlaying = $('.playing').outerHeight();
var navHeight = totalHeight - (headerHeight + footerHeight + playlistHeight + nowPlaying);
var artistHeight = totalHeight - (headerHeight + footerHeight);
console.log(totalHeight);
$(".navigation").css("height" , navHeight);
$(".artist").css("height" , artistHeight);
$(".social").css("height" , artistHeight);
});
// Collapse Toggles
$(".navigation__list__header").on( "click" , function() {
$(this).toggleClass( "active" );
});
// Media Queries
$(window).on("resize load", function(){
if ($(window).width() <= 768){
$(".collapse").removeClass("in");
$(".navigation").css("height" , "auto");
$(".artist").css("height" , "auto");
}
});
$(window).on("resize load", function(){
if ($(window).width() > 768){
$(".collapse").addClass("in");
}
});