jQuery(document).ready(function ($) { /** * File customizer.js. * * Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. */ function businessRoyConvertHex(hexcolor, opacity) { var hex = String(hexcolor).replace(/[^0-9a-f]/gi, ''); if (hex.length < 6) { hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; } r = parseInt(hex.substring(0, 2), 16); g = parseInt(hex.substring(2, 4), 16); b = parseInt(hex.substring(4, 6), 16); result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')'; return result; } function business_roy_set_dynamic_css(control, style) { jQuery('style.' + control).remove(); jQuery('head').append(''); } $('.repeater-field-title.accordion-section-title').click(function () { $(this).toggleClass('expanded'); }); $('.repeater-selected-icon').click(function () { $(this).find(".fa-angle-down").toggleClass('fa-angle-up'); }); // Site title and description. wp.customize('blogname', function (value) { value.bind(function (to) { $('.site-title a').text(to); }); }); wp.customize('blogdescription', function (value) { value.bind(function (to) { $('.site-description').text(to); }); }); // Header text color. wp.customize('header_textcolor', function (value) { value.bind(function (to) { if ('blank' === to) { $('.site-title, .site-description').css({ 'clip': 'rect(1px, 1px, 1px, 1px)', 'position': 'absolute' }); } else { $('.site-title, .site-description').css({ 'clip': 'auto', 'position': 'relative' }); $('.site-title a, .site-description').css({ 'color': to }); } }); }); /******** * Header ( Margin, Padding, Radious ) Options */ wp.customize('business_roy_header_margin_padding', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ''; var top_left_radius = ( value.radius.desktop.top === '' ) ? 0 : value.radius.desktop.top; var top_right_radius = ( value.radius.desktop.right === '' ) ? 0 : value.radius.desktop.right; var bottom_right_radius = ( value.radius.desktop.bottom === '' ) ? 0 : value.radius.desktop.bottom; var bottom_left_radius = ( value.radius.desktop.left === '' ) ? 0 : value.radius.desktop.left; var tablet_top_left_radius = ( value.radius.tablet.top === '' ) ? 0 : value.radius.tablet.top; var tablet_top_right_radius = ( value.radius.tablet.right === '' ) ? 0 : value.radius.tablet.right; var tablet_bottom_right_radius = ( value.radius.tablet.bottom === '' ) ? 0 : value.radius.tablet.bottom; var tablet_bottom_left_radius = ( value.radius.tablet.left === '' ) ? 0 : value.radius.tablet.left; var mobile_top_left_radius = ( value.radius.mobile.top === '' ) ? 0 : value.radius.mobile.top; var mobile_top_right_radius = ( value.radius.mobile.right === '' ) ? 0 : value.radius.mobile.right; var mobile_bottom_right_radius = ( value.radius.mobile.bottom === '' ) ? 0 : value.radius.mobile.bottom; var mobile_bottom_left_radius = ( value.radius.mobile.left === '' ) ? 0 : value.radius.mobile.left; css += ".nav-classic{ border-radius: " + top_left_radius + "px " + top_right_radius + "px " + bottom_right_radius + "px " + bottom_left_radius + "px;}"; css += '@media screen and (max-width:768px){'; ".nav-classic{ border-radius: " + tablet_top_left_radius + "px " + tablet_top_right_radius + "px " + tablet_bottom_right_radius + "px " + tablet_bottom_left_radius + "px;}"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".nav-classic{ border-radius: " + mobile_top_left_radius + "px " + mobile_top_right_radius + "px " + mobile_bottom_right_radius + "px " + mobile_bottom_left_radius + "px;}"; css += '}'; css += ".nav-classic{margin-top:" + value.margin.desktop.top + "px; margin-right:" + value.margin.desktop.right + "px; margin-bottom:" + value.margin.desktop.bottom + "px; margin-left:" + value.margin.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".nav-classic{margin-top:" + value.margin.tablet.top + "px; margin-right:" + value.margin.tablet.right + "px; margin-bottom:" + value.margin.tablet.bottom + "px; margin-left:" + value.margin.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".nav-classic{margin-top:" + value.margin.mobile.top + "px; margin-right:" + value.margin.mobile.right + "px; margin-bottom:" + value.margin.mobile.bottom + "px; margin-left:" + value.margin.mobile.left + "px; }"; css += '}'; css += ".nav-classic{padding-top:" + value.padding.desktop.top + "px; padding-right:" + value.padding.desktop.right + "px; padding-bottom:" + value.padding.desktop.bottom + "px; padding-left:" + value.padding.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".nav-classic{padding-top:" + value.padding.tablet.top + "px; padding-right:" + value.padding.tablet.right + "px; padding-bottom:" + value.padding.tablet.bottom + "px; padding-left:" + value.padding.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".nav-classic{padding-top:" + value.padding.mobile.top + "px; padding-right:" + value.padding.mobile.right + "px; padding-bottom:" + value.padding.mobile.bottom + "px; padding-left:" + value.padding.mobile.left + "px; }"; css += '}'; business_roy_set_dynamic_css('business_roy_header_margin_padding', css); }); }); wp.customize('content_text_color', function (value) { value.bind(function (to) { var borderColor = businessRoyConvertHex(to, 10); var lighterBorderColor = businessRoyConvertHex(to, 5); var css = ".content-area{color:" + to + "}"; css += ".widget-area .widget{border-color:" + borderColor + "}"; css += ".widget-area li{border-color:" + lighterBorderColor + "}"; business_roy_set_dynamic_css('content_text_color', css); }); }); // Sections dynamic var settingIds = ['aboutus', 'service', 'video_calltoaction', 'calltoaction', 'counter', 'blog', 'testimonial', 'team', 'client', 'promoservice', 'contact', 'pricing', 'tab', 'producttype', 'productcat', 'recentwork', 'how_it_works', 'header', 'titlebar', 'footer']; $.each(settingIds, function (i, settingId) { wp.customize('business_roy_' + settingId + '_super_title', function (value) { value.bind(function (to) { var sectionClass = '#' + settingId + '-section .super-title'; if ($(sectionClass).length == 0) { wp.customize.preview.send('refresh'); } else { $(sectionClass).text(to); } }) }); wp.customize('business_roy_' + settingId + '_title', function (value) { value.bind(function (to) { var sectionClass = '#' + settingId + '-section .section-title'; if ($(sectionClass).length == 0) { if( !( settingId === 'testimonial' || settingId === 'team' || settingId === 'blog' ) ) { wp.customize.preview.send('refresh'); } } else { $(sectionClass).text(to); } }) }); wp.customize('business_roy_' + settingId + '_title_align', function (value) { value.bind(function (to) { var sectionClass = '#' + settingId + '-section'; var remove_class = 'text-center text-left text-right'; $(sectionClass + ' .section-title-wrapper').removeClass(remove_class); $(sectionClass + ' .section-title-wrapper').addClass(to); }) }); wp.customize('business_roy_' + settingId + '_bg_type', function (value) { value.bind(function (to) { var sectionClass = '#' + settingId + '-section'; if (to === 'default' || to === 'color-bg' || to === 'gradient-bg' ) { $(sectionClass + ' iframe').css('display', 'none'); } if ('color-bg' === to) { var color = wp.customize('business_roy_' + settingId + '_bg_color').get(); // $( sectionClass ).removeAttr( 'style' ); var css = sectionClass + '{background-color:' + color + '}'; business_roy_set_dynamic_css('business_roy_' + settingId + '_bg_color', css); var css = sectionClass + ' .section-wrap{background-color:transparent}'; business_roy_set_dynamic_css('business_roy_' + settingId + '_bg_color_section_wrap', css); var css = sectionClass + '{background-image:none}'; business_roy_set_dynamic_css('business_roy_' + settingId + '_bg_image_url', css); } if( 'none' === to ) { var css = sectionClass + '{background-color:transparent}'; business_roy_set_dynamic_css('business_roy_' + settingId + '_bg_color', css); } if ('gradient-bg' === to) { var gradient = wp.customize('business_roy_' + settingId + '_bg_gradient').get(); var css = sectionClass + '{' + gradient + '}'; business_roy_set_dynamic_css('business_roy_' + settingId + '_bg_gradient', css); // var css = sectionClass + ' .section-wrap{background-color:transparent}'; // business_roy_set_dynamic_css('business_roy_' + settingId + '_overlay_color', css); } }); }); wp.customize('business_roy_' + settingId + '_bg_color', function (value) { value.bind(function (to) { var sectionClass = '#' + settingId + '-section'; var css = sectionClass + '{background-color:' + to + '}'; business_roy_set_dynamic_css('business_roy_' + settingId + '_bg_color', css); }); }); wp.customize('business_roy_' + settingId + '_bg_gradient', function (value) { value.bind(function (to) { var sectionClass = '#' + settingId + '-section'; var css = sectionClass + '{' + to + '}'; business_roy_set_dynamic_css('business_roy_' + settingId + '_bg_color', css); }); }); wp.customize('business_roy_' + settingId + '_padding', function (value) { value.bind(function (to) { var selector = '#' + settingId + '-section'; var section_padding = JSON.parse(to); var css = selector + '{padding-top:' + section_padding.desktop.top + 'px; padding-right:' + section_padding.desktop.right + 'px; padding-bottom:' + section_padding.desktop.bottom + 'px; padding-left:' + section_padding.desktop.left + 'px}'; business_roy_set_dynamic_css('business_roy_' + settingId + 'padding_desktop', css); if (($(window).width() >= 700) && ($(window).width() < 992)) { var css = '@media screen and (max-width:992px){'; css += selector + '{ padding-top:' + section_padding.tablet.top + 'px; padding-right:' + section_padding.tablet.right + 'px; padding-bottom:' + section_padding.tablet.bottom + 'px; padding-left:' + section_padding.tablet.left + 'px}'; css += '}'; business_roy_set_dynamic_css('business_roy_' + settingId + 'padding_tablet', css); } if ($(window).width() < 500) { var css = '@media screen and (max-width:500px){'; css += selector + '{ padding-top:' + section_padding.mobile.top + 'px; padding-right:' + section_padding.mobile.right + 'px; padding-bottom:' + section_padding.mobile.bottom + 'px; padding-left:' + section_padding.mobile.left + 'px}'; css += '}'; business_roy_set_dynamic_css('business_roy_' + settingId + 'padding_mobile', css); } }); }); wp.customize('business_roy_' + settingId + '_margin', function (value) { value.bind(function (to) { var selector = '#' + settingId + '-section'; var section_margin = JSON.parse(to); var css = selector + '{margin-top:' + section_margin.desktop.top + 'px; margin-right:' + section_margin.desktop.right + 'px; margin-bottom:' + section_margin.desktop.bottom + 'px; margin-left:' + section_margin.desktop.left + 'px}'; business_roy_set_dynamic_css('business_roy_' + settingId + 'padding_desktop', css); if (($(window).width() >= 700) && ($(window).width() < 992)) { var css = '@media screen and (max-width:992px){'; css += selector + '{ margin-top:' + section_margin.tablet.top + 'px; margin-right:' + section_margin.tablet.right + 'px; margin-bottom:' + section_margin.tablet.bottom + 'px; margin-left:' + section_margin.tablet.left + 'px}'; css += '}'; business_roy_set_dynamic_css('business_roy_' + settingId + 'padding_tablet', css); } if ($(window).width() < 500) { var css = '@media screen and (max-width:500px){'; css += selector + '{ margin-top:' + section_margin.mobile.top + 'px; margin-right:' + section_margin.mobile.right + 'px; margin-bottom:' + section_margin.mobile.bottom + 'px; margin-left:' + section_margin.mobile.left + 'px}'; css += '}'; business_roy_set_dynamic_css('business_roy_' + settingId + 'padding_mobile', css); } }); }); }); /************ * Top Header Settings */ wp.customize('business_roy_top_header_enable', function (value) { value.bind(function (to) { if (to === 'enable') { $('.top-menu-bar').css('display', 'block'); } else { $('.top-menu-bar').css('display', 'none'); } }) }); /************** * Main Header */ /*** * Text (Logo) */ wp.customize('business_roy_enable_search', function (value) { value.bind(function (to) { if (to === 'enable') { $('.menu-item-search').css('display', 'flex'); } else { $('.menu-item-search').css('display', 'none'); } }) }); wp.customize('business_roy_hamburger_color', function (value) { value.bind(function (to) { $('.nav-classic .header-nav-toggle div').css('background-color', to); }) }); wp.customize('business_roy_titlebar_title_align', function (value) { value.bind(function (to) { var remove_class = 'text-center text-left text-right'; $('.breadcrumb-section').removeClass(remove_class); $('.breadcrumb-section').addClass(to); }) }); /******* * Menu Style Setting */ /** Menu Item Settings */ wp.customize('business_roy_header_item_group', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{ \ color:" + value.color + "; \ background: " + value.bg_color + "; \ }"; css += ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{ border-radius: " + value.radius.desktop.top + "px " + value.radius.desktop.right + "px " + value.radius.desktop.bottom + "px " + value.radius.desktop.left + "px;}"; css += '@media screen and (max-width:768px){'; ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{ border-radius: " + value.radius.tablet.top + "px " + value.radius.tablet.right + "px " + value.radius.tablet.bottom + "px " + value.radius.tablet.left + "px;}"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{ border-radius: " + value.radius.mobile.top + "px " + value.radius.mobile.right + "px " + value.radius.mobile.bottom + "px " + value.radius.mobile.left + "px;}"; css += '}'; css += ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{margin-top:" + value.margin.desktop.top + "px; margin-right:" + value.margin.desktop.right + "px; margin-bottom:" + value.margin.desktop.bottom + "px; margin-left:" + value.margin.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{margin-top:" + value.margin.tablet.top + "px; margin-right:" + value.margin.tablet.right + "px; margin-bottom:" + value.margin.tablet.bottom + "px; margin-left:" + value.margin.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{margin-top:" + value.margin.mobile.top + "px; margin-right:" + value.margin.mobile.right + "px; margin-bottom:" + value.margin.mobile.bottom + "px; margin-left:" + value.margin.mobile.left + "px; }"; css += '}'; css += ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{padding-top:" + value.padding.desktop.top + "px; padding-right:" + value.padding.desktop.right + "px; padding-bottom:" + value.padding.desktop.bottom + "px; padding-left:" + value.padding.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{padding-top:" + value.padding.tablet.top + "px; padding-right:" + value.padding.tablet.right + "px; padding-bottom:" + value.padding.tablet.bottom + "px; padding-left:" + value.padding.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".box-header-nav .main-menu .page_item a, .box-header-nav .main-menu>.menu-item>a, .headertwo .box-header-nav .main-menu .page_item a, .headertwo .box-header-nav .main-menu>.menu-item>a{padding-top:" + value.padding.mobile.top + "px; padding-right:" + value.padding.mobile.right + "px; padding-bottom:" + value.padding.mobile.bottom + "px; padding-left:" + value.padding.mobile.left + "px; }"; css += '}'; business_roy_set_dynamic_css('business_roy_header_item_group', css); }); }); /** Sub Menu Item ( Child Menu ) Settings */ wp.customize('business_roy_header_sub_item_group', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ".box-header-nav .main-menu .children, .box-header-nav .main-menu .sub-menu li{ \ background: " + value.bg_color + "; \ }"; css += ".box-header-nav .main-menu .children>.page_item>a, .box-header-nav .main-menu .sub-menu>.menu-item>a{ \ color:" + value.color + ";\ }"; var top_left_radius = ( value.radius.desktop.top === '' ) ? 0 : value.radius.desktop.top; var top_right_radius = ( value.radius.desktop.right === '' ) ? 0 : value.radius.desktop.right; var bottom_right_radius = ( value.radius.desktop.bottom === '' ) ? 0 : value.radius.desktop.bottom; var bottom_left_radius = ( value.radius.desktop.left === '' ) ? 0 : value.radius.desktop.left; var tablet_top_left_radius = ( value.radius.tablet.top === '' ) ? 0 : value.radius.tablet.top; var tablet_top_right_radius = ( value.radius.tablet.right === '' ) ? 0 : value.radius.tablet.right; var tablet_bottom_right_radius = ( value.radius.tablet.bottom === '' ) ? 0 : value.radius.tablet.bottom; var tablet_bottom_left_radius = ( value.radius.tablet.left === '' ) ? 0 : value.radius.tablet.left; var mobile_top_left_radius = ( value.radius.mobile.top === '' ) ? 0 : value.radius.mobile.top; var mobile_top_right_radius = ( value.radius.mobile.right === '' ) ? 0 : value.radius.mobile.right; var mobile_bottom_right_radius = ( value.radius.mobile.bottom === '' ) ? 0 : value.radius.mobile.bottom; var mobile_bottom_left_radius = ( value.radius.mobile.left === '' ) ? 0 : value.radius.mobile.left; css += ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{ border-radius: " + top_left_radius + "px " + top_right_radius + "px " + bottom_right_radius + "px " + bottom_left_radius + "px;}"; css += '@media screen and (max-width:768px){'; ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{ border-radius: " + tablet_top_left_radius + "px " + tablet_top_right_radius + "px " + tablet_bottom_right_radius + "px " + tablet_bottom_left_radius + "px;}"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{ border-radius: " + mobile_top_left_radius + "px " + mobile_top_right_radius + "px " + mobile_bottom_right_radius + "px " + mobile_bottom_left_radius + "px;}"; css += '}'; css += ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{margin-top:" + value.margin.desktop.top + "px; margin-right:" + value.margin.desktop.right + "px; margin-bottom:" + value.margin.desktop.bottom + "px; margin-left:" + value.margin.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{margin-top:" + value.margin.tablet.top + "px; margin-right:" + value.margin.tablet.right + "px; margin-bottom:" + value.margin.tablet.bottom + "px; margin-left:" + value.margin.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{margin-top:" + value.margin.mobile.top + "px; margin-right:" + value.margin.mobile.right + "px; margin-bottom:" + value.margin.mobile.bottom + "px; margin-left:" + value.margin.mobile.left + "px; }"; css += '}'; css += ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{padding-top:" + value.padding.desktop.top + "px; padding-right:" + value.padding.desktop.right + "px; padding-bottom:" + value.padding.desktop.bottom + "px; padding-left:" + value.padding.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{padding-top:" + value.padding.tablet.top + "px; padding-right:" + value.padding.tablet.right + "px; padding-bottom:" + value.padding.tablet.bottom + "px; padding-left:" + value.padding.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".box-header-nav .main-menu .children>.page_item>li, .box-header-nav .main-menu .sub-menu>li{padding-top:" + value.padding.mobile.top + "px; padding-right:" + value.padding.mobile.right + "px; padding-bottom:" + value.padding.mobile.bottom + "px; padding-left:" + value.padding.mobile.left + "px; }"; css += '}'; business_roy_set_dynamic_css('business_roy_header_sub_item_group', css); }); }); /** Menu Active Item Settings */ wp.customize('business_roy_header_nav_hover_group', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ".box-header-nav .main-menu .page_item.current_page_item>a, .box-header-nav .main-menu .page_item:hover>a, .box-header-nav .main-menu .page_item.focus>a, .box-header-nav .main-menu>.menu-item.current-menu-item>a, .box-header-nav .main-menu>.menu-item:hover>a, .box-header-nav .main-menu>.menu-item.focus>a, .headertwo .box-header-nav .main-menu .page_item.current_page_item>a, .headertwo .box-header-nav .main-menu>.menu-item.current-menu-item>a, .headertwo .box-header-nav .main-menu .page_item:hover>a, .headertwo .box-header-nav .main-menu .page_item.focus>a, .headertwo .box-header-nav .main-menu>.menu-item:hover>a, .headertwo .box-header-nav .main-menu>.menu-item.focus>a{\ color:" + value.nav_color + "; \ background: " + value.nav_bg_color + "; \ }"; business_roy_set_dynamic_css('business_roy_header_nav_hover_group', css); }); }); /************ * Header Button */ wp.customize('business_roy_hb_title', function (value) { value.bind(function (to) { $('.buttonwrap .quickcontact-title').text(to); }) }); wp.customize('business_roy_hb_text', function (value) { value.bind(function (to) { $('.buttonwrap span').text(to); }) }); wp.customize('business_roy_hb_link', function (value) { value.bind(function (to) { $('.business-roy-header-button a').attr('href', to); }) }); wp.customize('business_roy_header_button_disable_mobile', function (value) { value.bind(function (to) { if( to ) { var css = "@media only screen and (max-width: 600px) { .quickcontact { display: none } }"; } else { var css = "@media only screen and (max-width: 600px) { .quickcontact { display: block } }"; } business_roy_set_dynamic_css('header_quick_contact', css); }) }); wp.customize('business_roy_header_button_color', function (value) { value.bind(function (to) { var value = JSON.parse(to); var top_left_radius = ( value.radius.desktop.top === '' ) ? 0 : value.radius.desktop.top; var top_right_radius = ( value.radius.desktop.right === '' ) ? 0 : value.radius.desktop.right; var bottom_right_radius = ( value.radius.desktop.bottom === '' ) ? 0 : value.radius.desktop.bottom; var bottom_left_radius = ( value.radius.desktop.left === '' ) ? 0 : value.radius.desktop.left; var tablet_top_left_radius = ( value.radius.tablet.top === '' ) ? 0 : value.radius.tablet.top; var tablet_top_right_radius = ( value.radius.tablet.right === '' ) ? 0 : value.radius.tablet.right; var tablet_bottom_right_radius = ( value.radius.tablet.bottom === '' ) ? 0 : value.radius.tablet.bottom; var tablet_bottom_left_radius = ( value.radius.tablet.left === '' ) ? 0 : value.radius.tablet.left; var mobile_top_left_radius = ( value.radius.mobile.top === '' ) ? 0 : value.radius.mobile.top; var mobile_top_right_radius = ( value.radius.mobile.right === '' ) ? 0 : value.radius.mobile.right; var mobile_bottom_right_radius = ( value.radius.mobile.bottom === '' ) ? 0 : value.radius.mobile.bottom; var mobile_bottom_left_radius = ( value.radius.mobile.left === '' ) ? 0 : value.radius.mobile.left; var css = ".business-roy-header-button{ \ background: " + value.background + "; \ font-size:" + value['font-size'] + "px;\ width:" + value.width + "px;\ }"; css += ".business-roy-header-button a { color:" + value.text + "}"; css += ".business-roy-header-button{ border-radius: " + top_left_radius + "px " + top_right_radius + "px " + bottom_right_radius + "px " + bottom_left_radius + "px;}"; css += '@media screen and (max-width:768px){'; ".business-roy-header-button{ border-radius: " + tablet_top_left_radius + "px " + tablet_top_right_radius + "px " + tablet_bottom_right_radius + "px " + tablet_bottom_left_radius + "px;}"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".business-roy-header-button{ border-radius: " + mobile_top_left_radius + "px " + mobile_top_right_radius + "px " + mobile_bottom_right_radius + "px " + mobile_bottom_left_radius + "px;}"; css += '}'; css += ".business-roy-header-button{margin-top:" + value.margin.desktop.top + "px; margin-right:" + value.margin.desktop.right + "px; margin-bottom:" + value.margin.desktop.bottom + "px; margin-left:" + value.margin.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".business-roy-header-button{margin-top:" + value.margin.tablet.top + "px; margin-right:" + value.margin.tablet.right + "px; margin-bottom:" + value.margin.tablet.bottom + "px; margin-left:" + value.margin.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".business-roy-header-button{margin-top:" + value.margin.mobile.top + "px; margin-right:" + value.margin.mobile.right + "px; margin-bottom:" + value.margin.mobile.bottom + "px; margin-left:" + value.margin.mobile.left + "px; }"; css += '}'; css += ".business-roy-header-button{padding-top:" + value.padding.desktop.top + "px; padding-right:" + value.padding.desktop.right + "px; padding-bottom:" + value.padding.desktop.bottom + "px; padding-left:" + value.padding.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".business-roy-header-button{padding-top:" + value.padding.tablet.top + "px; padding-right:" + value.padding.tablet.right + "px; padding-bottom:" + value.padding.tablet.bottom + "px; padding-left:" + value.padding.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".business-roy-header-button{padding-top:" + value.padding.mobile.top + "px; padding-right:" + value.padding.mobile.right + "px; padding-bottom:" + value.padding.mobile.bottom + "px; padding-left:" + value.padding.mobile.left + "px; }"; css += '}'; business_roy_set_dynamic_css('business_roy_header_button_color', css); }); }); wp.customize('business_roy_header_button_hover_color', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ".business-roy-header-button:hover{ background: " + value.background + "; }"; css += ".business-roy-header-button:hover a{ color:" + value.text + ";}"; business_roy_set_dynamic_css('business_roy_header_button_hover_color', css); }); }); /** * Slider */ wp.customize('business_roy_slider_height', function (value) { value.bind(function (to) { $('.video-banner, .banner-slider .slider-item').css('height', to + 'vh'); }); }); wp.customize('business_roy_slider_height_tablet', function (value) { value.bind(function (to) { $('.video-banner, .banner-slider .slider-item').css('height', to + 'vh'); }); }); wp.customize('business_roy_slider_height_mobile', function (value) { value.bind(function (to) { $('.video-banner, .banner-slider .slider-item').css('height', to + 'vh'); }); }); /*** * Slider Seperator */ wp.customize('business_roy_slider_bs_color', function (value) { value.bind(function (to) { $('.bottom-section-seperator svg').css('fill', to); }); }); wp.customize('business_roy_slider_bs_height', function (value) { value.bind(function (to) { var desktop = to; var tablet = wp.customize('business_roy_slider_bs_height_tablet').get(); var mobile = wp.customize('business_roy_slider_bs_height_mobile').get(); var css = '.section-seperator.bottom-section-seperator{height:' + desktop + 'px}'; if (tablet) { css += '@media screen and (max-width:768px){'; css += '.section-seperator.bottom-section-seperator{height:' + tablet + 'px}'; css += '}'; } if (mobile) { css += '@media screen and (max-width:480px){'; css += '.section-seperator.bottom-section-seperator{height:' + mobile + 'px}'; css += '}'; } business_roy_set_dynamic_css('business_roy_slider_bs_height', css); }); }); wp.customize('business_roy_banner_overlay_color', function (value) { value.bind(function (to) { var css = ".banner-slider .slider-item:before{ background-color:" + to + " }"; business_roy_set_dynamic_css('business_roy_banner_overlay_color', css); }); }); wp.customize('business_roy_caption_title_font_size', function (value) { value.bind(function (to) { $('.banner-slider .slider-item .slider-content .maintitle').css('font-size', to + 'px'); }); }); wp.customize( 'business_roy_slider_section_seperator', function(value) { value.bind( function( to ) { if( to === 'bottom' ) { var fillColor = wp.customize( 'business_roy_slider_bs_color' ).get(); var css = '.banner-slider .bottom-section-seperator svg { fill:' + fillColor + '}'; business_roy_set_dynamic_css('slider_section_separator_color', css); } }); }); /** Slider Type */ jQuery(document).ready(function ($) { wp.customize.selectiveRefresh.bind('partial-content-rendered', function (placement) { var brtl = $("body").hasClass('rtl') ? true : false; AOS.init(); var p_p_id = placement.partial.id; slider_refresh = [ 'business_roy_slider_refresh', ]; if (slider_refresh.includes(p_p_id)) { var brtl = false; if (jQuery("body").hasClass('rtl')) brtl = true; var $owlHome = $(".features-slider"); $owlHome.owlCarousel({ items: 1, rtl: brtl, autoplay: parseInt($owlHome.data('autoplay')) == 1 ? true : false, autoplayTimeout: parseInt($owlHome.data('pause')) || 5000, smartSpeed: parseInt($owlHome.data('speed')) || 2000, margin: 0, loop: parseInt($owlHome.data('loop')) == 1 ? true : false, dots: parseInt($owlHome.data('pager')) == 1 ? true : false, nav: parseInt($owlHome.data('controls')) == 1 ? true : false, singleItem: true, animateOut: $owlHome.data('easing') || 'fadeOut', transitionStyle: $owlHome.data('mode') || 'fade', touchDrag: parseInt($owlHome.data('drag')) == 1 ? true : false, mouseDrag: parseInt($owlHome.data('drag')) == 1 ? true : false, }); } if (p_p_id == 'business_roy_testimonial_refresh') { $(".testimonial_slid").each(function () { var $this = $(this); //var dataCol = $this.attr('data-col') || 1; $this.owlCarousel({ loop: true, margin: 10, nav: false, autoplay: true, smartSpeed: 2500, dots: true, items: 1, }); }); } if (p_p_id == 'business_roy_client_refresh') { $('.client-logo-slider').owlCarousel({ loop: true, margin: 10, dots: true, nav: false, autoplay: true, smartSpeed: 3000, autoplayTimeout: 5000, rtl: brtl, responsive: { 0: { items: 2 }, 600: { items: 3 }, 1000: { items: 3 }, 1024: { items: 5 } } }); } if (p_p_id == 'business_roy_portfolio_section_refresh') { $('.portfolio-slider').owlCarousel({ loop: true, margin: 0, nav: false, dots: true, autoplay: true, smartSpeed: 2500, center: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 769: { items: 3 }, 1024: { items: 5 } } }); } }); }); /***** * Breacrumbs Settings */ wp.customize('business_roy_titlebar_text_color', function (value) { value.bind(function (to) { $('.breadcrumb ul li').css('color', to + '%'); }); }); /********** * Contact Us */ wp.customize('business_roy_contact_social_button_bg_color', function (value) { value.bind(function (to) { var css = ".contact-detail .contact-social-icon a{background:" + to + "}"; business_roy_set_dynamic_css('business_roy_contact_social_button_bg_color', css); }); }); wp.customize('business_roy_contact_social_button_text_color', function (value) { value.bind(function (to) { var css = ".contact-section .contact-detail .contact-social-icon a i{color:" + to + "}"; business_roy_set_dynamic_css('business_roy_contact_social_button_text_color', css); }); }); wp.customize('business_roy_contact_info_bg_color', function (value) { value.bind(function (to) { var css = ".contact-detail{background-color:" + to + "}"; business_roy_set_dynamic_css('business_roy_contact_info_bg_color', css); }); }); /********** * Promo Service */ wp.customize('business_roy_promoservice_style', function (value) { value.bind(function (to) { $('.promoservice-section').removeClass('style1 style2 style3 style4').addClass(to); }) }); wp.customize('business_roy_promoservice_show_image', function (value) { value.bind(function (to) { if (to === 'enable') { $('.promoservice-wrap .feature-list .box figure').css('display', 'block'); } else { $('.promoservice-wrap .feature-list .box figure').css('display', 'none'); } }) }); /** Promo Service Item Grid Settings */ wp.customize('promoservice_grid', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ''; var top_left_radius = ( value.radius.desktop.top === '' ) ? 0 : value.radius.desktop.top; var top_right_radius = ( value.radius.desktop.right === '' ) ? 0 : value.radius.desktop.right; var bottom_right_radius = ( value.radius.desktop.bottom === '' ) ? 0 : value.radius.desktop.bottom; var bottom_left_radius = ( value.radius.desktop.left === '' ) ? 0 : value.radius.desktop.left; var tablet_top_left_radius = ( value.radius.tablet.top === '' ) ? 0 : value.radius.tablet.top; var tablet_top_right_radius = ( value.radius.tablet.right === '' ) ? 0 : value.radius.tablet.right; var tablet_bottom_right_radius = ( value.radius.tablet.bottom === '' ) ? 0 : value.radius.tablet.bottom; var tablet_bottom_left_radius = ( value.radius.tablet.left === '' ) ? 0 : value.radius.tablet.left; var mobile_top_left_radius = ( value.radius.mobile.top === '' ) ? 0 : value.radius.mobile.top; var mobile_top_right_radius = ( value.radius.mobile.right === '' ) ? 0 : value.radius.mobile.right; var mobile_bottom_right_radius = ( value.radius.mobile.bottom === '' ) ? 0 : value.radius.mobile.bottom; var mobile_bottom_left_radius = ( value.radius.mobile.left === '' ) ? 0 : value.radius.mobile.left; css += ".promoservice-wrap .feature-list{ border-radius: " + top_left_radius + "px " + top_right_radius + "px " + bottom_right_radius + "px " + bottom_left_radius + "px;}"; css += '@media screen and (max-width:768px){'; ".promoservice-wrap .feature-list{ border-radius: " + tablet_top_left_radius + "px " + tablet_top_right_radius + "px " + tablet_bottom_right_radius + "px " + tablet_bottom_left_radius + "px;}"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".promoservice-wrap .feature-list{ border-radius: " + mobile_top_left_radius + "px " + mobile_top_right_radius + "px " + mobile_bottom_right_radius + "px " + mobile_bottom_left_radius + "px;}"; css += '}'; css += ".promoservice-wrap .feature-list{margin-top:" + value.margin.desktop.top + "px; margin-right:" + value.margin.desktop.right + "px; margin-bottom:" + value.margin.desktop.bottom + "px; margin-left:" + value.margin.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".promoservice-wrap .feature-list{margin-top:" + value.margin.tablet.top + "px; margin-right:" + value.margin.tablet.right + "px; margin-bottom:" + value.margin.tablet.bottom + "px; margin-left:" + value.margin.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".promoservice-wrap .feature-list{margin-top:" + value.margin.mobile.top + "px; margin-right:" + value.margin.mobile.right + "px; margin-bottom:" + value.margin.mobile.bottom + "px; margin-left:" + value.margin.mobile.left + "px; }"; css += '}'; css += ".promoservice-wrap .feature-list{padding-top:" + value.padding.desktop.top + "px; padding-right:" + value.padding.desktop.right + "px; padding-bottom:" + value.padding.desktop.bottom + "px; padding-left:" + value.padding.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".promoservice-wrap .feature-list{padding-top:" + value.padding.tablet.top + "px; padding-right:" + value.padding.tablet.right + "px; padding-bottom:" + value.padding.tablet.bottom + "px; padding-left:" + value.padding.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".promoservice-wrap .feature-list{padding-top:" + value.padding.mobile.top + "px; padding-right:" + value.padding.mobile.right + "px; padding-bottom:" + value.padding.mobile.bottom + "px; padding-left:" + value.padding.mobile.left + "px; }"; css += '}'; business_roy_set_dynamic_css('promoservice_grid', css); }); }); /** Promo Service Item Icon Settings */ wp.customize('business_roy_promoservice_icon_style', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ".promoservice-wrap .feature-list .icon-box{ \ background-color: " + value.bg_color + "; \ color:" + value.color + "; \ border:solid " + value.borderwidth + "px; \ border-color:" + value.bordercolor + "; \ }"; css += ".promoservice-wrap .feature-list .icon-box{padding-top:" + value.padding.desktop.top + "px; padding-right:" + value.padding.desktop.right + "px; padding-bottom:" + value.padding.desktop.bottom + "px; padding-left:" + value.padding.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".promoservice-wrap .feature-list .icon-box{padding-top:" + value.padding.tablet.top + "px; padding-right:" + value.padding.tablet.right + "px; padding-bottom:" + value.padding.tablet.bottom + "px; padding-left:" + value.padding.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".promoservice-wrap .feature-list .icon-box{padding-top:" + value.padding.mobile.top + "px; padding-right:" + value.padding.mobile.right + "px; padding-bottom:" + value.padding.mobile.bottom + "px; padding-left:" + value.padding.mobile.left + "px; }"; css += '}'; business_roy_set_dynamic_css('business_roy_promoservice_icon_style', css); }); }); /********* * Service Section */ wp.customize('business_roy_service_button', function (value) { value.bind(function (to) { $('.service-section .feature_detail a.btn').html(to + ''); }) }); wp.customize('business_roy_service_bg_url', function (value) { value.bind(function (to) { $('.feature_detail .feature_img img').attr('src', to); }) }); /***** * Our Team Member */ wp.customize('business_roy_team_style', function (value) { value.bind(function (to) { $('.team-section').removeClass('style1 style2 style3').addClass(to); }) }); wp.customize('business_roy_team_grid_style', function (value) { value.bind(function (to) { var itemSettingsObj = JSON.parse( to ); var css = '.team-section .section-wrap .box, .team-section.style2 .section-wrap .box { background-color:' + itemSettingsObj.bg_color + ';}'; var top_left_radius = ( itemSettingsObj.radius.desktop.top === '' ) ? 8 : itemSettingsObj.radius.desktop.top; var top_right_radius = ( itemSettingsObj.radius.desktop.right === '' ) ? 8 : itemSettingsObj.radius.desktop.right; var bottom_right_radius = ( itemSettingsObj.radius.desktop.bottom === '' ) ? 8 : itemSettingsObj.radius.desktop.bottom; var bottom_left_radius = ( itemSettingsObj.radius.desktop.left === '' ) ? 8 : itemSettingsObj.radius.desktop.left; var tablet_top_left_radius = ( itemSettingsObj.radius.tablet.top === '' ) ? 0 : itemSettingsObj.radius.tablet.top; var tablet_top_right_radius = ( itemSettingsObj.radius.tablet.right === '' ) ? 0 : itemSettingsObj.radius.tablet.right; var tablet_bottom_right_radius = ( itemSettingsObj.radius.tablet.bottom === '' ) ? 0 : itemSettingsObj.radius.tablet.bottom; var tablet_bottom_left_radius = ( itemSettingsObj.radius.tablet.left === '' ) ? 0 : itemSettingsObj.radius.tablet.left; var mobile_top_left_radius = ( itemSettingsObj.radius.mobile.top === '' ) ? 0 : itemSettingsObj.radius.mobile.top; var mobile_top_right_radius = ( itemSettingsObj.radius.mobile.right === '' ) ? 0 : itemSettingsObj.radius.mobile.right; var mobile_bottom_right_radius = ( itemSettingsObj.radius.mobile.bottom === '' ) ? 0 : itemSettingsObj.radius.mobile.bottom; var mobile_bottom_left_radius = ( itemSettingsObj.radius.mobile.left === '' ) ? 0 : itemSettingsObj.radius.mobile.left; css += ".team-section .section-wrap .box, .team-section.style2 .section-wrap .box{ border-radius: " + top_left_radius + "px " + top_right_radius + "px " + bottom_right_radius + "px " + bottom_left_radius + "px;}"; css += '@media screen and (max-width:768px){'; ".team-section .section-wrap .box, .team-section.style2 .section-wrap .box{ border-radius: " + tablet_top_left_radius + "px " + tablet_top_right_radius + "px " + tablet_bottom_right_radius + "px " + tablet_bottom_left_radius + "px;}"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".team-section .section-wrap .box, .team-section.style2 .section-wrap .box{ border-radius: " + mobile_top_left_radius + "px " + mobile_top_right_radius + "px " + mobile_bottom_right_radius + "px " + mobile_bottom_left_radius + "px;}"; css += '}'; business_roy_set_dynamic_css('business_roy_team_grid_bg_color', css); }) }); wp.customize('business_roy_team_image_style', function (value) { value.bind(function (to) { var teamImgHeight = JSON.parse( to ).height; var css = '.team-section .team-item .box figure img, .team-section.style2 .team-item .box figure img {height: ' + teamImgHeight + 'px;}'; business_roy_set_dynamic_css('business_roy_team_grid_bg_color', css); }) }); /***** * Client Logo */ /***** * Contact Us */ wp.customize('business_roy_contact_descripton', function (value) { value.bind(function (to) { $('.contact-section .contact-form .contact-desc').html(to); }) }); wp.customize('business_roy_contact_details_right_heading', function (value) { value.bind(function (to) { $('.contact-section .contact-detail h3').html(to); }) }); /***** * About Section */ wp.customize('business_roy_aboutus_super_title', function (value) { value.bind(function (to) { $('.about-wrapper .aboutsuper-title').html(to); }) }); wp.customize('business_roy_aboutus_layout_design', function (value) { value.bind(function (to) { $('.about_us_front').removeClass('layoutone layouttwo layoutthree').addClass(to); }) }); wp.customize('business_roy_about_image', function (value) { value.bind(function (to) { $('.about-wrapper .about-img img').attr('src', to); }) }); wp.customize('business_roy_aboutus_button_text', function (value) { value.bind(function (to) { $('#aboutus-section .section-tagline-text a.btn-primary').html(to + ''); }) }); /********* * Call To Action */ wp.customize('business_roy_call_to_action_title', function (value) { value.bind(function (to) { $('.calltoaction-section .section-title').html(to); }) }); wp.customize('business_roy_call_to_action_subtitle', function (value) { value.bind(function (to) { $('.calltoaction-section .calltoaction_subtitle').html(to); }) }); wp.customize('business_roy_cta_alignment', function (value) { value.bind(function (to) { $('.calltoaction_promo_wrapper').removeClass('text-left text-right text-center').addClass(to); }) }); wp.customize('business_roy_cta_layout', function (value) { value.bind(function (to) { $('.inner-section-wrap.cta-innerwrapper').removeClass('cta-left cta-right cta-center').addClass(to); }) }); /**** * Video Call To Action */ wp.customize('business_roy_appointment_title', function (value) { value.bind(function (to) { $('.calltoaction_full_widget_content .section-title').html(to); }) }); wp.customize('business_roy_appointment_subtitle', function (value) { value.bind(function (to) { $('.calltoaction_full_widget_content .calltoaction_subtitle').html(to); }) }); wp.customize('business_roy_video_calltoaction_alignment', function (value) { value.bind(function (to) { $('.calltoaction_promo_wrapper').removeClass('text-left text-right text-center').addClass(to); }) }); /****** * Gallery / Portfolio */ wp.customize('business_roy_gallery_subtitle', function (value) { value.bind(function (to) { $('.recentwork-section .super-title').html(to); }) }); wp.customize('business_roy_gallery_title', function (value) { value.bind(function (to) { $('.recentwork-section .section-title').html(to); }) }); /********* * Testimonial */ wp.customize('business_roy_testimonial_cover_image', function (value) { value.bind(function (to) { $('.avtar_faces img').attr('src', to); }) }); /******** * Counter Icon */ wp.customize('business_roy_counter_icon_style', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ".counter-section .achivement-items ul li .timer-icon{ \ background-color: " + value.bg_color + "; \ color:" + value.color + "; \ border:solid " + value.borderwidth + "px " + value.bordercolor + "; \ }"; var top_left_radius = ( value.radius.desktop.top === '' ) ? 12 : value.radius.desktop.top; var top_right_radius = ( value.radius.desktop.right === '' ) ? 12 : value.radius.desktop.right; var bottom_right_radius = ( value.radius.desktop.bottom === '' ) ? 12 : value.radius.desktop.bottom; var bottom_left_radius = ( value.radius.desktop.left === '' ) ? 12 : value.radius.desktop.left; var tablet_top_left_radius = ( value.radius.tablet.top === '' ) ? 12 : value.radius.tablet.top; var tablet_top_right_radius = ( value.radius.tablet.right === '' ) ? 12 : value.radius.tablet.right; var tablet_bottom_right_radius = ( value.radius.tablet.bottom === '' ) ? 12 : value.radius.tablet.bottom; var tablet_bottom_left_radius = ( value.radius.tablet.left === '' ) ? 12 : value.radius.tablet.left; var mobile_top_left_radius = ( value.radius.mobile.top === '' ) ? 12 : value.radius.mobile.top; var mobile_top_right_radius = ( value.radius.mobile.right === '' ) ? 12 : value.radius.mobile.right; var mobile_bottom_right_radius = ( value.radius.mobile.bottom === '' ) ? 12 : value.radius.mobile.bottom; var mobile_bottom_left_radius = ( value.radius.mobile.left === '' ) ? 12 : value.radius.mobile.left; css += ".counter-section .achivement-items ul li .timer-icon{ border-radius: " + top_left_radius + "px " + top_right_radius + "px " + bottom_right_radius + "px " + bottom_left_radius + "px;}"; css += '@media screen and (max-width:768px){'; ".counter-section .achivement-items ul li .timer-icon{ border-radius: " + tablet_top_left_radius + "px " + tablet_top_right_radius + "px " + tablet_bottom_right_radius + "px " + tablet_bottom_left_radius + "px;}"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".counter-section .achivement-items ul li .timer-icon{ border-radius: " + mobile_top_left_radius + "px " + mobile_top_right_radius + "px " + mobile_bottom_right_radius + "px " + mobile_bottom_left_radius + "px;}"; css += '}'; css += ".counter-section .achivement-items ul li .timer-icon{padding-top:" + value.padding.desktop.top + "px; padding-right:" + value.padding.desktop.right + "px; padding-bottom:" + value.padding.desktop.bottom + "px; padding-left:" + value.padding.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".counter-section .achivement-items ul li .timer-icon{padding-top:" + value.padding.tablet.top + "px; padding-right:" + value.padding.tablet.right + "px; padding-bottom:" + value.padding.tablet.bottom + "px; padding-left:" + value.padding.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".counter-section .achivement-items ul li .timer-icon{padding-top:" + value.padding.mobile.top + "px; padding-right:" + value.padding.mobile.right + "px; padding-bottom:" + value.padding.mobile.bottom + "px; padding-left:" + value.padding.mobile.left + "px; }"; css += '}'; business_roy_set_dynamic_css('business_roy_promoservice_icon_style', css); }); }); wp.customize('business_roy_counter_group_style', function (value) { value.bind(function (to) { var value = JSON.parse(to); var css = ".counter-section .achivement-items ul li{ \ background-color: " + value.bg_color + "; \ color:" + value.color + "; \ border:solid " + value.borderwidth + "px " + value.bordercolor + "; \ }"; var top_left_radius = ( value.radius.desktop.top === '' ) ? 12 : value.radius.desktop.top; var top_right_radius = ( value.radius.desktop.right === '' ) ? 12 : value.radius.desktop.right; var bottom_right_radius = ( value.radius.desktop.bottom === '' ) ? 12 : value.radius.desktop.bottom; var bottom_left_radius = ( value.radius.desktop.left === '' ) ? 12 : value.radius.desktop.left; var tablet_top_left_radius = ( value.radius.tablet.top === '' ) ? 12 : value.radius.tablet.top; var tablet_top_right_radius = ( value.radius.tablet.right === '' ) ? 12 : value.radius.tablet.right; var tablet_bottom_right_radius = ( value.radius.tablet.bottom === '' ) ? 12 : value.radius.tablet.bottom; var tablet_bottom_left_radius = ( value.radius.tablet.left === '' ) ? 12 : value.radius.tablet.left; var mobile_top_left_radius = ( value.radius.mobile.top === '' ) ? 12 : value.radius.mobile.top; var mobile_top_right_radius = ( value.radius.mobile.right === '' ) ? 12 : value.radius.mobile.right; var mobile_bottom_right_radius = ( value.radius.mobile.bottom === '' ) ? 12 : value.radius.mobile.bottom; var mobile_bottom_left_radius = ( value.radius.mobile.left === '' ) ? 12 : value.radius.mobile.left; css += ".counter-section .achivement-items ul li{ border-radius: " + top_left_radius + "px " + top_right_radius + "px " + bottom_right_radius + "px " + bottom_left_radius + "px;}"; css += '@media screen and (max-width:768px){'; ".counter-section .achivement-items ul li{ border-radius: " + tablet_top_left_radius + "px " + tablet_top_right_radius + "px " + tablet_bottom_right_radius + "px " + tablet_bottom_left_radius + "px;}"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".counter-section .achivement-items ul li{ border-radius: " + mobile_top_left_radius + "px " + mobile_top_right_radius + "px " + mobile_bottom_right_radius + "px " + mobile_bottom_left_radius + "px;}"; css += '}'; css += ".counter-section .achivement-items ul li{padding-top:" + value.padding.desktop.top + "px; padding-right:" + value.padding.desktop.right + "px; padding-bottom:" + value.padding.desktop.bottom + "px; padding-left:" + value.padding.desktop.left + "px; }"; css += '@media screen and (max-width:768px){'; css += ".counter-section .achivement-items ul li{padding-top:" + value.padding.tablet.top + "px; padding-right:" + value.padding.tablet.right + "px; padding-bottom:" + value.padding.tablet.bottom + "px; padding-left:" + value.padding.tablet.left + "px; }"; css += '}'; css += '@media screen and (max-width:480px){'; css += ".counter-section .achivement-items ul li{padding-top:" + value.padding.mobile.top + "px; padding-right:" + value.padding.mobile.right + "px; padding-bottom:" + value.padding.mobile.bottom + "px; padding-left:" + value.padding.mobile.left + "px; }"; css += '}'; business_roy_set_dynamic_css('business_roy_promoservice_icon_style', css); }); }); /** Header Font */ wp.customize('business_roy_menu_style', function (value) { value.bind(function (to) { $('.box-header-nav .main-menu .page_item a, .box-header-nav .main-menu > .menu-item > a').css('font-style', to); }); }); wp.customize('business_roy_menu_text_decoration', function (value) { value.bind(function (to) { $('.box-header-nav .main-menu .page_item a, .box-header-nav .main-menu > .menu-item > a').css('text-decoration', to); }); }); wp.customize('business_roy_menu_text_transform', function (value) { value.bind(function (to) { $('.box-header-nav .main-menu .page_item a, .box-header-nav .main-menu > .menu-item > a').css('text-transform', to); }); }); wp.customize('business_roy_menu_size', function (value) { value.bind(function (to) { $('.box-header-nav .main-menu .page_item a, .box-header-nav .main-menu > .menu-item > a').css('font-size', to); }); }); wp.customize('business_roy_menu_line_height', function (value) { value.bind(function (to) { $('.box-header-nav .main-menu .page_item a, .box-header-nav .main-menu > .menu-item > a').css('line-height', to); }); }); wp.customize('business_roy_menu_letter_spacing', function (value) { value.bind(function (to) { $('.box-header-nav .main-menu .page_item a, .box-header-nav .main-menu > .menu-item > a').css('letter-spacing', to); }); }); /** header style */ wp.customize('business_roy_menu_letter_spacing', function (value) { value.bind(function (to) { $('.box-header-nav .main-menu .page_item a, .box-header-nav .main-menu > .menu-item > a').css('letter-spacing', to); }); }); });