-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.js
33 lines (29 loc) · 890 Bytes
/
demo.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
$(document).ready(function() {
function genCode() {
var code = $(".developer-navi").html();
var str = $(".source").innerHTML = code;
var res = str.replace(/</gi, "<").replace(/>/gi, ">");
$(".source").html(PR.prettyPrintOne(res));
}
var topBar = $(".dev-head");
$(".set-sticky").click(function() {
$(this).toggleClass("to-active");
$(topBar).toggleClass("sticky");
respNav();
genCode();
});
$(".set-glass").click(function() {
$(this).toggleClass("to-active");
$(topBar).toggleClass("glass-effect");
respNav(); genCode();
});
/* Change the color */
$(".theme-tray span").click(function() {
var skin = $(this).attr("class");
$(topBar).attr('class', skin).addClass("dev-head sticky");
$(".set-glass").removeClass("to-active");
$(".set-sticky").addClass("to-active");
respNav(); genCode();
});
genCode();
});