-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitcher.js
More file actions
181 lines (142 loc) · 4.09 KB
/
switcher.js
File metadata and controls
181 lines (142 loc) · 4.09 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/* ================================================================= */
/* CSS Style Switcher By FIFO THEMES
====================================================================== */
window.console = window.console || (function(){
var c = {}; c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile = c.clear = c.exception = c.trace = c.assert = function(){};
return c;
})();
jQuery(document).ready(function($) {
// Color Changer
$(".blue" ).click(function(){
$("#colors" ).attr("href", "css/colors/blue.css" );
return false;
});
$(".green" ).click(function(){
$("#colors" ).attr("href", "css/colors/green.css" );
return false;
});
$(".orange" ).click(function(){
$("#colors" ).attr("href", "css/colors/orange.css" );
return false;
});
$(".purple" ).click(function(){
$("#colors" ).attr("href", "css/colors/purple.css" );
return false;
});
$(".red" ).click(function(){
$("#colors" ).attr("href", "css/colors/red.css" );
return false;
});
$(".magenta" ).click(function(){
$("#colors" ).attr("href", "css/colors/magenta.css" );
return false;
});
$(".brown" ).click(function(){
$("#colors" ).attr("href", "css/colors/brown.css" );
return false;
});
$(".gray" ).click(function(){
$("#colors" ).attr("href", "css/colors/gray.css" );
return false;
});
$(".teal" ).click(function(){
$("#colors" ).attr("href", "css/colors/teal.css" );
return false;
});
$(".golden" ).click(function(){
$("#colors" ).attr("href", "css/colors/golden.css" );
return false;
});
$("#style-switcher h2 a").click(function(e){
e.preventDefault();
var div = $("#style-switcher");
console.log(div.css("left"));
if (div.css("left") === "-206px") {
$("#style-switcher").animate({
left: "0px"
});
} else {
$("#style-switcher").animate({
left: "-206px"
});
}
});
//Header Color Change
$(".header-bg").spectrum({
showInitial: true,
color: "#323B44",
preferredFormat: "hex6",
showInput: true,
move: updateHeader
});
//Changing the header color instantly
function updateHeader(color) {
$("#header .main-header").css("background", color.toHexString());
}
//Footer Top Color Change
$(".footer-bg").spectrum({
showInitial: true,
color: "#323B44",
preferredFormat: "hex6",
showInput: true,
move: updateFooterTop
});
//Changing the header color instantly
function updateFooterTop(color) {
$(".footer-top").css("background", color.toHexString());
}
//Footer Top Color Change
$(".footer-bottom").spectrum({
showInitial: true,
color: "#898989",
preferredFormat: "hex6",
showInput: true,
move: updateFooterBottom
});
//Changing the header color instantly
function updateFooterBottom(color) {
$(".footer-bottom").css("background", color.toHexString());
}
// Footer Style Switcher
$("#footer-style").change(function(e){
if( $(this).val() == 1){
$("#footer").removeClass("dark");
$("#footer-bottom").removeClass("dark");
} else{
$("#footer").addClass("dark");
$("#footer-bottom").addClass("dark");
}
});
//Layout Switcher
$("#layout-style").change(function(e){
if( $(this).val() == 1){
$("body").removeClass("boxed"),
$(window).resize();
} else{
$("body").addClass("boxed"),
$(window).resize();
}
});
$("#layout-switcher").on('change', function() {
$('#layout').attr('href', $(this).val() + '.css');
});
$(".colors li a").click(function(e){
e.preventDefault();
$(this).parent().parent().find("a").removeClass("active");
$(this).addClass("active");
});
$('.bg li a').click(function() {
var current = $('#style-switcher select[id=layout-style]').find('option:selected').val();
if(current == '2') {
var bg = $(this).css("backgroundImage");
$("body").css("backgroundImage",bg);
} else {
alert('Please select boxed layout');
}
});
$("#reset a").click(function(e){
var bg = $(this).css("backgroundImage");
$("body").css("backgroundImage","url(./images/bg/noise.png)");
$("#navigation" ).removeClass("style-2")
});
});