/*
*
* THEME-OPTIONS.JS
*
*/
$(document).ready(function() {
var theme_options_content = ' \
Change Theme Options
\
\
\
Change Color
\
\
Footer Style
\
\
Sticky Header
\
\
Page Header Parallax
\
\
\ ';
$("#theme-options").prepend(theme_options_content);
$("#theme-options > a").on("click", function(e) {
e.preventDefault();
e.stopPropagation();
$("#theme-options").toggleClass("open");
});
$("#theme-options").on("click", function(e) {
e.stopPropagation();
});
$("body").on("click", function() {
if ($("#theme-options").hasClass("open")) {
$("#theme-options").removeClass("open");
}
});
$(".sticky .button a").on("click", function(e) {
e.preventDefault();
$(".sticky .button a").removeClass("active")
$(this).addClass("active");
});
$(".page-header-parallax .button a").on("click", function(e) {
e.preventDefault();
$(".page-header-parallax .button a").removeClass("active")
$(this).addClass("active");
});
$(".footer a").on("click", function(e) {
e.preventDefault();
$(this).next("ul").slideToggle(200);
});
var link = $('link[data-style="styles"]');
var retta_01_colors = $.cookie('retta_01_colors'),
retta_01_sticky = $.cookie('retta_01_sticky'),
retta_01_page_header_parallax = $.cookie('retta_01_page_header_parallax'),
retta_01_footer_style = $.cookie('retta_01_footer_style');
if (!($.cookie('retta_01_colors'))) {
$.cookie('retta_01_colors', 'default', 365);
retta_01_colors = $.cookie('retta_01_colors');
$('#theme-options .colors a[data-style="'+retta_01_colors+'"]');
} else {
link.attr('href','assets/css/alternative-styles/' + retta_01_colors + '.css');
$("#logo img").attr('src','assets/css/alternative-styles/logos/logo-' + retta_01_colors + '.png');
$(".header-style-3 #logo img, .header-style-7 #logo img, .header-style-8 #logo img, .header-style-9 #logo img, .header-style-10 #logo img, .header-style-11 #logo img, .header-style-12 #logo img").attr('src','assets/css/alternative-styles/logos/logo-white-' + retta_01_colors + '.png');
$(".header-style-11 .menu-slide-container #logo img").attr('src','assets/css/alternative-styles/logos/logo-' + retta_01_colors + '.png');
$("#footer-bottom .widget-text img").attr('src','assets/css/alternative-styles/logos/footer-logo-white-' + retta_01_colors + '.png');
$('#theme-options .colors a[data-style="'+retta_01_colors+'"]');
};
if (!($.cookie('retta_01_sticky'))) {
$.cookie('retta_01_sticky', 'sticky-header-on', 365);
retta_01_sticky = $.cookie('retta_01_sticky');
$("body").addClass(retta_01_sticky);
$('#theme-options .sticky a[data-style="sticky-header-on"]');
} else {
if (retta_01_sticky=="sticky-header-off") {
$("body").addClass(retta_01_sticky);
$("body").removeClass("sticky-header-on");
} else {
$("body").addClass(retta_01_sticky);
$("body").removeClass("sticky-header-off");
};
};
if (!($.cookie('retta_01_page_header_parallax'))) {
$.cookie('retta_01_page_header_parallax', 'page-header-parallax-on', 365);
retta_01_page_header_parallax = $.cookie('retta_01_page_header_parallax');
$("body").addClass(retta_01_page_header_parallax);
$('#theme-options .page-header-parallax a[data-style="page-header-parallax-on"]');
} else {
if (retta_01_page_header_parallax=="page-header-parallax-off") {
$("body").addClass(retta_01_page_header_parallax);
$("body").removeClass("page-header-parallax-on");
} else {
$("body").addClass(retta_01_page_header_parallax);
$("body").removeClass("page-header-parallax-off");
};
};
if ($.cookie('retta_01_footer_style')) {
$("body").removeClass("footer-style-1 footer-style-2 footer-style-3");
$("body").addClass(retta_01_footer_style);
};
// CHANGE COLOR //
$('#theme-options .colors a').on('click',function(e) {
var $this = $(this),
retta_01_colors = $this.data('style');
e.preventDefault();
link.attr('href', 'assets/css/alternative-styles/' + retta_01_colors + '.css');
$("#logo img").attr('src','assets/css/alternative-styles/logos/logo-' + retta_01_colors + '.png');
$(".header-style-3 #logo img, .header-style-7 #logo img, .header-style-8 #logo img, .header-style-9 #logo img, .header-style-10 #logo img, .header-style-11 #logo img, .header-style-12 #logo img").attr('src','assets/css/alternative-styles/logos/logo-white-' + retta_01_colors + '.png');
$(".header-style-11 .menu-slide-container #logo img").attr('src','assets/css/alternative-styles/logos/logo-' + retta_01_colors + '.png');
$("#footer-bottom .widget-text img").attr('src','assets/css/alternative-styles/logos/footer-logo-white-' + retta_01_colors + '.png');
$.cookie('retta_01_colors', retta_01_colors, 365);
});
// STICKY ON //
$('#theme-options .sticky a.sticky-off').on('click',function(e) {
e.preventDefault();
$("body").addClass("sticky-header-off");
$("body").removeClass("sticky-header-on");
$.cookie('retta_01_sticky', 'sticky-header-off', 365);
});
// STICKY OFF //
$('#theme-options .sticky a.sticky-on').on('click',function(e) {
e.preventDefault();
$("body").addClass("sticky-header-on");
$("body").removeClass("sticky-header-off");
$.cookie('retta_01_sticky', 'sticky-header-on', 365);
});
// PAGE HEADER PARALLAX ON //
$('#theme-options .page-header-parallax a.page-header-parallax-off').on('click',function(e) {
e.preventDefault();
$("body").addClass("page-header-parallax-off");
$("body").removeClass("page-header-parallax-on");
$.cookie('retta_01_page_header_parallax', 'page-header-parallax-off', 365);
});
// PAGE HEADER PARALLAX OFF //
$('#theme-options .page-header-parallax a.page-header-parallax-on').on('click',function(e) {
e.preventDefault();
$("body").addClass("page-header-parallax-on");
$("body").removeClass("page-header-parallax-off");
$.cookie('retta_01_page_header_parallax', 'page-header-parallax-on', 365);
});
// FOOTER STYLE //
$('#theme-options .footer ul li a').on('click',function(e) {
var $this = $(this),
retta_01_footer_style = $this.data('footer-style');
e.preventDefault();
$("body").removeClass("footer-style-1 footer-style-2 footer-style-3");
$("body").addClass(retta_01_footer_style);
$.cookie('retta_01_footer_style', retta_01_footer_style, 365);
});
if ($("body").hasClass("sticky-header-off") || (!$("body").hasClass("sticky-header"))) {
$("#theme-options .sticky .button a.sticky-off").addClass("active");
} else {
$("#theme-options .sticky .button a.sticky-on").addClass("active");
}
if ($("body").hasClass("page-header-parallax-off")) {
$("#theme-options .page-header-parallax .button a.page-header-parallax-off").addClass("active");
} else {
$("#theme-options .page-header-parallax .button a.page-header-parallax-on").addClass("active");
}
// DEMOS PANNEL //
var demos_pannel = ' \
Retta Demos
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
Purchase Retta \
\ ';
$("#demos-pannel").prepend(demos_pannel);
$("#demos-pannel > h4").on("click", function(e) {
e.preventDefault();
e.stopPropagation();
$("#demos-pannel").toggleClass("open");
});
$("#demos-pannel").on("click", function(e) {
e.stopPropagation();
});
$("body").on("click", function() {
if ($("#demos-pannel").hasClass("open")) {
$("#demos-pannel").removeClass("open");
}
});
});