/** * Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. * * @package bigbang * @since 1.1.38 */ /* global wp*/ /* global bigbangGetCss */ /** * ------------------- * Posts & Pages * ------------------- */ /** * Live refresh for font size for: * pages/posts titles */ wp.customize( 'bigbang_header_titles_fs', function (value) { 'use strict'; value.bind( function( to ) { var settings = { cssProperty: 'font-size', propertyUnit: 'px', styleClass: 'bigbang-header-titles-fs' }; var arraySizes = { size3: { selectors: '.page-header.header-small .bigbang-title, .page-header.header-small .title, h1.bigbang-title.title-in-content', values: [42,36,36] } }; bigbangGetCss( arraySizes, settings, to ); } ); } ); /** * Live refresh for font size for: * headings ( h1 - h6 ) on pages and single post pages */ wp.customize( 'bigbang_post_page_headings_fs', function (value) { 'use strict'; value.bind( function( to ) { var settings = { cssProperty: 'font-size', propertyUnit: 'px', styleClass: 'bigbang-post-page-headings-fs' }; var arraySizes = { size1: { selectors: '.single-post-wrap article h1:not(.title-in-content), .page-content-wrap h1:not(.title-in-content), .page-template-template-fullwidth article h1:not(.title-in-content)', values: [42,36,36] }, size2: { selectors: '.single-post-wrap article h2, .page-content-wrap h2, .page-template-template-fullwidth article h2', values: [37,32,32] }, size3: { selectors: '.single-post-wrap article h3, .page-content-wrap h3, .page-template-template-fullwidth article h3', values: [32,28,28] }, size4: { selectors: '.single-post-wrap article h4, .page-content-wrap h4, .page-template-template-fullwidth article h4', values: [27,24,24] }, size5: { selectors: '.single-post-wrap article h5, .page-content-wrap h5, .page-template-template-fullwidth article h5', values: [23,21,21] }, size6: { selectors: '.single-post-wrap article h6, .page-content-wrap h6, .page-template-template-fullwidth article h6', values: [18,18,18] } }; bigbangGetCss( arraySizes, settings, to ); } ); } ); /** * Live refresh for font size for: * content ( p ) on pages * single post pages */ wp.customize( 'bigbang_post_page_content_fs', function (value) { 'use strict'; value.bind( function( to ) { var settings = { cssProperty: 'font-size', propertyUnit: 'px', styleClass: 'bigbang-post-page-content-fs' }; var arraySizes = { size1: { selectors: '.single-post-wrap article p:not(.meta-in-content), .page-content-wrap p, .single-post-wrap article ul, .page-content-wrap ul, .single-post-wrap article ol, .page-content-wrap ol, .single-post-wrap article dl, .page-content-wrap dl, .single-post-wrap article table, .page-content-wrap table, .page-template-template-fullwidth article p, .page-template-template-fullwidth article ol, .page-template-template-fullwidth article ul, .page-template-template-fullwidth article dl, .page-template-template-fullwidth article table', values: [18,18,18] }, }; bigbangGetCss( arraySizes, settings, to ); } ); } ); /** * ------------------- * Frontpage Sections * ------------------- */ /** * Big Title Section / Header Slider * Controls all elements from the big title section. */ wp.customize( 'bigbang_big_title_fs', function (value) { 'use strict'; value.bind( function( to ) { var settings = { cssProperty: 'font-size', propertyUnit: 'px', styleClass: 'bigbang-big-title-fs' }; var arraySizes = { size1: { selectors: '#carousel-bigbang-generic .bigbang-title', values: [67,36,36], correlation: [1,4,4] }, size2: { selectors: '#carousel-bigbang-generic span.sub-title', values: [18,18,18], correlation: [8,4,4] }, size3: { selectors: '#carousel-bigbang-generic .btn', values: [14,14,14], correlation: [12,6,6] }, }; bigbangGetCss( arraySizes, settings, to ); } ); } ); /** * Live refresh for font size for: * all frontpage sections titles and small headings ( Feature box title, Shop box title, Team box title, Testimonial box title, Blog box title ) */ wp.customize( 'bigbang_section_primary_headings_fs', function (value) { 'use strict'; value.bind( function( to ) { var settings = { cssProperty: 'font-size', propertyUnit: 'px', styleClass: 'bigbang-section-primary-headings-fs' }; var arraySizes = { size1: { selectors: 'section.bigbang-features .bigbang-title, section.bigbang-shop .bigbang-title, section.bigbang-work .bigbang-title, section.bigbang-team .bigbang-title, section.bigbang-pricing .bigbang-title, section.bigbang-ribbon .bigbang-title, section.bigbang-testimonials .bigbang-title, section.bigbang-subscribe h2.title, section.bigbang-blogs .bigbang-title, .section.related-posts .bigbang-title, section.bigbang-contact .bigbang-title', values: [37,24,24], limit: 18 }, size2: { selectors: 'section.bigbang-features .bigbang-info h4.info-title, section.bigbang-shop h4.card-title, section.bigbang-team h4.card-title, section.bigbang-testimonials h4.card-title, section.bigbang-blogs h4.card-title, .section.related-posts h4.card-title, section.bigbang-contact h4.card-title, section.bigbang-contact .bigbang-description h6', values: [18,18,18], correlation: [3,3,3], limit: 14}, size3: { selectors: 'section.bigbang-work h4.card-title, section.bigbang-contact .bigbang-description h5', values: [23,23,23], correlation: [3,3,3] }, size4: { selectors: 'section.bigbang-contact .bigbang-description h1', values: [42,42,42], correlation: [3,3,3] }, size5: { selectors: 'section.bigbang-contact .bigbang-description h2', values: [37,24,24], correlation: [3,3,3] }, size6: { selectors: 'section.bigbang-contact .bigbang-description h3', values: [32,32,32], correlation: [3,3,3] }, size7: { selectors: 'section.bigbang-contact .bigbang-description h4', values: [27,27,27], correlation: [3,3,3] }, }; bigbangGetCss( arraySizes, settings, to ); } ); } ); /** * Live refresh for font size for: * all frontpage sections subtitles * WooCommerce pages subtitles ( Single product page price, Cart and Checkout pages subtitles ) */ wp.customize( 'bigbang_section_secondary_headings_fs', function (value) { 'use strict'; value.bind( function( to ) { var settings = { cssProperty: 'font-size', propertyUnit: 'px', styleClass: 'bigbang-section-secondary-headings-fs' }; var arraySizes = { size1: { selectors: 'section.bigbang-features h5.description, section.bigbang-shop h5.description, section.bigbang-work h5.description, section.bigbang-team h5.description, section.bigbang-testimonials h5.description, section.bigbang-subscribe h5.subscribe-description, section.bigbang-blogs h5.description, section.bigbang-contact h5.description', values: [18,18,18], limit: 12, correlation: [3,3,3] }, }; bigbangGetCss( arraySizes, settings, to ); } ); } ); /** * Live refresh for font size for: * all frontpage sections box content */ wp.customize( 'bigbang_section_content_fs', function (value) { 'use strict'; value.bind( function( to ) { var settings = { cssProperty: 'font-size', propertyUnit: 'px', styleClass: 'bigbang-section-content-fs' }; var arraySizes = { size3: { selectors: 'section.bigbang-features .bigbang-info p, section.bigbang-shop .card-description p', values: [16,16,16], limit: 12, correlation: [3,3,3] }, size2: { selectors: 'section.bigbang-team p.card-description, section.bigbang-pricing p.text-gray, section.bigbang-testimonials p.card-description, section.bigbang-blogs p.card-description, .section.related-posts p.card-description, .bigbang-contact p', values: [14,14,14], limit: 12, correlation: [3,3,3] }, size1: { selectors: 'section.bigbang-shop h6.category, section.bigbang-work .label-primary, section.bigbang-team h6.category, section.bigbang-pricing .card-pricing h6.category, section.bigbang-testimonials h6.category, section.bigbang-blogs h6.category, .section.related-posts h6.category', values: [12,12,12], limit: 12, correlation: [3,3,3] }, }; bigbangGetCss( arraySizes, settings, to ); } ); } ); /** * ------------------- * Generic options * ------------------- */ /** * Live refresh for font size for: * Primary menu * Footer menu */ wp.customize( 'bigbang_menu_fs', function (value) { 'use strict'; value.bind( function( to ) { var settings = { cssProperty: 'font-size', propertyUnit: 'px', styleClass: 'bigbang-menu-fs' }; var arraySizes = { size1: { selectors: '.navbar #main-navigation a, .footer .footer-menu li a', values: [12,12,12], limit: 10 } }; bigbangGetCss( arraySizes, settings, to ); } ); } );