function ut_needed_js() { global $detect; /* check for js cache */ if (ot_get_option('ut_use_cache', 'off') == 'on' && is_front_page()) { $transient_prefix = $detect->isMobile() ? '_mobile' : '_desktop'; $language_prefix = defined('ICL_LANGUAGE_CODE') ? '_' . ICL_LANGUAGE_CODE : ''; $js = get_transient('ut_js_cache' . $transient_prefix . $language_prefix); if (!empty($js)) { echo apply_filters('ut-custom-js', $js); return; } } $accentcolor = get_option('ut_accentcolor', '#CC5E53'); $ut_hero_type = ut_return_hero_config('ut_hero_type'); $js = '(function($){ "use strict"; $(document).ready(function(){ '; $js .= 'var brooklyn_scroll_offset = $("#header-section").outerHeight();'; /* |-------------------------------------------------------------------------- | Retina Logo |-------------------------------------------------------------------------- */ /* check if current page has an option tp show a hero */ $ut_activate_page_hero = get_post_meta(get_the_ID(), 'ut_activate_page_hero', true); $sitelogo_retina = !is_front_page() && !is_home() && ($ut_activate_page_hero == 'off' || empty($ut_activate_page_hero)) ? get_theme_mod('ut_site_logo_alt_retina') : get_theme_mod('ut_site_logo_retina'); $alternate_logo_retina = get_theme_mod('ut_site_logo_alt_retina') ? get_theme_mod('ut_site_logo_alt_retina') : get_theme_mod('ut_site_logo_retina'); $js .= 'window.matchMedia||(window.matchMedia=function(){var c=window.styleMedia||window.media;if(!c){var a=document.createElement("style"),d=document.getElementsByTagName("script")[0],e=null;a.type="text/css";a.id="matchmediajs-test";d.parentNode.insertBefore(a,d);e="getComputedStyle"in window&&window.getComputedStyle(a,null)||a.currentStyle;c={matchMedium:function(b){b="@media "+b+"{ #matchmediajs-test { width: 1px; } }";a.styleSheet?a.styleSheet.cssText=b:a.textContent=b;return"1px"===e.width}}}return function(a){return{matches:c.matchMedium(a|| "all"),media:a||"all"}}}());'; $js .= 'var ut_modern_media_query = window.matchMedia( "screen and (-webkit-min-device-pixel-ratio:2)");'; if (!empty($sitelogo_retina)) { $js .= 'if( ut_modern_media_query.matches ) { var $logo = $(".site-logo img"); $logo.attr("src" , retina_logos.sitelogo_retina ); }'; } if (!empty($alternate_logo_retina)) { $js .= 'if( ut_modern_media_query.matches ) { var $logo = $(".site-logo img"); $logo.data("altlogo" , retina_logos.alternate_logo_retina ); }'; } /* |-------------------------------------------------------------------------- | Pre Loader |-------------------------------------------------------------------------- */ if (ot_get_option('ut_use_image_loader') == 'on') { if (ut_dynamic_conditional('ut_use_image_loader_on')) { /* settings for pre loader */ $loadercolor = ot_get_option('ut_image_loader_color', $accentcolor); $barcolor = ot_get_option('ut_image_loader_bar_color', $accentcolor); $loader_bg_color = ot_get_option('ut_image_loader_background', '#FFF'); $bar_height = ot_get_option('ut_image_loader_barheight', 3); $ut_show_loader_bar = ot_get_option('ut_show_loader_bar', 'on'); if ($detect->isMobile()) { $js .= 'window.addEventListener("DOMContentLoaded", function() { $("body").queryLoader2({ showbar: "' . $ut_show_loader_bar . '", barColor: "' . $barcolor . '", textColor: "' . $loadercolor . '", backgroundColor: "' . $loader_bg_color . '", barHeight: ' . $bar_height . ', percentage: true, completeAnimation: "fade", minimumTime: 500, onComplete : function() { $(".ut-loader-overlay").fadeOut( 600 , "easeInOutExpo" , function() { $(this).remove(); }); } }); });'; } else { $js .= '$("body").queryLoader2({ showbar: "' . $ut_show_loader_bar . '", barColor: "' . $barcolor . '", textColor: "' . $loadercolor . '", backgroundColor: "' . $loader_bg_color . '", barHeight: ' . $bar_height . ', percentage: true, completeAnimation: "fade", minimumTime: 500, onComplete : function() { $(".ut-loader-overlay").fadeOut( 600 , "easeInOutExpo" , function() { $(this).remove(); }); } });'; } } } /* |-------------------------------------------------------------------------- | Slogan / Welcome Message Animation |-------------------------------------------------------------------------- */ if ($ut_hero_type != 'slider') { $js .= ' $(window).load(function() { function show_slogan() { $(".hero-holder").animate({ opacity : 1 }); } var execute_slogan = setTimeout ( show_slogan , 800 ); });'; } /* |-------------------------------------------------------------------------- | Fittext for Hero Style 11 |-------------------------------------------------------------------------- */ if (ut_return_hero_config('ut_hero_style', 'ut-hero-style-1') == 'ut-hero-style-11') { $js .= ' $(".ut-hero-style-11 .hero-title").fitText(1.1, { minFontSize: "30px", maxFontSize: "130px" }); $(".ut-hero-style-11 .hero-description").fitText(1.6, { minFontSize: "20px", maxFontSize: "72px" }); $(".ut-hero-style-11 .hero-description-bottom").fitText(2.0, { minFontSize: "14px", maxFontSize: "20px" }); '; } /* |-------------------------------------------------------------------------- | Call to Action Button Scoll Animation | only available if shortcode plugin has been installed |-------------------------------------------------------------------------- */ if (ut_is_plugin_active('ut-shortcodes/ut-shortcodes.php')) { $js .= ' $(".cta-btn a").click( function(event) { if(this.hash) { $.scrollTo( this.hash , 650, { easing: "easeInOutExpo" , offset: -brooklyn_scroll_offset-1 , "axis":"y" } ); event.preventDefault(); } }); '; } /* |-------------------------------------------------------------------------- | Main Navigation Animation ( only for blog and front page ) |-------------------------------------------------------------------------- */ if ((is_home() || is_front_page() || is_singular('portfolio') || get_post_meta(get_the_ID(), 'ut_activate_page_hero', true) == 'on') && ot_get_option('ut_navigation_state', 'off') == 'off') { $ut_navigation_skin = ot_get_option('ut_navigation_skin', 'ut-header-light'); $navigation_width = ot_get_option('ut_navigation_width', 'centered'); $ut_site_border_header_class = ot_get_option('ut_site_border', 'hide') == 'show' ? 'bordered-navigation' : ''; $js .= ' /* Header Animation ================================================== */ var $header = $("#header-section"), $logo = $(".site-logo img"), logo = $logo.attr("src"), logoalt = $logo.data("altlogo"), is_open = false, has_passed = false; var ut_nav_skin_changer = function( direction , animClassDown , animClassUp ) { if( direction === "down" && animClassDown ) { $header.attr("class", "ha-header ' . $ut_navigation_skin . ' ' . $navigation_width . '" + animClassDown + " ' . $ut_site_border_header_class . '" ); $logo.attr("src" , logoalt ); } else if( direction === "up" && animClassUp ){ $header.attr("class", "ha-header ' . $ut_navigation_skin . ' ' . $navigation_width . ' " + animClassUp + " ' . $ut_site_border_header_class . '"); $logo.attr("src" , logo ); } }; $( ".ha-waypoint" ).each( function(i) { /* needed vars */ var $this = $( this ), animClassDown = $this.data( "animateDown" ), animClassUp = $this.data( "animateUp" ); $this.waypoint(function(direction) { ut_nav_skin_changer( direction , animClassDown , animClassUp ); }, { offset: brooklyn_scroll_offset+1 } ); });'; } if ((is_home() || is_front_page() || is_singular('portfolio') || get_post_meta(get_the_ID(), 'ut_activate_page_hero', true) == 'on') && ot_get_option('ut_navigation_state', 'off') == 'on_transparent') { $ut_navigation_skin = ot_get_option('ut_navigation_skin', 'ut-header-light'); $navigation_width = ot_get_option('ut_navigation_width', 'centered'); $ut_site_border_header_class = ot_get_option('ut_site_border', 'hide') == 'show' ? 'bordered-navigation' : ''; $js .= ' /* Header Animation ================================================== */ var $header = $("#header-section"), $logo = $(".site-logo img"), logo = $logo.attr("src"), logoalt = $logo.data("altlogo"), is_open = false, has_passed = false; var ut_update_header_skin = function() { if (($(window).width() > 979) && is_open ) { $(".ut-mm-trigger").trigger("click"); if( has_passed ) { $header.attr("class", "ha-header ' . $ut_navigation_skin . ' ' . $navigation_width . ' ' . $ut_site_border_header_class . '"); } else { $header.attr("class", "ha-header ha-transparent ' . $navigation_width . ' ' . $ut_site_border_header_class . '"); } } }; var ut_nav_skin_changer = function( direction ) { if( direction === "down" && !is_open ) { $header.attr("class", "ha-header ' . $ut_navigation_skin . ' ' . $navigation_width . ' ' . $ut_site_border_header_class . '"); $logo.attr("src" , logoalt ); has_passed = true; } else if( direction === "up" && !is_open ) { $header.attr("class", "ha-header ha-transparent ' . $navigation_width . ' ' . $ut_site_border_header_class . '"); $logo.attr("src" , logo ); has_passed = false; } }; $(".ut-mm-trigger").click(function(event){ if( $header.hasClass("ha-transparent") && !has_passed ) { $header.attr("class", "ha-header ' . $navigation_width . ' ' . $ut_navigation_skin . ' ' . $ut_site_border_header_class . '"); $logo.attr("src" , logoalt ); } else if ( $header.hasClass("' . $ut_navigation_skin . '") && !has_passed ) { $header.attr("class", "ha-header ' . $navigation_width . ' ha-transparent ' . $ut_site_border_header_class . '"); $logo.attr("src" , logo ); } event.preventDefault(); }).toggle(function(){ is_open = true; }, function() { is_open = false; }); $(window).utresize(function(){ ut_update_header_skin(); }); $( "#main-content" ).waypoint(function(direction) { ut_nav_skin_changer(direction); if( direction === "down" ) { has_passed = true; } else if( direction === "up" ) { has_passed = false; } }, { offset: brooklyn_scroll_offset+1 });'; } /* |-------------------------------------------------------------------------- | Rain Effect for images |-------------------------------------------------------------------------- */ if (ut_return_hero_config('ut_hero_rain_effect', 'off') == 'on' && ($ut_hero_type == 'image' || $ut_hero_type == 'tabs' || $ut_hero_type == 'splithero')) { $js .= ' $.fn.utFullSize = function( callback ) { var fullsize = $(this); function utResizeObject() { var imgwidth = fullsize.width(), imgheight = fullsize.height(), winwidth = $(window).width(), winheight = $(window).height(), widthratio = winwidth / imgwidth, heightratio = winheight / imgheight, widthdiff = heightratio * imgwidth, heightdiff = widthratio * imgheight; if( heightdiff > winheight ) { fullsize.css({ width: winwidth+"px", height: heightdiff+"px" }); } else { fullsize.css({ width: widthdiff+"px", height: winheight+"px" }); } } utResizeObject(); $(window).utresize(function(){ utResizeObject(); }); if (callback && typeof(callback) === "function") { callback(); } }; function ut_init_RainyDay( callback ) { var $image = document.getElementById("ut-rain-background"), $hero = document.getElementById("ut-hero"); var engine = new RainyDay({ image: $image, parentElement : $hero, blur: 20, opacity: 1, fps: 24 }); engine.gravity = engine.GRAVITY_NON_LINEAR; engine.trail = engine.TRAIL_SMUDGE; engine.rain([ [6, 6, 0.1], [2, 2, 0.1] ], 50 ); $image.crossOrigin = "anonymous"; if (callback && typeof(callback) === "function") { callback(); } } $(window).load(function(){ $("#ut-rain-background").utFullSize( function() { /* play rainday sound and remove section image and adjust canvas */ ut_init_RainyDay( function() { $("#ut-hero").css("background-image" , "none"); $("#ut-hero canvas").utFullSize(); if( $("#ut-hero-audio").length != 0 ) { $("#ut-hero-audio").find(".mejs-play button").click(); } }); }); });'; if (ut_return_hero_config('ut_hero_rain_sound', 'off') == 'on') { $js .= ' $(".ut-audio-control").click(function(event){ var $audioPlayer = $("#ut-hero-audio"); if( $(".ut-audio-control").hasClass("ut-unmute") ) { $audioPlayer.find(".mejs-mute button").click(); $(this).removeClass("ut-unmute").addClass("ut-mute").text("MUTE"); } else { $audioPlayer.find(".mejs-unmute button").click(); $(this).removeClass("ut-mute").addClass("ut-unmute").text("UNMUTE"); } event.preventDefault(); }); '; } } /* |-------------------------------------------------------------------------- | Video Player Call |-------------------------------------------------------------------------- */ if (!$detect->isMobile() && $ut_hero_type == 'video' || !$detect->isMobile() && $ut_hero_type == 'tabs' && ut_return_hero_config('ut_video_containment', 'hero') == 'body') { $volume = ut_return_hero_config('ut_video_volume', "5"); $js .= ' if( $("#ut-background-video-hero").length ) { $("#ut-background-video-hero").mb_YTPlayer(); /* player mute control */ $("#ut-video-hero-control.youtube").click(function(event){ if( $(this).hasClass("ut-unmute") ) { $(this).removeClass("ut-unmute").addClass("ut-mute").text("MUTE"); $("#ut-background-video-hero").unmuteYTPVolume(); $("#ut-background-video-hero").setYTPVolume(' . $volume . '); } else { $(this).removeClass("ut-mute").addClass("ut-unmute").text("UNMUTE"); $("#ut-background-video-hero").muteYTPVolume(); } event.preventDefault(); }); }'; } /* |-------------------------------------------------------------------------- | Slider Settings Hook |-------------------------------------------------------------------------- */ if ($ut_hero_type == 'slider' || is_singular("portfolio") && get_post_format() == 'gallery') { $animation = ut_return_hero_config('ut_background_slider_animation', 'fade'); $slideshowSpeed = ut_return_hero_config('ut_background_slider_slideshow_speed', 7000); $animationSpeed = ut_return_hero_config('ut_background_slider_animation_speed', 600); if (is_singular("portfolio")) { $animation = 'fade'; $slideshowSpeed = '7000'; $animationSpeed = '600'; } $js .= ' $(window).load(function(){ var $hero_captions = $("#ut-hero-captions"), animatingTo = 0; $hero_captions.find(".hero-holder").each(function() { var pos = $(this).data("animation"), add = "-50%"; if( pos==="left" || pos==="right" ) { add = "-25%" }; $(this).css( pos , add ); }); $hero_captions.flexslider({ animation: "fade", animationSpeed: ' . $animationSpeed . ', slideshowSpeed: ' . $slideshowSpeed . ', controlNav: false, directionNav: false, animationLoop: true, slideshow: true, before: function(slider){ /* hide hero holder */ $(".flex-active-slide").find(".hero-holder").fadeOut("fast", function() { var pos = $(this).data("animation"), anim = { opacity: 0 , display : "table" }, add = "-50%"; if( pos==="left" || pos==="right" ) { add = "-25%" }; anim[pos] = add; $(this).css(anim); }); /* animate background slider */ $("#ut-hero-slider").flexslider(slider.animatingTo); }, after: function(slider) { /* change position of caption slider */ slider.animate( { top : ( $(window).height() - $hero_captions.find(".flex-active-slide").height() ) / 2 } , 100 , function() { /* show hero holder */ var pos = $(".flex-active-slide").find(".hero-holder").data("animation"), anim = { opacity: 1 }; anim[pos] = 0; $(".flex-active-slide").find(".hero-holder").animate( anim ); }); }, start: function(slider) { /* create external navigation */ $(".ut-flex-control").click(function(event){ if ($(this).hasClass("next")) { slider.flexAnimate(slider.getTarget("next"), true); } else { slider.flexAnimate(slider.getTarget("prev"), true); } event.preventDefault(); }); $(".hero.slider .parallax-overlay").fadeIn("fast"); /* change position of caption slider */ slider.animate( { top : ( $(window).height() - $hero_captions.find(".flex-active-slide").height() ) / 2 } , 100 , function() { /* show hero holder */ var pos = $(".flex-active-slide").find(".hero-holder").data("animation"), anim = { opacity: 1 }; anim[pos] = 0; $(".flex-active-slide").find(".hero-holder").animate( anim ); }); } }); var ut_trigger = 0; $(window).utresize(function(){ /* do not fire on window load resize event */ if( ut_trigger > 0 ) { /* adjust first slide browser bug */ $hero_captions.find(".hero-holder").each(function() { $(this).find(".hero-title").width(""); if( $(this).width() > $(this).parent().width() ) { $(this).find(".hero-title").width( $(this).parent().width()-20 ); } }); /* change slide */ $hero_captions.flexslider("next"); $hero_captions.flexslider("play"); } ut_trigger++; }); $("#ut-hero-slider").flexslider({ animation: "fade", animationSpeed: ' . $animationSpeed . ', slideshowSpeed: ' . $slideshowSpeed . ', directionNav: false, controlNav: false, animationLoop: true, slideshow: true }); });'; } /* |-------------------------------------------------------------------------- | Parallax Effect for Hero on Front Page |-------------------------------------------------------------------------- */ if (ut_return_hero_config('ut_hero_image_parallax') == 'on') { if (!$detect->isMobile()) { $js .= '$(".hero .parallax-scroll-container").parallax("50%", 0.6);'; } } /* |-------------------------------------------------------------------------- | Parallax Effect - disabled for mobile devices to much repaint cost |-------------------------------------------------------------------------- */ if (!$detect->isMobile()) { $js .= '$(".parallax-banner .parallax-scroll-container").each(function() { $(this).css({ "height" : $(window).height() * 1.1 + "px", "width" : $(window).width() * 1.1 + "px", "left" : "-5%" }).parallax( "50%", 0.6 ); });'; } /* |-------------------------------------------------------------------------- | Parallax Effect for Footer |-------------------------------------------------------------------------- */ $ut_csection_parallax = ot_get_option('ut_csection_parallax', 'on'); if ($ut_csection_parallax == 'on') { if (!$detect->isMobile()) { $js .= '$(".contact-section .parallax-scroll-container").css({ "height" : $(window).height() * 1.1 + "px", "width" : $(window).width() * 1.1 + "px", "left" : "-5%" }).parallax("50%", 0.6,true);'; } } /* |-------------------------------------------------------------------------- | Lightbox |-------------------------------------------------------------------------- */ $ut_lightbox_script = ot_get_option('ut_lightbox_script', 'prettyphoto'); if ($ut_lightbox_script == 'prettyphoto') { $js .= '$(".ut-lightbox").prettyPhoto({ social_tools : false, markup: \'<div class="pp_pic_holder"> \\ <div class="pp_top"> \\ <div class="pp_left"></div> \\ <div class="pp_middle"></div> \\ <div class="pp_right"></div> \\ </div> \\ <div class="pp_content_container"> \\ <div class="pp_left"> \\ <div class="pp_right"> \\ <div class="pp_content"> \\ <div class="pp_loaderIcon"></div> \\ <div class="pp_fade"> \\ <a href="#" class="pp_expand" title="Expand the image">Expand</a> \\ <div class="pp_hoverContainer"> \\ <a class="pp_next" href="#">next</a> \\ <a class="pp_previous" href="#">previous</a> \\ </div> \\ <div id="pp_full_res"></div> \\ <div class="pp_details"> \\ <div class="pp_nav"> \\ <a href="#" class="pp_arrow_previous">Previous</a> \\ <p class="currentTextHolder">0/0</p> \\ <a href="#" class="pp_arrow_next">Next</a> \\ </div> \\ <p class="pp_description"></p> \\ <div class="ppt"> </div> \\ {pp_social} \\ <a class="pp_close" href="#">Close</a> \\ </div> \\ </div> \\ </div> \\ </div> \\ </div> \\ </div> \\ <div class="pp_bottom"> \\ <div class="pp_left"></div> \\ <div class="pp_middle"></div> \\ <div class="pp_right"></div> \\ </div> \\ </div> \\ <div class="pp_overlay"></div>\', });'; } else { $js .= '$(".ut-lightbox").lightGallery({ selector: "this", hash: false });'; } /* |-------------------------------------------------------------------------- | Section Animation |-------------------------------------------------------------------------- */ global $detect; if (!$detect->isMobile() && ot_get_option('ut_animate_sections', 'on') == 'on') { $csection_timer = ot_get_option('ut_animate_sections_timer', '1600'); $js .= '$("section").each(function() { var outerHeight = $(this).outerHeight(), offset = "90%", effect = $(this).data("effect"); if( outerHeight > $(window).height() / 2 ) { offset = "70%"; } $(this).waypoint("destroy"); $(this).waypoint( function( direction ) { var $this = $(this); if( direction === "down" && !$(this).hasClass( "animated-" + effect ) ) { $this.find(".section-content").animate( { opacity: 1 } , ' . $csection_timer . ' ); $this.find(".section-header-holder").animate( { opacity: 1 } , ' . $csection_timer . ' ); $this.addClass( "animated-" + effect ); } } , { offset: offset } ); }); $(window).load(function(){ $(window).trigger("resize"); });'; } $js .= '}); })(jQuery);'; /* check for css cache */ if (ot_get_option('ut_use_cache', 'off') == 'on' && is_front_page()) { $transient_prefix = $detect->isMobile() ? '_mobile' : '_desktop'; $language_prefix = defined('ICL_LANGUAGE_CODE') ? '_' . ICL_LANGUAGE_CODE : ''; $cacheTime = ot_get_option('ut_cache_ltime', '10'); set_transient('ut_js_cache' . $transient_prefix . $language_prefix, $js, 60 * $cacheTime); } //echo $js; echo apply_filters('ut-custom-js', $js); }
function ut_create_bg_videoplayer($call = '') { global $detect; if ($detect->isMobile()) { return; } $player = NULL; $video_url = NULL; $youtube = false; $custom = false; $selfhosted = false; $containment = ut_return_hero_config('ut_video_containment', 'hero') == 'body' ? 'body' : '#ut-hero'; /* only create player for desktop devices */ if (!$detect->isMobile()) { /* check if youtube is active */ if (ut_return_hero_config('ut_video_source', 'youtube') == 'youtube') { $youtube = true; } /* check if youtube is active */ if (ut_return_hero_config('ut_video_source', 'youtube') == 'custom') { $custom = true; } /* check if selfhosted is active */ if (ut_return_hero_config('ut_video_source', 'youtube') == 'selfhosted') { $selfhosted = true; } /* conditional to prevent selfhosted video displaying inside hero if it has been set to background */ if ($selfhosted && ut_return_hero_config('ut_video_containment', 'hero') == 'body' && $call == 'section') { return; } /* conditional to prevent selfhosted video displaying inside the background if it has been set to hero */ if ($selfhosted && ut_return_hero_config('ut_video_containment', 'hero') == 'hero' && $call == 'body') { return; } if ($youtube) { $video_url = ut_return_hero_config('ut_video_url'); if (!empty($video_url)) { $muted = ut_return_hero_config('ut_video_mute_state', "off"); $muted = $muted == 'off' ? 'mute : true' : 'mute : false'; $volume = ut_return_hero_config('ut_video_volume', "5"); $volume = $muted == 'off' ? 'vol : 0' : 'vol: ' . $volume; $loop = ut_return_hero_config('ut_video_loop', "on"); $loop = $loop == 'on' ? 'loop : true' : 'loop : false'; /* build player */ $player .= '<a id="ut-background-video-hero" class="ut-video-player" data-property="{ videoURL : \'' . $video_url . '\' , containment : \'' . $containment . '\', showControls: false, autoPlay : true, ' . $loop . ', ' . $muted . ', ' . $volume . ', startAt : 0, opacity : 1}"></a>'; return $player; } } if ($selfhosted) { $mp4 = $ogg = $webm = NULL; $mp4 = ut_return_hero_config('ut_video_mp4'); $ogg = ut_return_hero_config('ut_video_ogg'); $webm = ut_return_hero_config('ut_video_webm'); if (!empty($mp4) || !empty($ogg) || !empty($webm)) { $volume = ut_return_hero_config('ut_video_volume', "5"); $muted = ut_return_hero_config('ut_video_mute_state', "off"); $muted = $muted == 'off' ? 'muted' : ''; $loop = ut_return_hero_config('ut_video_loop', "on"); $loop = $loop == 'on' ? 'loop' : ''; $preload = ut_return_hero_config('ut_video_preload', "on"); $preload = $loop == 'on' ? 'preload="auto"' : ''; $player .= '<div class="ut-video-container"><video id="ut-video-hero" class="ut-selfvideo-player" autoplay ' . $loop . ' ' . $muted . ' ' . $preload . ' volume="' . $volume . '" autobuffer controls>'; if (!empty($mp4)) { $player .= '<source src="' . $mp4 . '" type="video/mp4"> '; } if (!empty($webm)) { $player .= '<source src="' . $webm . '" type="video/webm"> '; } if (!empty($ogg)) { $player .= ' <source src="' . $ogg . '" type="video/ogg ogv">'; } $player .= '</video></div><div class="ut-video-spacer"></div>'; return $player; } /* check for player files */ } if ($custom) { $video_embedded = ut_return_hero_config('ut_video_url_custom'); $player .= do_shortcode($video_embedded); } } return $player; }
function unitedthemes_custom_css() { global $detect, $post; /* check for css cache */ if (ot_get_option('ut_use_cache', 'off') == 'on' && is_front_page()) { $transient_prefix = $detect->isMobile() ? '_mobile' : '_desktop'; $css = get_transient('ut_css_cache' . $transient_prefix); if (!empty($css)) { echo apply_filters('ut-custom-css', $css); return; } } /* some needed variables first */ $accentcolor = get_option('ut_accentcolor', '#F1C40F'); $sitelogo = get_theme_mod('ut_site_logo'); $google_fonts = ut_recognized_google_fonts(); $ut_recognized_font_styles = ut_recognized_font_styles(); $font_styles = array('regular' => 'normal', 'normal' => 'normal', 'italic' => 'italic'); /* styleswitcher */ if (!empty($_GET['color'])) { $accentcolor = '#' . $_GET['color']; } /* start css */ $css = '<style type="text/css">' . "\n"; /* sidebar align */ if (is_single() || is_home()) { $contentalign = ot_get_option('ut_sidebar_align', 'right') == 'right' ? 'left' : 'right'; $css .= '#primary { float: ' . $contentalign . '}'; } /* themecolor / accentcolor elements */ $css .= '::-moz-selection { background: ' . $accentcolor . '; }' . "\n"; $css .= '::selection { background:' . $accentcolor . '; }' . "\n"; $css .= 'a, .ha-transparent #navigation ul li a:hover { color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-language-selector a:hover { color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-custom-icon-link:hover i { color: ' . $accentcolor . ' !important; }' . "\n"; $css .= '.ut-hide-member-details:hover, #ut-blog-navigation a:hover, .light .ut-hide-member-details, .ut-mm-button:hover:before, .ut-mm-trigger.active .ut-mm-button:before, .ut-mobile-menu a:after { color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-header-light .ut-mm-button:before { color: ' . $accentcolor . '; }'; $css .= '.lead span, .entry-title span, #cancel-comment-reply-link, .member-description-style-3 .ut-member-title, .ut-twitter-rotator h2 a, .themecolor { color: ' . $accentcolor . '; }' . "\n"; $css .= '.icons-ul i, .comments-title span, .member-social a:hover, .ut-parallax-quote-title span, .ut-member-style-2 .member-description .ut-member-title { color:' . $accentcolor . '; }' . "\n"; $css .= '.about-icon, .ut-skill-overlay, .ut-dropcap-one, .ut-dropcap-two, .ut-mobile-menu a:hover, .themecolor-bg, .ut-btn.ut-pt-btn:hover, .ut-btn.dark:hover { background:' . $accentcolor . '; }' . "\n"; $css .= 'blockquote, div.wpcf7-validation-errors, .ut-hero-style-5 .hero-description, #navigation ul.sub-menu, .ut-member-style-3 .member-social a:hover { border-color:' . $accentcolor . '; }' . "\n"; $css .= '.cta-section, .ut-btn.theme-btn, .ut-social-link:hover .ut-social-icon, .ut-member-style-2 .ut-so-link:hover { background:' . $accentcolor . ' !important; }' . "\n"; $css .= '.ut-social-title, .ut-service-column h3 span, .ut-rq-icon { color:' . $accentcolor . '; }' . "\n"; $css .= '.count, .ut-icon-list i { color:' . $accentcolor . '; }' . "\n"; $css .= '.client-section, .ut-portfolio-pagination.style_two a.selected:hover, .ut-portfolio-pagination.style_two a.selected, .ut-portfolio-pagination.style_two a:hover, .ut-pt-featured { background:' . $accentcolor . ' !important; }' . "\n"; $css .= 'ins, mark, .ut-alert.themecolor, .ut-portfolio-menu.style_two li a:hover, .ut-portfolio-menu.style_two li a.selected, .light .ut-portfolio-menu.style_two li a.selected:hover { background:' . $accentcolor . '; }' . "\n"; $css .= '.footer-content i { color:' . $accentcolor . '; }' . "\n"; $css .= '.copyright a:hover, .footer-content a:hover, .toTop:hover, .ut-footer-dark a.toTop:hover { color:' . $accentcolor . '; }' . "\n"; $css .= 'blockquote span { color:' . $accentcolor . '; }' . "\n"; $css .= '.entry-meta a:hover, #secondary a:hover, .page-template-templatestemplate-archive-php a:hover { color:' . $accentcolor . '; }' . "\n"; $css .= 'h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover, .ut-header-dark .site-logo .logo a:hover { color:' . $accentcolor . '; }' . "\n"; $css .= 'a.more-link:hover, .fa-ul li .fa { color:' . $accentcolor . '; }' . "\n"; $css .= '.ut-pt-featured-table .ut-pt-info .fa-li { color: ' . $accentcolor . ' !important; }' . "\n"; $css .= '.button, input[type="submit"], input[type="button"], .dark button, .dark input[type="submit"], .dark input[type="button"], .light .button, .light input[type="submit"], .light input[type="button"] { background:' . $accentcolor . '; }' . "\n"; $css .= '.img-hover { background:rgb(' . ut_hex_to_rgb($accentcolor) . '); background:rgba(' . ut_hex_to_rgb($accentcolor) . ', 0.85); }' . "\n"; $css .= '.portfolio-caption { background:rgb(' . ut_hex_to_rgb($accentcolor) . '); background:rgba(' . ut_hex_to_rgb($accentcolor) . ', 0.85); }' . "\n"; $css .= '.team-member-details { background:rgba(' . ut_hex_to_rgb($accentcolor) . ', 0.85 ); }' . "\n"; $css .= '.ut-avatar-overlay { background:rgb(' . ut_hex_to_rgb($accentcolor) . '); background:rgba(' . ut_hex_to_rgb($accentcolor) . ', 0.85 ); }' . "\n"; $css .= '.mejs-controls .mejs-time-rail .mejs-time-current, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current, .format-link .entry-header a { background:' . $accentcolor . ' !important; }' . "\n"; $css .= '.light .ut-portfolio-menu li a:hover, .light .ut-portfolio-pagination a:hover, .light .ut-nav-tabs li a:hover, .light .ut-accordion-heading a:hover { border-color:' . $accentcolor . ' !important; }' . "\n"; $css .= '.light .ut-portfolio-menu li a:hover, .light .ut-portfolio-pagination a:hover, .ut-portfolio-list li strong, .light .ut-nav-tabs li a:hover, .light .ut-accordion-heading a:hover, .ut-custom-icon a:hover i:first-child { color:' . $accentcolor . ' !important; }' . "\n"; $css .= '.ut-portfolio-gallery-slider .flex-direction-nav a, .ut-gallery-slider .flex-direction-nav a, .ut-rotate-quote-alt .flex-direction-nav a, .ut-rotate-quote .flex-direction-nav a { background:rgb(' . ut_hex_to_rgb($accentcolor) . '); background:rgba(' . ut_hex_to_rgb($accentcolor) . ', 0.85); }' . "\n"; $css .= '.light .ut-bs-wrap .entry-title a:hover, .light .ut-bs-wrap a:hover .entry-title { color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-rated i { color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-footer-area ul.sidebar a:hover { color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-footer-dark .ut-footer-area .widget_tag_cloud a:hover { color: ' . $accentcolor . '!important; }' . "\n"; $css .= '.ut-footer-dark .ut-footer-area .widget_tag_cloud a:hover { border-color: ' . $accentcolor . '; }' . "\n"; $css .= '.elastislide-wrapper nav span:hover { border-color: ' . $accentcolor . '; }' . "\n"; $css .= '.elastislide-wrapper nav span:hover { color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-footer-so li a:hover { border-color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-footer-so li a:hover i { color: ' . $accentcolor . '!important; }' . "\n"; $css .= '.ut-pt-wrap.ut-pt-wrap-style-2 .ut-pt-featured-table .ut-pt-header { background:' . $accentcolor . '; }' . "\n"; $css .= '.ut-pt-wrap-style-3 .ut-pt-info ul li, .ut-pt-wrap-style-3 .ut-pt-info ul, .ut-pt-wrap-style-3 .ut-pt-header, .ut-pt-wrap-style-3 .ut-btn.ut-pt-btn, .ut-pt-wrap-style-3 .ut-custom-row, .ut-pt-wrap-style-3 .ut-pt-featured-table .ut-btn { border-color:rgba(' . ut_hex_to_rgb($accentcolor) . ', 0.1); }' . "\n"; $css .= '.ut-pt-wrap-style-3 .ut-btn { color:' . $accentcolor . ' !important; }' . "\n"; $css .= '.ut-pt-wrap-style-3 .ut-btn { text-shadow: 0 0 40px ' . $accentcolor . ', 2px 2px 3px black; }' . "\n"; $css .= '.ut-pt-wrap-style-3 .ut-pt-featured-table .ut-btn { color:' . $accentcolor . ' !important; }' . "\n"; $css .= '.ut-pt-wrap-style-3 .ut-pt-featured-table .ut-btn { text-shadow: 0 0 40px ' . $accentcolor . ', 2px 2px 3px black; }' . "\n"; $css .= '.ut-pt-wrap-style-3 .ut-pt-featured-table .ut-pt-title { color:' . $accentcolor . ' !important; }' . "\n"; $css .= '.ut-pt-wrap-style-3 .ut-pt-featured-table .ut-pt-title { text-shadow: 0 0 40px ' . $accentcolor . ', 2px 2px 3px black; }' . "\n"; /* |-------------------------------------------------------------------------- | Glow Effect |-------------------------------------------------------------------------- */ $css .= '.ut-glow { color:' . $accentcolor . '; text-shadow:0 0 40px ' . $accentcolor . ', 2px 2px 3px black; }'; /* |-------------------------------------------------------------------------- | NEW Video Shortcode |-------------------------------------------------------------------------- */ $css .= '.light .ut-shortcode-video-wrap .ut-video-caption { border-color:rgba(' . ut_hex_to_rgb($accentcolor) . ', 1); }' . "\n"; $css .= '.light .ut-shortcode-video-wrap .ut-video-caption i { border-color:rgba(' . ut_hex_to_rgb($accentcolor) . ', 0.3); }' . "\n"; $css .= '.light .ut-shortcode-video-wrap .ut-video-caption i { color:rgba(' . ut_hex_to_rgb($accentcolor) . ', 0.3); }' . "\n"; $css .= '.light .ut-shortcode-video-wrap .ut-video-caption:hover i { border-color:rgba(' . ut_hex_to_rgb($accentcolor) . ', 1); }' . "\n"; $css .= '.light .ut-shortcode-video-wrap .ut-video-caption:hover i { color:' . $accentcolor . ' !important; }' . "\n"; $css .= '.light .ut-shortcode-video-wrap .ut-video-caption:hover i { text-shadow: 0 0 40px ' . $accentcolor . ', 2px 2px 3px black; }' . "\n"; $css .= '.light .ut-video-loading { color:' . $accentcolor . ' !important; }' . "\n"; $css .= '.light .ut-video-loading { text-shadow: 0 0 40px ' . $accentcolor . ', 2px 2px 3px black; }' . "\n"; $css .= '.light .ut-video-caption-text { border-color:rgba(' . ut_hex_to_rgb($accentcolor) . ', 1); }' . "\n"; /* |-------------------------------------------------------------------------- | Section animation |-------------------------------------------------------------------------- */ if (!$detect->isMobile() && ot_get_option('ut_animate_sections', 'on') == 'on') { $css .= ' .js #main-content section .section-content, .js #main-content section .section-header-holder { opacity:0; }'; } /* |-------------------------------------------------------------------------- | Main Navigation |-------------------------------------------------------------------------- */ $ut_navigation_padding_top = ot_get_option('ut_navigation_padding_top'); $ut_navigation_padding_bottom = ot_get_option('ut_navigation_padding_bottom'); /* header / navigation padding top */ if (!empty($ut_navigation_padding_top)) { $css .= '#header-section { padding-top: ' . $ut_navigation_padding_top . '; }'; } /* header / navigation padding bottom*/ if (!empty($ut_navigation_padding_bottom)) { $css .= '#header-section { padding-bottom: ' . $ut_navigation_padding_bottom . '; }'; } if (ot_get_option('ut_navigation_skin', 'ut-header-light') == 'ut-header-light') { $ut_navigation_skin_light_bgcolor = ot_get_option('ut_navigation_skin_light_bgcolor'); if (!empty($ut_navigation_skin_light_bgcolor)) { /* add to CSS */ $css .= ' #header-section.ut-header-light, .ha-header.ha-transparent:hover, .ha-header.ha-transparent:hover #navigation ul.sub-menu li > a, #header-section.ut-header-light #navigation ul.sub-menu li > a { background: rgba(' . ut_hex_to_rgb($ut_navigation_skin_light_bgcolor) . ' , 0.95 ) ; }'; } } else { $ut_navigation_skin_dark_bgcolor = ot_get_option('ut_navigation_skin_dark_bgcolor'); if (!empty($ut_navigation_skin_dark_bgcolor)) { /* add to CSS */ $css .= ' #header-section.ut-header-dark, .ha-header.ha-transparent:hover, .ha-header.ha-transparent:hover #navigation ul.sub-menu li > a, #header-section.ut-header-dark #navigation ul.sub-menu li > a { background: rgba(' . ut_hex_to_rgb($ut_navigation_skin_dark_bgcolor) . ' , 0.95 ) ; }'; } } if (ot_get_option('ut_navigation_font_weight', 'normal') == 'bold') { $css .= '#navigation { font-family: "ralewaysemibold", Helvetica, Arial, sans-serif !important; }'; } /* custom colors for first level color */ if (ot_get_option('ut_navigation_level_one_color')) { if (ot_get_option('ut_navigation_skin', 'ut-header-light') == 'ut-header-light') { $css .= '#navigation ul li a { color: ' . ot_get_option('ut_navigation_level_one_color') . ' }'; } else { $css .= '.ut-header-dark #navigation ul li a { color: ' . ot_get_option('ut_navigation_level_one_color') . ' }'; } } /* custom colors for first level dot color */ if (ot_get_option('ut_navigation_level_one_icon_color')) { if (ot_get_option('ut_navigation_skin', 'ut-header-light') == 'ut-header-light') { $css .= '#navigation ul li a:after { color: ' . ot_get_option('ut_navigation_level_one_icon_color') . ' }'; } else { $css .= '.ut-header-dark #navigation ul li a:after { color: ' . ot_get_option('ut_navigation_level_one_icon_color') . ' }'; } } /* main navigation light */ $css .= '#navigation li a:hover { color:' . $accentcolor . '; }' . "\n"; /* main navigation parents and ancestor */ $css .= '#navigation .selected, #navigation ul li.current_page_parent a.active, #navigation ul li.current-menu-ancestor a.active { color: ' . $accentcolor . '; }' . "\n"; $css .= '#navigation ul li a:hover, #navigation ul.sub-menu li a:hover { color: ' . $accentcolor . '; }' . "\n"; /* main navigation current page */ $css .= '#navigation ul.sub-menu li > a { color: #999999; }'; $css .= '#navigation ul li.current-menu-item:not(.current_page_parent) a, #navigation ul li.current_page_item:not(.current_page_parent) a { color: ' . $accentcolor . '; }'; $css .= '#navigation ul li.current-menu-item:not(.current_page_parent) .sub-menu li a { color: #999999; }'; /* main navigation dark */ $css .= '.ut-header-dark #navigation li a:hover { color:' . $accentcolor . '; }' . "\n"; /* main navigation parents and ancestor */ $css .= '.ut-header-dark #navigation .selected, .ut-header-dark #navigation ul li.current_page_parent a.active, .ut-header-dark #navigation ul li.current-menu-ancestor a.active { color: ' . $accentcolor . '; }' . "\n"; $css .= '.ut-header-dark #navigation ul li a:hover, .ut-header-dark #navigation ul.sub-menu li a:hover { color: ' . $accentcolor . '; }' . "\n"; /* main navigation current page */ $css .= '.ut-header-dark #navigation ul.sub-menu li > a { color: #999999; }'; $css .= '.ut-header-dark #navigation ul li.current-menu-item:not(.current_page_parent) a, .ut-header-dark #navigation ul li.current_page_item:not(.current_page_parent) a { color: ' . $accentcolor . '; }'; $css .= '.ut-header-dark #navigation ul li.current-menu-item:not(.current_page_parent) .sub-menu li a { color: #999999; }'; /* preloader */ if (ot_get_option('ut_use_image_loader') == 'on') { $css .= '.ut-loader-overlay { background: ' . ot_get_option('ut_image_loader_background', '#FFF') . '}' . "\n"; } /* |-------------------------------------------------------------------------- | Hero Settings |-------------------------------------------------------------------------- */ /* hero global settings */ $ut_hero_type = ut_return_hero_config('ut_hero_type'); $ut_hero_style = ut_return_hero_config('ut_hero_style', 'ut-hero-style-1'); /* hero color settings */ $css .= '.hero-title span:not(.ut-word-rotator) { color:' . $accentcolor . ' !important; }' . "\n"; $css .= '.hero-title.ut-glow span { text-shadow: 0 0 40px ' . $accentcolor . ', 2px 2px 3px black; }' . "\n"; $ut_company_slogan_color = ut_return_hero_config('ut_company_slogan_color'); if (!empty($ut_company_slogan_color)) { $css .= '.hero-title.ut-glow { color: ' . $ut_company_slogan_color . '; text-shadow: 0 0 40px ' . $ut_company_slogan_color . ', 2px 2px 3px black; }' . "\n"; } /* hero font size */ $ut_hero_font_size = ut_return_hero_config('ut_hero_font_size'); /* add to CSS */ if (!empty($ut_hero_font_size) && $ut_hero_style != 'ut-hero-style-11') { $css .= '@media screen and (min-width: 1025px) { .hero-title { font-size: ' . $ut_hero_font_size . '; } }'; } /* hero primary button style for all pages */ if (ut_return_hero_config('ut_main_hero_button_style', 'default') == 'custom') { $button_settings = ut_return_hero_config('ut_main_hero_button_settings'); /* add to CSS */ $css .= ut_create_button_style('.hero-btn', $button_settings); } /* hero second button style for all pages */ if (ut_return_hero_config('ut_second_hero_button_style', 'default') == 'custom') { $button_settings = ut_return_hero_config('ut_second_hero_button_settings'); /* add to CSS */ $css .= ut_create_button_style('.hero-second-btn', $button_settings); } /* hero border bottom */ if (ut_return_hero_config('ut_hero_border_bottom', 'off') == 'on') { /* add to CSS */ $css .= '#ut-hero { border-bottom: ' . ut_return_hero_config('ut_hero_border_bottom_width', 1) . 'px ' . ut_return_hero_config('ut_hero_border_bottom_style', 'solid') . ' ' . ut_return_hero_config('ut_hero_border_bottom_color', $accentcolor) . '; }'; } /* body font style */ if (ot_get_option('ut_body_font_type', 'ut-font') == 'ut-google') { $ut_google_body_font_style = ot_get_option('ut_google_body_font_style'); if (!empty($google_fonts[$ut_google_body_font_style['font-id']]['family'])) { $css .= 'body {'; /* familiy */ $css .= 'font-family:"' . $google_fonts[$ut_google_body_font_style['font-id']]['family'] . '", "Helvetica Neue", Helvetica, Arial, sans-serif !important;'; if (!empty($ut_google_body_font_style['font-weight'])) { $css .= ' font-weight: ' . $ut_google_body_font_style['font-weight'] . ';'; } if (!empty($ut_google_body_font_style['font-size'])) { $css .= ' font-size: ' . $ut_google_body_font_style['font-size'] . ';'; } if (!empty($ut_google_body_font_style['font-style']) && isset($font_styles[$ut_google_body_font_style['font-style']])) { $css .= ' font-style: ' . $font_styles[$ut_google_body_font_style['font-style']] . ';'; } if (!empty($ut_google_body_font_style['line-height'])) { $css .= ' line-height: ' . $ut_google_body_font_style['line-height'] . ';'; } if (!empty($ut_google_body_font_style['text-transform'])) { $css .= ' text-transform: ' . $ut_google_body_font_style['text-transform'] . ';'; } $css .= '}'; } else { /* fallback if user has not chosen a google font yet */ $ut_body_font_style = ot_get_option('ut_body_font_style', 'regular'); $css .= 'body { font-family: ' . $ut_recognized_font_styles[$ut_body_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } else { /* out for theme font */ $ut_body_font_style = ot_get_option('ut_body_font_style', 'regular'); $css .= 'body { font-family: ' . $ut_recognized_font_styles[$ut_body_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } /* global headline font style */ $headlines = array("h1", "h2", "h3", "h4", "h5", "h6"); foreach ($headlines as $headline) { if (ot_get_option('ut_global_' . $headline . '_font_type', 'ut-font') == 'ut-google') { $headline_style = ot_get_option('ut_' . $headline . '_google_font_style'); if (!empty($google_fonts[$headline_style['font-id']]['family'])) { $css .= $headline . ' {'; /* familiy */ $css .= 'font-family:"' . $google_fonts[$headline_style['font-id']]['family'] . '", "Helvetica Neue", Helvetica, Arial, sans-serif;'; if (!empty(${$headline_style}['font-weight'])) { $css .= ' font-weight: ' . $headline_style['font-weight'] . ';'; } if (!empty($headline_style['font-size'])) { $css .= ' font-size: ' . $headline_style['font-size'] . ';'; } if (!empty($headline_style['font-style'])) { $css .= ' font-style: ' . $font_styles[$headline_style['font-style']] . ';'; } if (!empty($headline_style['line-height'])) { $css .= ' line-height: ' . $headline_style['line-height'] . ';'; } if (!empty($headline_style['text-transform'])) { $css .= ' text-transform: ' . $headline_style['text-transform'] . ';'; } $css .= '}'; } else { /* fallback if user has not chosen a google font yet */ $headline_style = ot_get_option('ut_' . $headline . '_font_style', 'semibold'); $css .= $headline . ' { font-family: ' . $ut_recognized_font_styles[$headline_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } else { /* output for theme font */ $headline_style = ot_get_option('ut_' . $headline . '_font_style', 'semibold'); $css .= $headline . ' { font-family: ' . $ut_recognized_font_styles[$headline_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } /* |-------------------------------------------------------------------------- | Single Page and Portfolio Styling |-------------------------------------------------------------------------- */ if (!is_front_page() && (is_page() || is_singular('portfolio'))) { /* hero active or not */ if (is_page() && get_post_meta($post->ID, 'ut_activate_page_hero', true) == 'on' || is_singular('portfolio') && get_post_meta($post->ID, 'ut_activate_page_hero', true) != 'off') { $css .= '#primary { padding-top:80px; }'; } /* hero color styling */ $ut_hero_caption_description_color = get_post_meta($post->ID, 'ut_page_caption_description_color', true); $ut_hero_caption_slogan_color = get_post_meta($post->ID, 'ut_page_caption_slogan_color', true); /* add to CSS */ if (!empty($ut_hero_caption_description_color)) { $css .= '.hero-description-bottom { color: ' . $ut_hero_caption_description_color . '}' . "\n"; } /* add to CSS */ if (!empty($ut_hero_caption_slogan_color)) { $css .= '.hero-title { color: ' . $ut_hero_caption_slogan_color . ' }' . "\n"; } /* headlines */ $ut_h1_font_style = get_post_meta($post->ID, 'ut_section_header_font_style', true); $css .= ut_create_global_headline_font_style('.page-title', $ut_h1_font_style); $ut_page_header_style = get_post_meta($post->ID, 'ut_section_header_style', true); $ut_page_header_style = !empty($ut_page_header_style) && $ut_page_header_style != 'global' ? $ut_page_header_style : ot_get_option('ut_global_headline_style'); $ut_page_title_color = get_post_meta($post->ID, 'ut_section_title_color', true); $ut_section_title_shadow_color = get_post_meta($post->ID, 'ut_section_shadow_color', true); /* pt style 3 needs a fallback */ if (empty($ut_page_title_color) && $ut_page_header_style == 'pt-style-3') { $ut_page_title_color = $accentcolor; } /* add to CSS */ if (!empty($ut_page_title_color)) { $css .= (is_page() ? '.page-id-' : '.postid-') . $post->ID . ' #primary .page-title { color: ' . $ut_page_title_color . '; }' . "\n"; $css .= create_section_headline_style((is_page() ? '.page-id-' : '.postid-') . $post->ID . ' #primary', $ut_page_header_style, $ut_page_title_color, $ut_section_title_shadow_color); } /* content background */ $ut_page_background_color = get_post_meta($post->ID, 'ut_section_background_color', true); /* add to CSS */ if (!empty($ut_page_background_color)) { $css .= '.main-content-background { background-color: ' . $ut_page_background_color . '; }' . "\n"; $css .= '.main-content-background .page-header.pt-style-1 .page-title span { background-color: ' . $ut_page_background_color . '; }' . "\n"; } /* header glow */ if (get_post_meta($post->ID, 'ut_section_title_glow', true) == 'on') { $ut_page_title_color = get_post_meta($post->ID, 'ut_section_title_color', true); $ut_page_title_glow_color = get_post_meta($post->ID, 'ut_section_title_glow_color', true); if (!empty($ut_page_title_color)) { $css .= (is_page() ? '.page-id-' : '.postid-') . $post->ID . ' #primary .page-title.ut-glow { text-shadow: 0 0 40px ' . $ut_page_title_color . ', 2px 2px 3px black ; }' . "\n"; } if (!empty($ut_page_title_glow_color)) { $css .= (is_page() ? '.page-id-' : '.postid-') . $post->ID . ' #primary .page-title.ut-glow { text-shadow: 0 0 40px ' . $ut_page_title_glow_color . ', 2px 2px 3px black ; }' . "\n"; } } /* header margin */ $ut_page_header_margin_left = get_post_meta($post->ID, 'ut_section_header_margin_left', true); $ut_page_header_margin_right = get_post_meta($post->ID, 'ut_section_header_margin_right', true); /* add to CSS */ if (!empty($ut_page_header_margin_left)) { $css .= '#primary header.page-header { margin-left:' . $ut_page_header_margin_left . '; }' . "\n"; } /* add to CSS */ if (!empty($ut_page_header_margin_right)) { $css .= '#primary header.page-header { margin-right:' . $ut_page_header_margin_right . '; }' . "\n"; } /* page slogan upperase */ $ut_page_caption_slogan_uppercase = get_post_meta($post->ID, 'ut_page_caption_slogan_uppercase', true); /* add to CSS */ if ($ut_page_caption_slogan_uppercase == 'on') { $css .= '.hero-title { text-transform: uppercase; }'; } /* page slogan color */ $ut_page_slogan_color = get_post_meta($post->ID, 'ut_section_slogan_color', true); /* add to CSS */ if (!empty($ut_page_slogan_color)) { $css .= '#primary .lead { color: ' . $ut_page_slogan_color . '; }' . "\n"; } /* page slogan padding bottom */ $ut_page_slogan_padding = get_post_meta($post->ID, 'ut_section_slogan_padding', true); $ut_page_slogan_padding = !empty($ut_page_slogan_padding) ? $ut_page_slogan_padding : ''; /* add to CSS */ if (!empty($ut_page_slogan_padding)) { $css .= '#primary .page-header { padding-bottom:' . $ut_page_slogan_padding . '; }' . "\n"; } /* page slogan padding left and right */ $ut_section_slogan_padding_left = get_post_meta($post->ID, 'ut_section_slogan_padding_left', true); $ut_section_slogan_padding_right = get_post_meta($post->ID, 'ut_section_slogan_padding_right', true); /* add to CSS */ if (!empty($ut_section_slogan_padding_left)) { $css .= '#primary .lead { padding-left: ' . $ut_section_slogan_padding_left . '; }' . "\n"; } /* add to CSS */ if (!empty($ut_section_slogan_padding_right)) { $css .= '#primary .lead { padding-right: ' . $ut_section_slogan_padding_right . '; }' . "\n"; } /* page text color */ $ut_page_text_color = get_post_meta($post->ID, 'ut_section_text_color', true); /* add to CSS */ if (!empty($ut_page_text_color)) { $css .= '#primary .entry-content { color: ' . $ut_page_text_color . '; }' . "\n"; } /* page headlines text color */ $ut_page_heading_color = get_post_meta($post->ID, 'ut_section_heading_color', true); /* add to CSS */ if (!empty($ut_page_heading_color)) { /* add to CSS */ $css .= '#primary .entry-content h1 { color: ' . $ut_page_heading_color . ' !important; }' . "\n"; $css .= '#primary .entry-content h2 { color: ' . $ut_page_heading_color . ' !important; }' . "\n"; $css .= '#primary .entry-content h3 { color: ' . $ut_page_heading_color . ' !important; }' . "\n"; $css .= '#primary .entry-content h4 { color: ' . $ut_page_heading_color . ' !important; }' . "\n"; $css .= '#primary .entry-content h5 { color: ' . $ut_page_heading_color . ' !important; }' . "\n"; $css .= '#primary .entry-content h6 { color: ' . $ut_page_heading_color . ' !important; }' . "\n"; } } /* |-------------------------------------------------------------------------- | Front Page |-------------------------------------------------------------------------- */ if (is_front_page()) { /* front page hero header styling */ $ut_front_expertise_slogan_color = ot_get_option('ut_front_expertise_slogan_color'); $ut_front_company_slogan_color = ot_get_option('ut_front_company_slogan_color'); /* add to CSS */ if (!empty($ut_front_expertise_slogan_color)) { $css .= '.hero-description-bottom { color: ' . $ut_front_expertise_slogan_color . '}' . "\n"; } /* add to CSS */ if (!empty($ut_front_company_slogan_color)) { $css .= '.hero-title { color: ' . $ut_front_company_slogan_color . ' }' . "\n"; } $ut_front_company_slogan_uppercase = ot_get_option('ut_front_company_slogan_uppercase', 'on'); /* add to CSS */ if (!empty($ut_front_company_slogan_uppercase) && $ut_front_company_slogan_uppercase == 'on') { $css .= '.hero-title { text-transform: uppercase; }'; } } /* hero holder adjustment when navigation is visible */ if ((ot_get_option('ut_navigation_state') == 'on_transparent' || ot_get_option('ut_navigation_state') == 'on') && ($ut_hero_type == 'splithero' && ut_return_hero_config('ut_hero_split_content_type', 'image') == 'image')) { $css .= '#ut-hero .hero-holder { margin-top:80px; }'; } /* header hero font style for front and blog */ if (is_front_page() || is_singular('portfolio') || is_page()) { if (ot_get_option('ut_front_hero_font_type', 'ut-font') == 'ut-google') { $ut_google_front_page_hero_font_style = ot_get_option('ut_google_front_page_hero_font_style'); if (!empty($google_fonts[$ut_google_front_page_hero_font_style['font-id']]['family'])) { if ($ut_hero_style == 'ut-hero-style-11') { $css .= '#ut-hero .hdh .hero-description,'; } $css .= '.hero-title {'; /* familiy */ $css .= 'font-family:"' . $google_fonts[$ut_google_front_page_hero_font_style['font-id']]['family'] . '", "Helvetica Neue", Helvetica, Arial, sans-serif;'; if (!empty($ut_google_front_page_hero_font_style['font-weight'])) { $css .= ' font-weight: ' . $ut_google_front_page_hero_font_style['font-weight'] . ';'; } if (!empty($ut_google_front_page_hero_font_style['font-size'])) { $css .= ' font-size: ' . $ut_google_front_page_hero_font_style['font-size'] . ';'; } if (!empty($ut_google_front_page_hero_font_style['font-style'])) { $css .= ' font-style: ' . $font_styles[$ut_google_front_page_hero_font_style['font-style']] . ';'; } if (!empty($ut_google_front_page_hero_font_style['line-height'])) { $css .= ' line-height: ' . $ut_google_front_page_hero_font_style['line-height'] . ';'; } if (!empty($ut_google_front_page_hero_font_style['text-transform'])) { $css .= ' text-transform: ' . $ut_google_front_page_hero_font_style['text-transform'] . ';'; } $css .= '}'; } else { /* fallback if user has not chosen a google font yet */ $ut_header_hero_font_style = ot_get_option('ut_front_page_hero_font_style', 'semibold'); if ($ut_hero_style == 'ut-hero-style-11') { $css .= '#ut-hero .hdh .hero-description,'; } $css .= '.hero-title { font-family: ' . $ut_recognized_font_styles[$ut_header_hero_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } else { /* out for theme font */ $ut_hero_font_style = ut_return_hero_config('ut_hero_font_style', 'semibold'); /* design exception for hero */ if ($ut_hero_style == 'ut-hero-style-11') { $css .= '#ut-hero .hdh .hero-description,'; } $css .= '.hero-title { font-family: ' . $ut_recognized_font_styles[$ut_hero_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } if (is_home()) { if (ot_get_option('ut_blog_hero_font_type', 'ut-font') == 'ut-google') { $ut_google_blog_hero_font_style = ot_get_option('ut_google_blog_hero_font_style'); if (!empty($google_fonts[$ut_google_blog_hero_font_style['font-id']]['family'])) { /* design exception for hero */ if ($ut_hero_style == 'ut-hero-style-11') { $css .= '#ut-hero .hdh .hero-description,'; } $css .= '.hero-title {'; /* familiy */ $css .= 'font-family:"' . $google_fonts[$ut_google_blog_hero_font_style['font-id']]['family'] . '", "Helvetica Neue", Helvetica, Arial, sans-serif;'; if (!empty($ut_google_blog_hero_font_style['font-weight'])) { $css .= ' font-weight: ' . $ut_google_blog_hero_font_style['font-weight'] . ';'; } if (!empty($ut_google_blog_hero_font_style['font-size'])) { $css .= ' font-size: ' . $ut_google_blog_hero_font_style['font-size'] . ';'; } if (!empty($ut_google_blog_hero_font_style['font-style'])) { $css .= ' font-style: ' . $font_styles[$ut_google_blog_hero_font_style['font-style']] . ';'; } if (!empty($ut_google_blog_hero_font_style['line-height'])) { $css .= ' font-style: ' . $ut_google_blog_hero_font_style['line-height'] . ';'; } if (!empty($ut_google_blog_hero_font_style['text-transform'])) { $css .= ' text-transform: ' . $ut_google_blog_hero_font_style['text-transform'] . ';'; } $css .= '}'; } else { /* fallback if user has not chosen a google font yet */ $ut_header_hero_font_style = ot_get_option('ut_blog_hero_font_style', 'semibold'); $css .= '.hero-title { font-family: ' . $ut_recognized_font_styles[$ut_header_hero_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } else { /* out for theme font */ $ut_header_hero_font_style = ot_get_option('ut_blog_hero_font_style', 'semibold'); $css .= '.hero-title { font-family: ' . $ut_recognized_font_styles[$ut_header_hero_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } /* hero header background image for tablet slider */ if ($ut_hero_type == 'tabs') { $ut_tabs_headline_style = ut_return_hero_config('ut_tabs_headline_style', 'semibold'); $css .= ut_create_global_headline_font_style('.ut-tablets-title', $ut_tabs_headline_style); /* hero type tabs uses a different header image */ $css .= ut_create_css_background('.hero', ut_return_hero_config('ut_hero_image', '', true)); } /* hero header background image for image hero */ if ($ut_hero_type == 'image' || $ut_hero_type == 'splithero') { $ut_hero_image = ut_return_hero_config('ut_hero_image'); if (is_array($ut_hero_image) && !empty($ut_hero_image['background-image'])) { /*no background if rain effect is active */ $css .= ut_create_css_background('.hero', $ut_hero_image); } elseif (!empty($ut_hero_image) && !is_array($ut_hero_image)) { /* fallback to version 1.0 */ $css .= '.hero { background-image: url(' . esc_url($ut_hero_image) . '); }' . "\n"; } } /* video poster */ if ($detect->isMobile() && $ut_hero_type == 'video') { /* video poster image for mobile devices */ $ut_video_poster = ut_return_hero_config('ut_video_poster'); /* hero can be an image , so we need to check the hero type */ if (!empty($ut_video_poster)) { $css .= '.hero { background-image: url(' . esc_url($ut_video_poster) . '); background-size: cover !important; background-attachment: scroll !important; }' . "\n"; } $css .= '.ut-video-control { display:none !important; }'; } /* video position for selfhosted video */ if (ut_return_hero_config('ut_video_source', 'youtube') == 'selfhosted' && !$detect->isMobile() && ut_return_hero_config('ut_video_containment', 'hero') == 'body' && is_front_page()) { $css .= '.ut-video-container { position:fixed; }'; } /* split hero */ if ($ut_hero_type == 'splithero') { $split_image_max_width = ut_return_hero_config('ut_hero_split_image_width'); /* check if value is available */ $split_image_max_width = empty($split_image_max_width) ? '60' : $split_image_max_width; $css .= '#ut-hero .ut-split-image { max-width: ' . $split_image_max_width . '% !important; }'; } /* hero header background image for animated image hero */ if ($ut_hero_type == 'animatedimage') { $header_image = ut_return_hero_config('ut_hero_animated_image'); if (!empty($header_image)) { /* get image ID by url*/ $imageID = ut_get_image_id($header_image); /* grab image imnformation */ $imageinfo = wp_get_attachment_image_src($imageID, 'full'); /* background */ $css .= '.hero { background-position: 0px 0px; background-repeat: repeat-x; background-image: url(' . esc_url($header_image) . '); -webkit-animation: animatedBackground 60s linear infinite; -moz-animation: animatedBackground 60s linear infinite; animation: animatedBackground 60s linear infinite; }' . "\n"; $css .= '@media screen and (max-width: 1024px) { .hero { -webkit-animation: none !important; -moz-animation: none !important; animation: none !important; } }'; $css .= '@keyframes animatedBackground { from { background-position: 0 0; } to { background-position: ' . $imageinfo[1] . 'px 0; } } @-webkit-keyframes animatedBackground { from { background-position: 0 0; } to { background-position: ' . $imageinfo[1] . 'px 0; } } @-moz-keyframe animatedBackground { from { background-position: 0 0; } to { background-position: ' . $imageinfo[1] . 'px 0; } }'; } } /* fancy slider */ $fancy_slider_height = $ut_hero_type == 'transition' ? ut_return_hero_config('ut_fancy_slider_height', '600px') : ''; if (!empty($fancy_slider_height)) { $css .= '.ut-fancy-slider-fullwidth { height: ' . $fancy_slider_height . '; }'; $css .= '.ut-fancy-slider-fullwidth .hero-inner { height: ' . $fancy_slider_height . '; }'; } /* header overlay styling */ $ut_hero_overlay_color = ut_return_hero_config('ut_hero_overlay_color'); $ut_hero_overlay_color_opacity = ut_return_hero_config('ut_hero_overlay_color_opacity', '0.8'); if (!empty($ut_hero_overlay_color)) { $css .= '.hero .parallax-overlay { background-color: rgba(' . ut_hex_to_rgb($ut_hero_overlay_color) . ' , ' . $ut_hero_overlay_color_opacity . ' ); }' . "\n"; } /* blog hero header styling */ $ut_blog_expertise_slogan_color = ot_get_option('ut_blog_expertise_slogan_color'); $ut_blog_company_slogan_color = ot_get_option('ut_blog_company_slogan_color'); if (!empty($ut_blog_expertise_slogan_color) && is_home()) { $css .= '.hero-description-bottom { color: ' . $ut_blog_expertise_slogan_color . '}' . "\n"; } if (!empty($ut_blog_company_slogan_color) && is_home()) { $css .= '.hero-title { color: ' . $ut_blog_company_slogan_color . ' }' . "\n"; } $ut_blog_company_slogan_uppercase = ot_get_option('ut_blog_company_slogan_uppercase', 'on'); if (!empty($ut_blog_company_slogan_uppercase) && is_home() && $ut_blog_company_slogan_uppercase == 'on') { $css .= '.hero-title { text-transform: uppercase; }'; } /* check if contact section is active*/ $ut_activate_csection = ut_return_csection_config('ut_activate_csection'); /* only get contact section styles if footer is active */ if ($ut_activate_csection == 'on') { /* contact section header styling */ $ut_csection_header_slogan_color = ot_get_option('ut_csection_header_slogan_color'); $ut_csection_header_expertise_slogan_color = ot_get_option('ut_csection_header_expertise_slogan_color'); $ut_csection_header_style = ot_get_option('ut_csection_header_style', 'pt-style-1'); $ut_csection_header_style = $ut_csection_header_style == 'global' ? ot_get_option('ut_global_headline_style') : $ut_csection_header_style; /* pt style 3 needs a fallback */ if (empty($ut_csection_header_slogan_color) && $ut_csection_header_style == 'pt-style-3') { $ut_csection_header_slogan_color = $accentcolor; } if (!empty($ut_csection_header_slogan_color)) { $css .= '#contact-section .parallax-title { color: ' . $ut_csection_header_slogan_color . '}' . "\n"; $css .= create_section_headline_style('#contact-section', $ut_csection_header_style, $ut_csection_header_slogan_color); } if (!empty($ut_csection_header_expertise_slogan_color)) { $css .= '#contact-section .lead { color: ' . $ut_csection_header_expertise_slogan_color . ' }' . "\n"; } if (ot_get_option('ut_csection_title_uppercase', 'off') == 'on') { $css .= '#contact-section .parallax-title { text-transform: uppercase; }'; } $css .= '#contact-section .parallax-title span span { color:' . $accentcolor . '; }' . "\n"; /* contact section section styles */ $csection_background = null; $csection_background_type = ot_get_option('ut_csection_background_type', 'image'); /* contact section styling */ if ($csection_background_type == 'image') { $ut_csection_background_image = ut_return_csection_config('ut_csection_background_image'); if (is_array($ut_csection_background_image) && !empty($ut_csection_background_image['background-image'])) { $csection_background .= ut_create_css_background('#contact-section', $ut_csection_background_image); $ut_csection_background_image = $ut_csection_background_image['background-image']; } elseif (!is_array($ut_csection_background_image)) { $csection_background .= !empty($ut_csection_background_image) ? '#contact-section { background-image: url(' . esc_url($ut_csection_background_image) . '); }' . "\n" : ''; } } /* video poster image */ if ($csection_background_type == 'video' && $detect->isMobile() || $detect->isMobile() && ot_get_option('ut_front_video_containment', 'hero') == 'body') { $ut_csection_video_poster = ot_get_option('ut_csection_video_poster'); /* video poster image for mobile devices */ $css .= '#contact-section { background-image: url(' . esc_url($ut_csection_video_poster) . '); background-size: cover !important; background-attachment: scroll !important; }' . "\n"; } /* there is no image, so we check if a background color has been set */ $ut_csection_background_color = ot_get_option('ut_csection_background_color'); if (empty($ut_csection_background_image)) { $csection_background .= !empty($ut_csection_background_color) ? '#contact-section { background: ' . $ut_csection_background_color . '; }' . "\n" : ''; } /* add to CSS */ $css .= $csection_background; /* contact section header font style */ if (ot_get_option('ut_csection_header_font_type', 'ut-font') == 'ut-google') { $ut_csection_header_google_font_style = ot_get_option('ut_csection_header_google_font_style'); if (!empty($google_fonts[$ut_csection_header_google_font_style['font-id']]['family'])) { $font = '#contact-section .parallax-title {'; $font .= 'font-family:"' . $google_fonts[$ut_csection_header_google_font_style['font-id']]['family'] . '", "Helvetica Neue", Helvetica, Arial, sans-serif;'; if (!empty($ut_csection_header_google_font_style['font-weight'])) { $font .= ' font-weight: ' . $ut_csection_header_google_font_style['font-weight'] . ';'; } if (!empty($ut_csection_header_google_font_style['font-size'])) { $font .= ' font-size: ' . $ut_csection_header_google_font_style['font-size'] . ';'; } if (!empty($ut_csection_header_google_font_style['font-style']) && isset($font_styles[$ut_csection_header_google_font_style['font-style']])) { $font .= ' font-style: ' . $font_styles[$ut_csection_header_google_font_style['font-style']] . ';'; } if (!empty($ut_csection_header_google_font_style['line-height'])) { $font .= ' line-height: ' . $ut_csection_header_google_font_style['line-height'] . ';'; } if (!empty($ut_csection_header_google_font_style['text-transform'])) { $font .= ' text-transform: ' . $ut_csection_header_google_font_style['text-transform'] . ';'; } $font .= '}'; $css .= $font; } else { /* fallback if user has not chosen a google font yet */ $font_style = ot_get_option('ut_csection_header_font_style', 'semibold'); if (isset($ut_recognized_font_styles[$font_style])) { $css .= '#contact-section .parallax-title { font-family: ' . $ut_recognized_font_styles[$font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif;}' . "\n"; } } } else { $font_style = ot_get_option('ut_csection_header_font_style', 'semibold'); if (isset($ut_recognized_font_styles[$font_style])) { $css .= '#contact-section .parallax-title { font-family: ' . $ut_recognized_font_styles[$font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif;}' . "\n"; } } /* contact section border styling */ if (ot_get_option('ut_activate_csection_border', 'off') == 'on') { /* border settings */ $ut_csection_border_color = ot_get_option('ut_csection_border_color'); $ut_csection_border_color = !empty($ut_csection_border_color) ? $ut_csection_border_color : $accentcolor; $ut_csection_border_width = ot_get_option('ut_csection_border_width'); $ut_csection_border_width = !empty($ut_csection_border_width) ? $ut_csection_border_width : '1'; $ut_csection_border_style = ot_get_option('ut_csection_border_style'); $ut_csection_border_style = !empty($ut_csection_border_style) ? $ut_csection_border_style : 'solid'; /* add to CSS */ $css .= '#contact-section { border-top: ' . $ut_csection_border_width . 'px ' . $ut_csection_border_style . ' ' . $ut_csection_border_color . '; }'; } /* contact section box styling */ $ut_left_csection_content_area_color = ot_get_option('ut_left_csection_content_area_color'); $ut_right_csection_content_area_color = ot_get_option('ut_right_csection_content_area_color'); $ut_left_csection_content_area_opacity = ot_get_option('ut_left_csection_content_area_opacity', '0.8'); $ut_right_csection_content_area_opacity = ot_get_option('ut_right_csection_content_area_opacity', '0.8'); $css .= !empty($ut_left_csection_content_area_color) ? '#contact-section .ut-left-footer-area { background: rgb(' . ut_hex_to_rgb($ut_left_csection_content_area_color) . ',' . $ut_left_csection_content_area_opacity . '); }' . "\n" : ''; $css .= !empty($ut_left_csection_content_area_color) ? '#contact-section .ut-left-footer-area { background: rgba(' . ut_hex_to_rgb($ut_left_csection_content_area_color) . ',' . $ut_left_csection_content_area_opacity . '); }' . "\n" : ''; $css .= !empty($ut_right_csection_content_area_color) ? '#contact-section .ut-right-footer-area { background: rgb(' . ut_hex_to_rgb($ut_right_csection_content_area_color) . ',' . $ut_right_csection_content_area_opacity . '); }' . "\n" : ''; $css .= !empty($ut_right_csection_content_area_color) ? '#contact-section .ut-right-footer-area { background: rgba(' . ut_hex_to_rgb($ut_right_csection_content_area_color) . ',' . $ut_right_csection_content_area_opacity . '); }' . "\n" : ''; /* contact section overlay color */ $ut_csection_overlay = ut_return_csection_config('ut_csection_overlay', 'on'); $ut_csection_overlay_color = ut_return_csection_config('ut_csection_overlay_color'); $ut_csection_overlay_opacity = ut_return_csection_config('ut_csection_overlay_opacity', '0.8'); $css .= !empty($ut_csection_overlay_color) ? '#contact-section .parallax-overlay { background: rgb(' . ut_hex_to_rgb($ut_csection_overlay_color) . ',' . $ut_csection_overlay_opacity . '); }' . "\n" : ''; $css .= !empty($ut_csection_overlay_color) ? '#contact-section .parallax-overlay { background: rgba(' . ut_hex_to_rgb($ut_csection_overlay_color) . ',' . $ut_csection_overlay_opacity . '); }' . "\n" : ''; /* contact section section padding */ $ut_csection_padding_top = ot_get_option('ut_csection_padding_top'); $ut_csection_padding_bottom = ot_get_option('ut_csection_padding_bottom'); /* fallback if there is no entry */ $ut_csection_padding_top = empty($ut_csection_padding_top) ? '80px' : $ut_csection_padding_top; $ut_csection_padding_bottom = empty($ut_csection_padding_bottom) ? '60px' : $ut_csection_padding_bottom; if ($ut_csection_overlay == 'on') { $css .= '#contact-section .parallax-overlay { padding-top:' . $ut_csection_padding_top . '; padding-bottom:' . $ut_csection_padding_bottom . '; }' . "\n"; $css .= '#contact-section .ut-offset-anchor { top:-' . (79 + str_replace("px", "", $ut_navigation_padding_top) + str_replace("px", "", $ut_navigation_padding_bottom)) . 'px; }' . "\n"; } else { $css .= '#contact-section { padding-top:' . $ut_csection_padding_top . '; padding-bottom:' . $ut_csection_padding_bottom . '; }' . "\n"; $css .= '#contact-section .ut-offset-anchor { top:-' . (79 + str_replace("px", "", $ut_csection_padding_top) + str_replace("px", "", $ut_navigation_padding_top) + str_replace("px", "", $ut_navigation_padding_bottom)) . 'px; }' . "\n"; } } /* end $ut_activate_csection */ /* copyright */ if (ot_get_option('ut_footer_font_weight', 'normal') == 'bold') { $css .= '.copyright { font-family: "ralewaysemibold", Helvetica, Arial, sans-serif !important; }'; } /* theme options misc settings */ if (ot_get_option('ut_blockquote_font_type', 'ut-font') == 'ut-google') { $ut_google_blockquote_font_style = ot_get_option('ut_google_blockquote_font_style'); if (!empty($google_fonts[$ut_google_blockquote_font_style['font-id']]['family'])) { $css .= 'blockquote {'; /* familiy */ $css .= 'font-family:"' . $google_fonts[$ut_google_blockquote_font_style['font-id']]['family'] . '", "Helvetica Neue", Helvetica, Arial, sans-serif;'; if (!empty($ut_google_blockquote_font_style['font-weight'])) { $css .= ' font-weight: ' . $ut_google_blockquote_font_style['font-weight'] . ';'; } if (!empty($ut_google_blockquote_font_style['font-size'])) { $css .= ' font-size: ' . $ut_google_blockquote_font_style['font-size'] . ';'; } if (!empty($ut_google_blockquote_font_style['font-style'])) { $css .= ' font-style: ' . $font_styles[$ut_google_blockquote_font_style['font-style']] . ';'; } if (!empty($ut_google_blockquote_font_style['text-transform'])) { $css .= ' text-transform: ' . $ut_google_blockquote_font_style['text-transform'] . ';'; } $css .= '}'; } else { /* fallback if user has not chosen a google font yet */ $ut_blockquote_font_style = ot_get_option('ut_blockquote_font_style', 'semibold'); $css .= 'blockquote { font-family: ' . $ut_recognized_font_styles[$ut_blockquote_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } else { /* out for theme font */ $ut_blockquote_font_style = ot_get_option('ut_blockquote_font_style', 'semibold'); $css .= 'blockquote { font-family: ' . $ut_recognized_font_styles[$ut_blockquote_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } if (ot_get_option('ut_global_lead_font_type', 'ut-font') == 'ut-google') { $ut_google_lead_font_style = ot_get_option('ut_google_lead_font_style'); if (!empty($google_fonts[$ut_google_lead_font_style['font-id']]['family'])) { $css .= '.lead, .taxonomy-description {'; /* familiy */ $css .= 'font-family:"' . $google_fonts[$ut_google_lead_font_style['font-id']]['family'] . '", "Helvetica Neue", Helvetica, Arial, sans-serif;'; if (!empty($ut_google_lead_font_style['font-weight'])) { $css .= ' font-weight: ' . $ut_google_lead_font_style['font-weight'] . ';'; } if (!empty($ut_google_lead_font_style['font-size'])) { $css .= ' font-size: ' . $ut_google_lead_font_style['font-size'] . ';'; } if (!empty($ut_google_lead_font_style['font-style'])) { $css .= ' font-style: ' . $font_styles[$ut_google_lead_font_style['font-style']] . ';'; } if (!empty($ut_google_lead_font_style['text-transform'])) { $css .= ' text-transform: ' . $ut_google_lead_font_style['text-transform'] . ';'; } $css .= '}'; } else { /* fallback if user has not chosen a google font yet */ $ut_lead_font_style = ot_get_option('ut_lead_font_style', 'semibold'); $css .= '.lead, .taxonomy-description { font-family: ' . $ut_recognized_font_styles[$ut_lead_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } } else { /* out for theme font */ $ut_lead_font_style = ot_get_option('ut_lead_font_style', 'semibold'); $css .= '.lead, .taxonomy-description { font-family: ' . $ut_recognized_font_styles[$ut_lead_font_style] . ', "Helvetica Neue", Helvetica, Arial, sans-serif; }' . "\n"; } /* loader logo */ $ut_site_logo = get_theme_mod('ut_site_logo'); $loader_logo = ot_get_option('ut_image_loader_logo', $ut_site_logo); if (!empty($loader_logo)) { $css .= '#ut-loader-logo { background-image: url(' . esc_url($loader_logo) . '); background-position: center center; background-repeat: no-repeat; }' . "\n"; } /* |-------------------------------------------------------------------------- | Footer Skin & Border |-------------------------------------------------------------------------- */ if (ot_get_option('ut_footer_skin', 'ut-footer-light') == 'ut-footer-light') { $ut_footer_skin_light_bgcolor = ot_get_option('ut_footer_skin_light_bgcolor'); if (!empty($ut_footer_skin_light_bgcolor)) { /* add to CSS */ $css .= '.footer, a.toTop { background: ' . $ut_footer_skin_light_bgcolor . ' ; }'; } } else { $ut_footer_skin_dark_bgcolor = ot_get_option('ut_footer_skin_dark_bgcolor'); if (!empty($ut_footer_skin_dark_bgcolor)) { /* add to CSS */ $css .= '.footer.ut-footer-dark, .ut-footer-dark a.toTop { background: ' . $ut_footer_skin_dark_bgcolor . ' ; }'; } } /* footer border */ $ut_footer_skin_border = ot_get_option('ut_footer_skin_border'); /* add to CSS */ if (!empty($ut_footer_skin_border)) { $css .= '.footer { border-top: 1px solid ' . $ut_footer_skin_border . '; }'; $css .= 'a.toTop { border: 1px solid ' . $ut_footer_skin_border . '; border-bottom: none; }'; } /* subfooter backgroundcolor */ $ut_subfooter_bgcolor = ot_get_option('ut_subfooter_bgcolor'); /* add to CSS */ if (!empty($ut_subfooter_bgcolor)) { /* add to CSS */ $css .= '.footer .footer-content { background: ' . $ut_subfooter_bgcolor . ' ; }'; } /* subfooter paddingtop */ $ut_subfooter_padding_top = ot_get_option('ut_subfooter_padding_top'); /* add to CSS */ if (!empty($ut_subfooter_padding_top)) { /* add to CSS */ $css .= '.footer .footer-content { padding-top: ' . $ut_subfooter_padding_top . '; }'; } /* individual section styles , only run this query for front page */ if (is_front_page()) { /* retrieve query arguements */ $pagequery = ut_prepare_front_query(); if (!empty($pagequery)) { $css_query = new WP_Query($pagequery); if ($css_query->have_posts()) { while ($css_query->have_posts()) { $css_query->the_post(); global $detect; $ut_section_video_state = get_post_meta($css_query->post->ID, 'ut_section_video_state', true); /* * split section */ $ut_section_width = get_post_meta($css_query->post->ID, 'ut_section_width', true); if ($ut_section_width == 'split') { /* try to get featured image */ $fullsize = wp_get_attachment_url(get_post_thumbnail_id($css_query->post->ID)); if (!empty($fullsize)) { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .ut-split-screen-poster{ background: url("' . $fullsize . '") }'; } /* padding settings */ $ut_split_section_margin_top = get_post_meta($css_query->post->ID, 'ut_split_section_margin_top', true); $ut_split_section_margin_bottom = get_post_meta($css_query->post->ID, 'ut_split_section_margin_bottom', true); /* fallback if there is no entry */ $ut_split_section_margin_top = empty($ut_split_section_margin_top) ? '' : $ut_split_section_margin_top; $ut_split_section_margin_bottom = empty($ut_split_section_margin_bottom) ? '' : $ut_split_section_margin_bottom; $ut_split_content_align = get_post_meta($css_query->post->ID, 'ut_split_content_align', true); if (!empty($ut_split_content_align) && $ut_split_content_align == 'right') { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .ut-split-content-right { margin-top:' . $ut_split_section_margin_top . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .ut-split-content-right { margin-bottom:' . $ut_split_section_margin_bottom . '; }' . "\n"; } if (!empty($ut_split_content_align) && $ut_split_content_align == 'left') { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .ut-split-content-left { margin-top:' . $ut_split_section_margin_top . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .ut-split-content-left { margin-bottom:' . $ut_split_section_margin_bottom . '; }' . "\n"; } } /* * section padding */ /* get overlay settings */ $ut_overlay_section = get_post_meta($css_query->post->ID, 'ut_overlay_section', true); /* padding settings */ $ut_section_padding_top = get_post_meta($css_query->post->ID, 'ut_section_padding_top', true); $ut_section_padding_bottom = get_post_meta($css_query->post->ID, 'ut_section_padding_bottom', true); $ut_section_slogan_padding = get_post_meta($css_query->post->ID, 'ut_section_slogan_padding', true); /* fallback if there is no entry */ $ut_section_padding_top = empty($ut_section_padding_top) ? '80px' : $ut_section_padding_top; $ut_section_padding_bottom = empty($ut_section_padding_bottom) ? '60px' : $ut_section_padding_bottom; $ut_section_slogan_padding = empty($ut_section_slogan_padding) ? '30px' : $ut_section_slogan_padding; /* add to CSS */ if ($ut_overlay_section == 'on') { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .parallax-overlay { padding-top:' . $ut_section_padding_top . '; padding-bottom:' . $ut_section_padding_bottom . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .ut-offset-anchor { top:-' . (79 + str_replace("px", "", $ut_navigation_padding_top) + str_replace("px", "", $ut_navigation_padding_bottom)) . 'px; }' . "\n"; } else { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . '{ padding-top:' . $ut_section_padding_top . '; padding-bottom:' . $ut_section_padding_bottom . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .ut-offset-anchor { top:-' . (79 + str_replace("px", "", $ut_section_padding_top) + str_replace("px", "", $ut_navigation_padding_top) + str_replace("px", "", $ut_navigation_padding_bottom)) . 'px; }' . "\n"; } $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .parallax-header { padding-bottom:' . $ut_section_slogan_padding . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-header { padding-bottom:' . $ut_section_slogan_padding . '; }' . "\n"; /* * section header font */ /* get font style */ $ut_section_header_font_style = get_post_meta($css_query->post->ID, 'ut_section_header_font_style', true); /* fallback if there is no entry */ $ut_section_header_font_style = empty($ut_section_header_font_style) ? 'semibold' : $ut_section_header_font_style; /* add to CSS */ $css .= ut_create_global_headline_font_style('#' . ut_clean_section_id($css_query->post->post_name) . ' .parallax-title', $ut_section_header_font_style); $css .= ut_create_global_headline_font_style('#' . ut_clean_section_id($css_query->post->post_name) . ' .section-title', $ut_section_header_font_style); if ($ut_section_video_state != 'on') { /* * section parallax image */ /* get parallax settings*/ $ut_parallax_image = get_post_meta($css_query->post->ID, 'ut_parallax_image', true); $ut_parallax_section = get_post_meta($css_query->post->ID, 'ut_parallax_section', true); /* image fallback to version 1.0 */ if (is_array($ut_parallax_image) && !empty($ut_parallax_image['background-image'])) { if (!empty($ut_parallax_image) && $ut_parallax_section == 'on') { $css .= ut_create_css_background('#' . ut_clean_section_id($css_query->post->post_name) . '.parallax-section', $ut_parallax_image); } else { $css .= ut_create_css_background('#' . ut_clean_section_id($css_query->post->post_name), $ut_parallax_image); } } elseif (!is_array($ut_parallax_image)) { if (!empty($ut_parallax_image) && $ut_parallax_section == 'on') { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . '.parallax-section { background-image: url(' . esc_url($ut_parallax_image) . '); }' . "\n"; } else { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' { background-image: url(' . esc_url($ut_parallax_image) . '); }' . "\n"; } } /* * section background color */ $ut_section_background_color = get_post_meta($css_query->post->ID, 'ut_section_background_color', true); if (!empty($ut_section_background_color)) { /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . '{ background-color: ' . $ut_section_background_color . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-header.pt-style-1 .section-title span { background-color: ' . $ut_section_background_color . '; }' . "\n"; } } /* video poster for section */ if ($detect->isMobile() && $ut_section_video_state != 'off' || $detect->isMobile() && ot_get_option('ut_front_video_containment', 'hero') == 'body') { $ut_video_poster = get_post_meta($css_query->post->ID, 'ut_section_video_poster', true); if (!empty($ut_video_poster)) { /* video poster image for mobile devices */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' { background-image: url(' . esc_url($ut_video_poster) . '); background-size: cover !important; background-attachment: scroll !important; }' . "\n"; } else { $ut_section_video_bgcolor = get_post_meta($css_query->post->ID, 'ut_section_video_bgcolor', true); if (!empty($ut_section_video_bgcolor)) { /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . '{ background-color: ' . $ut_section_video_bgcolor . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-header.pt-style-1 .section-title span { background-color: ' . $ut_section_video_bgcolor . '; }' . "\n"; } } } /* * section title , text , heading and lead color */ $ut_section_text_color = get_post_meta($css_query->post->ID, 'ut_section_text_color', true); if (!empty($ut_section_text_color)) { /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-content { color: ' . $ut_section_text_color . '; }' . "\n"; } $ut_section_heading_color = get_post_meta($css_query->post->ID, 'ut_section_heading_color', true); if (!empty($ut_section_heading_color)) { /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-content h1 { color: ' . $ut_section_heading_color . ' !important; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-content h2 { color: ' . $ut_section_heading_color . ' !important; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-content h3 { color: ' . $ut_section_heading_color . ' !important; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-content h4 { color: ' . $ut_section_heading_color . ' !important; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-content h5 { color: ' . $ut_section_heading_color . ' !important; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-content h6 { color: ' . $ut_section_heading_color . ' !important; }' . "\n"; } $ut_section_header_style = get_post_meta($css_query->post->ID, 'ut_section_header_style', true); $ut_section_header_style = !empty($ut_section_header_style) && $ut_section_header_style != 'global' ? $ut_section_header_style : ot_get_option('ut_global_headline_style'); $ut_section_title_color = get_post_meta($css_query->post->ID, 'ut_section_title_color', true); /* pt style 3 needs a fallback */ if (empty($ut_section_title_color) && $ut_section_header_style == 'pt-style-3') { $ut_section_title_color = $accentcolor; } if (!empty($ut_section_title_color)) { /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .parallax-title { color: ' . $ut_section_title_color . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-title { color: ' . $ut_section_title_color . '; }' . "\n"; $css .= create_section_headline_style('#' . ut_clean_section_id($css_query->post->post_name), $ut_section_header_style, $ut_section_title_color); } /* * section title shadow */ if (get_post_meta($css_query->post->ID, 'ut_section_title_glow', true) == 'on') { $ut_section_title_color = get_post_meta($css_query->post->ID, 'ut_section_title_color', true); $ut_section_title_glow_color = get_post_meta($css_query->post->ID, 'ut_section_title_glow_color', true); if (!empty($ut_section_title_color)) { /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .parallax-title.ut-glow { text-shadow: 0 0 40px ' . $ut_section_title_color . ', 2px 2px 3px black ; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-title.ut-glow { text-shadow: 0 0 40px ' . $ut_section_title_color . ', 2px 2px 3px black; }' . "\n"; } if (!empty($ut_section_title_glow_color)) { /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .parallax-title.ut-glow { text-shadow: 0 0 40px ' . $ut_section_title_glow_color . ', 2px 2px 3px black ; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .section-title.ut-glow { text-shadow: 0 0 40px ' . $ut_section_title_glow_color . ', 2px 2px 3px black; }' . "\n"; } } /* * section header spacing */ $ut_section_header_margin_left = get_post_meta($css_query->post->ID, 'ut_section_header_margin_left', true); $ut_section_header_margin_right = get_post_meta($css_query->post->ID, 'ut_section_header_margin_right', true); /* add to CSS */ if (!empty($ut_section_header_margin_left)) { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' header.section-header { margin-left:' . $ut_section_header_margin_left . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' header.parallax-header { margin-left:' . $ut_section_header_margin_left . '; }' . "\n"; } /* add to CSS */ if (!empty($ut_section_header_margin_right)) { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' header.section-header { margin-right:' . $ut_section_header_margin_right . '; }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' header.parallax-header { margin-right:' . $ut_section_header_margin_right . '; }' . "\n"; } /* * section p lead padding */ $ut_section_slogan_padding_left = get_post_meta($css_query->post->ID, 'ut_section_slogan_padding_left', true); $ut_section_slogan_padding_right = get_post_meta($css_query->post->ID, 'ut_section_slogan_padding_right', true); /* add to CSS */ if (!empty($ut_section_slogan_padding_left)) { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .lead { padding-left: ' . $ut_section_slogan_padding_left . '; }' . "\n"; } /* add to CSS */ if (!empty($ut_section_slogan_padding_right)) { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .lead { padding-right: ' . $ut_section_slogan_padding_right . '; }' . "\n"; } /* * section lead color */ $ut_section_slogan_color = get_post_meta($css_query->post->ID, 'ut_section_slogan_color', true); /* add to CSS */ if (!empty($ut_section_slogan_color)) { $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .lead, #' . ut_clean_section_id($css_query->post->post_name) . ' .lead p { color: ' . $ut_section_slogan_color . '; }' . "\n"; } /* * overlay color */ if ($ut_overlay_section == 'on') { $ut_overlay_color = get_post_meta($css_query->post->ID, 'ut_overlay_color', true); $ut_overlay_color_opacity = get_post_meta($css_query->post->ID, 'ut_overlay_color_opacity', true); $ut_overlay_color_opacity = !empty($ut_overlay_color_opacity) ? $ut_overlay_color_opacity : '0.8'; /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .parallax-overlay { background-color: rgb(' . ut_hex_to_rgb($ut_overlay_color) . '); }' . "\n"; $css .= '#' . ut_clean_section_id($css_query->post->post_name) . ' .parallax-overlay { background-color: rgba(' . ut_hex_to_rgb($ut_overlay_color) . ' , ' . $ut_overlay_color_opacity . ' ); }' . "\n"; } /* * section border bottom */ if (get_post_meta($css_query->post->ID, 'ut_section_border_bottom', true) == 'on') { /* border settings */ $ut_section_border_bottom_color = get_post_meta($css_query->post->ID, 'ut_section_border_bottom_color', true); $ut_section_border_bottom_color = !empty($ut_section_border_bottom_color) ? $ut_section_border_bottom_color : $accentcolor; $ut_section_border_bottom_width = get_post_meta($css_query->post->ID, 'ut_section_border_bottom_width', true); $ut_section_border_bottom_width = !empty($ut_section_border_bottom_width) ? $ut_section_border_bottom_width : '1'; $ut_section_border_bottom_style = get_post_meta($css_query->post->ID, 'ut_section_border_bottom_style', true); $ut_section_border_bottom_style = !empty($ut_section_border_bottom_style) ? $ut_section_border_bottom_style : 'solid'; /* add to CSS */ $css .= '#' . ut_clean_section_id($css_query->post->post_name) . '{ border-bottom: ' . $ut_section_border_bottom_width . 'px ' . $ut_section_border_bottom_style . ' ' . $ut_section_border_bottom_color . '; }'; } } } wp_reset_postdata(); } } /* end front page styling */ $css .= '.parallax-overlay-pattern.style_one { background-image: url(" ' . THEME_WEB_ROOT . '/images/overlay-pattern.png") !important; }' . "\n"; $css .= '.parallax-overlay-pattern.style_two { background-image: url(" ' . THEME_WEB_ROOT . '/images/overlay-pattern2.png") !important; }' . "\n"; /* custom css from theme option panel */ $css .= ot_get_option('ut_custom_css'); /* end css */ $css .= '</style>'; /* check for css cache */ if (ot_get_option('ut_use_cache', 'off') == 'on' && is_front_page()) { $transient_prefix = $detect->isMobile() ? '_mobile' : '_desktop'; $cacheTime = ot_get_option('ut_cache_ltime', '10'); set_transient('ut_css_cache' . $transient_prefix, $css, 60 * $cacheTime); } echo apply_filters('ut-custom-css', $css); }
<?php /** * The Template for displaying a custom shortcode inside the Hero * * @author United Themes * @package Brooklyn * @version 1.0 */ /* template config */ $ut_hero_shortcode = ut_return_hero_config('ut_hero_shortcode'); ?> <!-- hero section --> <section class="ha-waypoint" data-animate-up="ha-header-hide" data-animate-down="ha-header-hide"> <?php echo do_shortcode(ut_translate_meta($ut_hero_shortcode)); ?> </section> <!-- end hero section -->
<a class="ut-flex-control next"></a> <a class="ut-flex-control prev"></a> <!-- !controls --> <!-- caption --> <div id="ut-hero-captions" class="ut-hero-captions flexslider"> <ul class="slides"> <?php foreach ($ut_hero_background_slides as $slide) { ?> <?php /* single caption settings */ $style = !empty($slide['style']) && $slide['style'] != 'global' ? $slide['style'] : ut_return_hero_config('ut_hero_style', 'ut-hero-style-1'); $fontstyle = !empty($slide['font_style']) && $slide['font_style'] != 'global' ? $slide['font_style'] : ut_return_hero_config('ut_hero_font_style', 'semibold'); $align = !empty($slide['align']) ? $slide['align'] : 'center'; $animation_direction = !empty($slide['direction']) ? $slide['direction'] : 'top'; $slidelink = !empty($slide['link']) ? $slide['link'] : '#ut-to-first-section'; $link_description = !empty($slide['link_description']) ? $slide['link_description'] : ''; ?> <li> <div class="grid-container"> <!-- hero holder --> <div class="hero-holder grid-100 mobile-grid-100 tablet-grid-100 <?php echo $style; ?> " data-animation="<?php
<div id="ut-hero-audio" class="hero-audio-holder"> <?php echo do_shortcode('[audio mp3="' . THEME_WEB_ROOT . '/sounds/heavyrain.mp3" wav="' . THEME_WEB_ROOT . '/sounds/heavyrain.wav" loop="on" autoplay=""]'); ?> </div> <a href="#ut-hero-audio" class="ut-audio-control ut-unmute">Unmute</a> <?php } ?> <?php /* overlay effect for hero */ ?> <?php if (ut_return_hero_config('ut_hero_overlay') == 'on') { ?> </div> <?php } ?> <div data-section="top" class="ut-scroll-up-waypoint"></div> </section> <!-- end hero section -->
function unitedthemes_scripts() { global $detect; $min = NULL; if (!WP_DEBUG) { $min = '.min'; } /* |-------------------------------------------------------------------------- | CSS |-------------------------------------------------------------------------- */ /* Fonts */ wp_enqueue_style('main-font-face', THEME_WEB_ROOT . '/css/ut-fontface' . $min . '.css'); wp_enqueue_style('ut-fontawesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome' . $min . '.css'); /* Google Fonts */ ut_create_google_font_link(); /* Grid and Responsive */ wp_enqueue_style('ut-responsive-grid', THEME_WEB_ROOT . '/css/ut-responsive-grid' . $min . '.css'); /* Flexslider */ wp_enqueue_style('ut-flexslider', THEME_WEB_ROOT . '/css/flexslider' . $min . '.css'); /* lightbox script */ $ut_lightbox_script = ot_get_option('ut_lightbox_script', 'prettyphoto'); if ($ut_lightbox_script == 'prettyphoto') { /* Prettyphoto */ wp_enqueue_style('ut-prettyphoto', THEME_WEB_ROOT . '/css/prettyPhoto' . $min . '.css'); } else { /* Lightgallery */ wp_enqueue_style('ut-lightgallery', THEME_WEB_ROOT . '/assets/vendor/lightGallery/css/lightgallery' . $min . '.css'); } /* Main Navigation */ wp_enqueue_style('ut-superfish', THEME_WEB_ROOT . '/css/ut-superfish' . $min . '.css'); /* Animate CSS */ wp_enqueue_style('ut-animate', THEME_WEB_ROOT . '/css/ut.animate' . $min . '.css'); /* fancy slider */ if (ut_return_hero_config('ut_hero_type') == 'transition') { wp_enqueue_style('ut-fancy-slider', THEME_WEB_ROOT . '/css/ut-fancyslider' . $min . '.css'); } /* Main CSS */ wp_enqueue_style('unitedthemes-style', get_stylesheet_uri(), array(), UT_THEME_VERSION); /* |-------------------------------------------------------------------------- | JavaScript |-------------------------------------------------------------------------- */ /* base javaScripts header */ wp_enqueue_script('jquery'); /* cookie law - todo */ /*if( ot_get_option('ut_activate_cookie_law' , 'off') == 'on' ) { wp_enqueue_script( 'ut-cookie' , THEME_WEB_ROOT . '/js/jquery.ckie.min.js', array('jquery') , '1.4.1' ); wp_enqueue_script( 'ut-cookie-law' , THEME_WEB_ROOT . '/js/jquery.ckie.law.js', array('jquery') , '1.0' ); }*/ /* preloader */ if (ot_get_option('ut_use_image_loader') == 'on') { $loader_for = ot_get_option('ut_use_image_loader_on'); $loader_match = false; if (!empty($loader_for) && is_array($loader_for)) { foreach ($loader_for as $key => $conditional) { if ($conditional() && $conditional != 'is_singular') { $loader_match = true; /* front page gets handeled as a page too */ if ($conditional == 'is_page' && is_front_page()) { $loader_match = false; } elseif ($conditional == 'is_single' && is_singular('portfolio')) { $loader_match = false; } else { /* we have a match , so we can stop the loop */ break; } } if ($conditional('portfolio') && $conditional == 'is_singular') { $loader_match = true; break; } } } if ($loader_match) { wp_enqueue_script('ut-loader', THEME_WEB_ROOT . '/js/jquery.queryloader2' . $min . '.js', array('jquery'), '2.9.0', false); } } /* browser and mobile detection */ wp_enqueue_script('modernizr', THEME_WEB_ROOT . '/js/modernizr' . $min . '.js', array('jquery'), '2.6.2'); /* comment reply*/ if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } /* * base Java Scripts // output in footer */ /* toucheffect js */ wp_enqueue_script('ut-toucheffects', THEME_WEB_ROOT . '/js/toucheffects' . $min . '.js', array('jquery'), '1.0', true); /* easing */ wp_enqueue_script('ut-easing', THEME_WEB_ROOT . '/js/jquery.easing' . $min . '.js', array('jquery'), '1.3', true); /* superfish navigation */ wp_enqueue_script('ut-superfish', THEME_WEB_ROOT . '/js/superfish' . $min . '.js', array('jquery'), '1.7.4', true); /* smothscroll only for chrome desktop */ if (ot_get_option('ut_smooth_scroll', 'on') == 'on' && preg_match("/chrome/", strtolower($_SERVER['HTTP_USER_AGENT'])) && !$detect->isMobile()) { /* now check if user is using a Windows PC */ $user_agent = getenv("HTTP_USER_AGENT"); if (strpos($user_agent, "Win") !== false) { wp_enqueue_script('ut-smoothscroll', THEME_WEB_ROOT . '/js/SmoothScroll' . $min . '.js', array('jquery'), '0.9.9', true); } } /* retina images */ wp_enqueue_script('ut-retina', THEME_WEB_ROOT . '/js/retina.min.js', array('jquery'), '1.3', true); /* background video player , load only when needed */ if (!$detect->isMobile() && ut_return_hero_config('ut_hero_type') == 'video' || !$detect->isMobile() && ut_return_hero_config('ut_hero_type') == 'tabs' && ut_return_hero_config('ut_video_containment', 'hero') == 'body') { wp_enqueue_script('ut-bgvid', THEME_WEB_ROOT . '/js/jquery.mb.YTPlayer' . $min . '.js', array('jquery'), '1.7.15', true); } /* rain effect, load only when needed */ if (ut_return_hero_config('ut_hero_rain_effect', 'off') == 'on') { wp_enqueue_script('ut-rain', THEME_WEB_ROOT . '/js/rainyday' . $min . '.js', array('jquery'), '1.0', true); } /* selfhosted video player */ if (ut_return_hero_config('ut_video_source', 'youtube') == 'selfhosted') { wp_enqueue_script('ut-video', THEME_WEB_ROOT . '/js/ut-videoplayer' . $min . '.js', array('jquery'), '1.0', true); } /* fancy slider */ if (ut_return_hero_config('ut_hero_type') == 'transition') { wp_enqueue_script('ut-fancy-slider', THEME_WEB_ROOT . '/js/ut-fancyslider' . $min . '.js', array('jquery'), '1.0', true); } /* overlay animation effect */ if (ut_return_hero_config('ut_hero_overlay_effect', 'off') == 'on') { wp_enqueue_script('ut-greensock-tweenlite', THEME_WEB_ROOT . '/js/greensock/TweenLite' . $min . '.js', array(), '1.0', true); wp_enqueue_script('ut-greensock-easepack', THEME_WEB_ROOT . '/js/greensock/EasePack' . $min . '.js', array('ut-greensock-tweenlite'), '1.0', true); wp_enqueue_script('ut-animation-frame', THEME_WEB_ROOT . '/js/greensock/AnimationFrame.js', array('ut-greensock-easepack'), '1.0', true); /* connecting dots overlay */ if (ut_return_hero_config('ut_hero_overlay_effect_style') == 'dots') { wp_enqueue_script('ut-connecting-dots', THEME_WEB_ROOT . '/js/canvas.connectingdots' . $min . '.js', array('ut-animation-frame'), '1.0', true); } /* rising bubbles overlay */ if (ut_return_hero_config('ut_hero_overlay_effect_style') == 'bubbles') { wp_enqueue_script('ut-rising-bubbles', THEME_WEB_ROOT . '/js/canvas.risingbubbles' . $min . '.js', array('ut-animation-frame'), '1.0', true); } } /* flexslider for slider headers */ wp_enqueue_script('ut-flexslider-js', THEME_WEB_ROOT . '/js/jquery.flexslider' . $min . '.js', '2.2.2', true); /* parallax for section backgrounds */ wp_enqueue_script('ut-parallax', THEME_WEB_ROOT . '/js/jquery.parallax' . $min . '.js', array('jquery'), '1.1.3', true); /* scroll to section */ wp_enqueue_script('ut-scrollTo', THEME_WEB_ROOT . '/js/jquery.scrollTo' . $min . '.js', array('jquery'), '1.4.6', true); /* simple waypoints */ wp_enqueue_script('ut-waypoints', THEME_WEB_ROOT . '/js/jquery.waypoints' . $min . '.js', array('jquery'), '2.0.5', true); /* lightbox script */ $ut_lightbox_script = ot_get_option('ut_lightbox_script', 'prettyphoto'); if ($ut_lightbox_script == 'prettyphoto') { /* prettyphoto */ wp_enqueue_script('ut-prettyphoto', THEME_WEB_ROOT . '/js/jquery.prettyPhoto' . $min . '.js', array('jquery'), '3.1.6', true); } else { /* lightgallery */ wp_enqueue_script('ut-lightgallery-js', THEME_WEB_ROOT . '/assets/vendor/lightGallery/js/lightgallery-all' . $min . '.js', array('jquery'), '1.2.6', true); } /* Fit Vid for embeded videos*/ wp_enqueue_script('ut-fitvid', THEME_WEB_ROOT . '/js/jquery.fitvids' . $min . '.js', array('jquery'), '1.0.3', true); /* fit text for hero style 11 */ if (ut_return_hero_config('ut_hero_style', 'ut-hero-style-1') == 'ut-hero-style-11') { wp_enqueue_script('ut-fittext', THEME_WEB_ROOT . '/js/jquery.fittext' . $min . '.js', array('jquery'), '1.2', true); } /* ut social share */ if (is_singular('portfolio')) { wp_enqueue_script('ut-social-share', THEME_WEB_ROOT . '/js/ut-share' . $min . '.js', array('jquery'), '1.0', true); } /* lazy load */ wp_enqueue_script('ut-lazyload-js', THEME_WEB_ROOT . '/js/jquery.lazyload' . $min . '.js', array('jquery'), '1.9.7', false); /* Custom JavaScripts - you can use this file inside the child theme or use the footer java hook */ wp_enqueue_script('unitedthemes-init', STYLE_WEB_ROOT . '/js/ut-init' . $min . '.js', array('jquery'), UT_THEME_VERSION, true); /* retina logos with fallback */ $ut_activate_page_hero = get_post_meta(get_the_ID(), 'ut_activate_page_hero', true); $sitelogo_retina = !is_front_page() && !is_home() && ($ut_activate_page_hero == 'off' || empty($ut_activate_page_hero)) ? get_theme_mod('ut_site_logo_alt_retina') : get_theme_mod('ut_site_logo_retina'); $alternate_logo_retina = get_theme_mod('ut_site_logo_alt_retina') ? get_theme_mod('ut_site_logo_alt_retina') : get_theme_mod('ut_site_logo_retina'); $retina_logos = array('sitelogo_retina' => $sitelogo_retina, 'alternate_logo_retina' => $alternate_logo_retina); wp_localize_script('unitedthemes-init', 'retina_logos', $retina_logos); }
<?php /** * The Template for displaying dynamic content inside the Hero * * @author United Themes * @package Brooklyn * @version 1.0 */ /* template config */ $ut_hero_dynamic_content = ut_return_hero_config('ut_hero_dynamic_content'); ?> <!-- hero section --> <section class="ha-waypoint" data-animate-up="ha-header-hide" data-animate-down="ha-header-hide"> <?php echo apply_filters('the_content', $ut_hero_dynamic_content); ?> </section> <!-- end hero section -->
<?php if (is_front_page() || is_home() || get_post_meta(get_the_ID(), 'ut_activate_page_hero', true) == 'on' && !ut_is_shop() || is_singular('portfolio') && get_post_meta(get_the_ID(), 'ut_activate_page_hero', true) != 'off' || ut_is_shop() && get_post_meta(get_option('woocommerce_shop_page_id'), 'ut_activate_page_hero', true) == 'on') { /* get hero template part based on hero type */ get_template_part('partials/hero', ut_return_hero_config('ut_hero_type')); ?> <div class="clear"></div> <?php }
?> ">Unmute</a> <?php } ?> <?php /* overlay effect for hero */ ?> <?php if (ut_return_hero_config('ut_hero_overlay') == 'on') { ?> </div> <?php } elseif (ut_return_hero_config('ut_hero_overlay') == 'off' && !empty($ut_video_source) && $ut_video_source == 'selfhosted') { ?> </div> <?php } ?> <div data-section="top" class="ut-scroll-up-waypoint"></div> </section> <!-- end hero section -->