// source --> https://castelloncreativa.com/wp-content/plugins/top-bar/js/tpbr_front.min.js /** * Top Bar Front JS (minified) */ ;(function($){$(document).ready(function(){var fixed=tpbr_settings.fixed;var message=tpbr_settings.message;var url=tpbr_settings.button_url;var link=tpbr_settings.button_text;var tbcolor=tpbr_settings.color;var status=tpbr_settings.status;var button=tpbr_settings.yn_button;var is_admin_bar=tpbr_settings.is_admin_bar;var timeoutScroller='';$(document).scroll(function(){if($('#wpadminbar').length&&fixed=='fixed'&&$(window).width()<601){clearTimeout(timeoutScroller);timeoutScroller=setTimeout(function(){if($(document).scrollTop()<46){$('#tpbr_topbar').css({top:46-$(document).scrollTop()})}else{if($('#tpbr_topbar').css('top')!=0){$('#tpbr_topbar').css({top:0})}}},10)}}) function updateHeights(){if($('.pushr').length){if($('#wpadminbar').length){var newAdminBarHeight=$('#wpadminbar').outerHeight();var topBarHeight=$('#tpbr_topbar').outerHeight();$('.pushr').height(topBarHeight);$('#tpbr_topbar').css({top:newAdminBarHeight})}}} if(button=='button'){function shadeColor1(color,percent){var num=parseInt(color.slice(1),16),amt=Math.round(2.55*percent),R=(num>>16)+amt,G=(num>>8&0x00FF)+amt,B=(num&0x0000FF)+amt;return"#"+(0x1000000+(R<255?R<1?0:R:255)*0x10000+(G<255?G<1?0:G:255)*0x100+(B<255?B<1?0:B:255)).toString(16).slice(1)} var ltbcolor=shadeColor1(tbcolor,-12);var btn_result=''+link+''}else{var btn_result=''} if(fixed=='fixed'){var fixed_result='position:fixed; z-index:9999; width:100%; left:0px; top:0; '}else{var fixed_result=''} if(status=='active'){if(fixed=='fixed'){$('
'+message+btn_result+'
').prependTo('body')}else{$('
'+message+btn_result+'
').prependTo('body')} updateHeights();$(window).resize(function(){updateHeights()})}})})(jQuery);