forked from arjunmohnot/buHack
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjquery.drawsvg.js
142 lines (142 loc) · 6.29 KB
/
jquery.drawsvg.js
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
var bar = $("#bar"),
$window = $(window),
docHeight = $(document).height(),
baseX = ($window.height() / docHeight) * 90;
bar.css(
"background",
"-webkit-linear-gradient(left, #ef1b41 " +
baseX +
"%, #1b1b1b " +
baseX +
"%)"
),
$window.scroll(function (e) {
var t = ($window.scrollTop() / docHeight) * 100 + baseX;
t > 75
? bar.css(
"background",
"-webkit-linear-gradient(left, #178808 " +
t +
"%, #1b1b1b " +
t +
"%)"
)
: t > 50
? bar.css(
"background",
"-webkit-linear-gradient(left, #5271fe " +
t +
"%, #1b1b1b " +
t +
"%)"
)
: t > 25
? bar.css(
"background",
"-webkit-linear-gradient(left, #f3ab1b " +
t +
"%, #1b1b1b " +
t +
"%)"
)
: bar.css(
"background",
"-webkit-linear-gradient(left, #ef1b41 " +
t +
"%, #1b1b1b " +
t +
"%)"
);
let a = document.querySelectorAll(".ulc li a"),
s = window.pageYOffset;
for (let e of a) {
if ("#services" == e.hash && $(e.hash).offset().top - 20 > s) {
document.getElementById("0nav").classList.add("active"),
document.getElementById("1nav").classList.remove("active1"),
document.getElementById("2nav").classList.remove("active2"),
document.getElementById("3nav").classList.remove("active3"),
document.getElementById("4nav").classList.remove("active4"),
document.getElementById("5nav").classList.remove("active5"),
document.getElementById("6nav").classList.remove("active6");
document.getElementById("7nav").classList.remove("active7");
break;
}
if ("#footer" == e.hash && $(e.hash).offset().top - 20 > s) {
document.getElementById("0nav").classList.remove("active"),
document.getElementById("1nav").classList.remove("active1"),
document.getElementById("2nav").classList.remove("active2"),
document.getElementById("3nav").classList.remove("active3"),
document.getElementById("4nav").classList.remove("active4"),
document.getElementById("5nav").classList.remove("active5"),
document.getElementById("6nav").classList.remove("active6");
document.getElementById("7nav").classList.add("active7");
break;
}
if ("#contact" == e.hash && $(e.hash).offset().top - 20 > s) {
document.getElementById("0nav").classList.remove("active"),
document.getElementById("1nav").classList.remove("active1"),
document.getElementById("2nav").classList.remove("active2"),
document.getElementById("3nav").classList.remove("active3"),
document.getElementById("4nav").classList.remove("active4"),
document.getElementById("5nav").classList.remove("active5"),
document.getElementById("6nav").classList.add("active6");
document.getElementById("7nav").classList.remove("active7");
break;
}
if ("#faq" == e.hash && $(e.hash).offset().top - 20 > s) {
document.getElementById("0nav").classList.remove("active"),
document.getElementById("1nav").classList.remove("active1"),
document.getElementById("2nav").classList.remove("active2"),
document.getElementById("3nav").classList.remove("active3"),
document.getElementById("4nav").classList.remove("active4"),
document.getElementById("5nav").classList.add("active5"),
document.getElementById("6nav").classList.remove("active6");
document.getElementById("7nav").classList.remove("active7");
break;
}
if ("#schedule" == e.hash && $(e.hash).offset().top - 20 > s) {
document.getElementById("0nav").classList.remove("active"),
document.getElementById("1nav").classList.remove("active1"),
document.getElementById("2nav").classList.remove("active2"),
document.getElementById("3nav").classList.remove("active3"),
document.getElementById("4nav").classList.add("active4"),
document.getElementById("5nav").classList.remove("active5"),
document.getElementById("6nav").classList.remove("active6");
document.getElementById("7nav").classList.remove("active7");
break;
}
if ("#prizes" == e.hash && $(e.hash).offset().top - 20 > s) {
document.getElementById("0nav").classList.remove("active"),
document.getElementById("1nav").classList.remove("active1"),
document.getElementById("2nav").classList.add("active2"),
document.getElementById("3nav").classList.remove("active3"),
document.getElementById("4nav").classList.remove("active4"),
document.getElementById("5nav").classList.remove("active5"),
document.getElementById("6nav").classList.remove("active6");
document.getElementById("7nav").classList.remove("active7");
break;
}
if ("#sponsors" == e.hash && $(e.hash).offset().top - 20 > s) {
document.getElementById("0nav").classList.remove("active"),
document.getElementById("1nav").classList.add("active1"),
document.getElementById("2nav").classList.remove("active2"),
document.getElementById("3nav").classList.remove("active3"),
document.getElementById("4nav").classList.remove("active4"),
document.getElementById("5nav").classList.remove("active5"),
document.getElementById("6nav").classList.remove("active6");
document.getElementById("7nav").classList.remove("active7");
break;
}
if ("#guests" == e.hash && $(e.hash).offset().top - 20 > s) {
document.getElementById("0nav").classList.remove("active"),
document.getElementById("1nav").classList.remove("active1"),
document.getElementById("2nav").classList.remove("active2"),
document.getElementById("3nav").classList.add("active3"),
document.getElementById("4nav").classList.remove("active4"),
document.getElementById("5nav").classList.remove("active5"),
document.getElementById("6nav").classList.remove("active6");
document.getElementById("7nav").classList.remove("active7");
break;
}
}
});