Created
May 30, 2018 16:43
-
-
Save seedprod/3c933f89f908d4106927c510552163b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#wpnbio-close,#wpnbio-show{ | |
cursor: pointer; | |
} | |
#wpnbio-alert ul { | |
list-style: none; | |
} | |
#wpnbio-show{ | |
color:#ffffff; | |
display:none; | |
top:0; | |
position:fixed; | |
text-align: center; | |
height:32px; | |
width:40px; | |
z-index:999999; | |
right:10px; | |
background:#ff0000; | |
border-bottom: 0px solid transparent; | |
border-left: 0px solid transparent; | |
border-right: 0px solid transparent; | |
-webkit-box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.35); | |
-moz-box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.35); | |
box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.35); | |
} | |
.admin-bar #wpnbio-show{ | |
top:32px; | |
} | |
#wpnbio-show img{ | |
width: 23px; | |
display: inline-block; | |
margin: 5px auto; | |
} | |
#wpnb-bar{ | |
display:none; | |
position:fixed; | |
top:0px; | |
left:0px; | |
width:100%; | |
z-index:99999; | |
background:#ff0000; | |
text-align:center; | |
color:#fff; | |
height:auto; | |
min-height:33px; | |
border-bottom: 0px solid transparent; | |
-webkit-box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.35); | |
-moz-box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.35); | |
box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.35); | |
font-size:14px; | |
line-height: 1.5em; | |
padding:5px; | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
#wpnb-bar a, #wpnb-bar a:link, #wpnb-bar a:active, #wpnb-bar a:visited, #wpnb-bar a:hover{ | |
text-decoration:none; | |
} | |
.wpnb-bar-button{ | |
display:inline-block; | |
padding: 3px 6px 2px; | |
border-radius: 3px; | |
font-size: 11px; | |
font-weight: bold; | |
line-height: 14px; | |
white-space: nowrap; | |
vertical-align: top; | |
background-color: #000; | |
color:#fff; | |
text-transform:none; | |
font-size: 14px; | |
padding: 5px 6px; | |
border:none; | |
} | |
#wpnbio-subscribe-btn{ | |
cursor:pointer; | |
} | |
a.wpnb-bar-button{ | |
vertical-align: baseline; | |
} | |
#wpnb-bar .form-control{ | |
height: 24px; | |
font-size: 14px; | |
border-radius: 3px; | |
width: 175px; | |
border:1px solid transparent; | |
padding:1px; | |
margin: 0; | |
display: inline; | |
} | |
#wpnbio-description{ | |
line-height:1.2; | |
} | |
#wpnbio-wrapper{ | |
position:relative; | |
} | |
#wpnbio-close { | |
display:none; | |
display: block; | |
position: absolute; | |
top: 0; | |
-webkit-box-sizing: initial; | |
-moz-box-sizing: initial; | |
box-sizing: initial; | |
right: 0; | |
} | |
#wpnbio-close img{ | |
width:16px; | |
} | |
#wpnbio-socialprofiles a{ | |
color:#fff; | |
} | |
.wpnbio-section{ | |
padding-top:4px; | |
padding-bottom:4px; | |
}-show | |
#wpnbio-form{ | |
margin:0; | |
} | |
.countdown_section { | |
display: inline-block; | |
padding: 0 10px; | |
} | |
/*.countdown_amount { | |
padding-right: 4px; | |
}*/ | |
@media (max-width: 480px) { | |
#wpnb-bar .form-control{ | |
display:block; | |
margin:auto; | |
margin-bottom:3px; | |
} | |
} | |
/* Link Styles */ | |
#wpnb-bar a, #wpnb-bar a:visited, #wpnb-bar a:hover, #wpnb-bar a:active{ | |
color: #000000; | |
} | |
.wpnb-bar-button, | |
#wpnb-bar a.wpnb-bar-button { | |
color: white; | |
text-shadow: 0 -1px 0 rgba(0,0,0,0.3); | |
background-color: #000000; | |
background-image: -moz-linear-gradient(top,#000000,#000000); | |
background-image: -ms-linear-gradient(top,#000000,#000000); | |
background-image: -webkit-gradient(linear,0 0,0 100%,from(#000000),to(#000000)); | |
background-image: -webkit-linear-gradient(top,#000000,#000000); | |
background-image: -o-linear-gradient(top,#000000,#000000); | |
background-image: linear-gradient(top,#000000,#000000); | |
background-repeat: repeat-x; | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#000000', GradientType=0); | |
border-color: #000000 #000000 #000000; | |
border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); | |
*background-color: #000000; | |
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); | |
} | |
.wpnb-bar-button:hover, | |
.wpnb-bar-button:active, | |
.wpnb-bar-button.active, | |
.wpnb-bar-button.disabled, | |
.wpnb-bar-button[disabled], | |
#wpnb-bar a.wpnb-bar-button:hover, | |
#wpnb-bar a.wpnb-bar-button:active, | |
#wpnb-bar a.wpnb-bar-button.active, | |
#wpnb-bar a.wpnb-bar-button.disabled, | |
#wpnb-bar a.wpnb-bar-button[disabled] { | |
background-color: #000000; | |
*background-color: #000000; | |
} | |
.wpnb-bar-button:active, | |
.wpnb-bar-button.active, | |
#wpnb-bar a.wpnb-bar-button:active, | |
#wpnb-bar a.wpnb-bar-button.active { | |
background-color: #000000 \9; | |
} | |
.wpnb-bar-button:hover, | |
#wpnb-bar a.wpnb-bar-button:hover { | |
color: white; | |
text-shadow: 0 -1px 0 rgba(0,0,0,0.3); | |
background-color: #000000; | |
background-image: -moz-linear-gradient(top,#000000,#000000); | |
background-image: -ms-linear-gradient(top,#000000,#000000); | |
background-image: -webkit-gradient(linear,0 0,0 100%,from(#000000),to(#000000)); | |
background-image: -webkit-linear-gradient(top,#000000,#000000); | |
background-image: -o-linear-gradient(top,#000000,#000000); | |
background-image: linear-gradient(top,#000000,#000000); | |
background-repeat: repeat-x; | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#000000', GradientType=0); | |
border-color: #000000 #000000 #000000; | |
border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); | |
*background-color: #000000; | |
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); | |
} | |
.wpnb-bar-button:hover:hover, | |
.wpnb-bar-button:hover:active, | |
.wpnb-bar-button:hover.active, | |
.wpnb-bar-button:hover.disabled, | |
.wpnb-bar-button:hover[disabled], | |
#wpnb-bar a.wpnb-bar-button:hover:hover, | |
#wpnb-bar a.wpnb-bar-button:hover:active, | |
#wpnb-bar a.wpnb-bar-button:hover.active, | |
#wpnb-bar a.wpnb-bar-button:hover.disabled, | |
#wpnb-bar a.wpnb-bar-button:hover[disabled] { | |
background-color: #000000; | |
*background-color: #000000; | |
} | |
.wpnb-bar-button:hover:active, | |
.wpnb-bar-button:hover.active, | |
#wpnb-bar a.wpnb-bar-button:hover:active, | |
#wpnb-bar a.wpnb-bar-button:hover.active { | |
background-color: #000000 \9; | |
} | |
#wpnb-bar .form-control { | |
background-color: #f5f5f5; | |
} | |
#wpnb-bar .form-control { | |
color: black; | |
text-shadow: 0 -1px 0 rgba(255,255,255,0.3); | |
} | |
/* Text Styles */ | |
#wpnb-bar{ | |
font-size: 15px; | |
line-height: 0; | |
color:#ffffff; | |
} | |
#wpnbio-countdown{ | |
line-height: 1.2; | |
} | |
#wpnbio-socialprofiles a{ | |
color:#ffffff !important; | |
} | |
.wpnb-bar-button{ | |
font-weight: 400; | |
font-style: ; | |
} | |
</style> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.4/js.cookie.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script> | |
<script> | |
var wpnbCookies = Cookies.noConflict(); | |
//Reneder SeedProd Notification Bar Pro | |
jQuery(window).bind("load", function() { | |
jQuery(document).ready(function($){ | |
var show = true; | |
var endDate = new Date(); | |
var now = new Date(); | |
var is_preview = false; | |
if(show){ | |
jQuery('body').prepend(jQuery('#wpnbio-show')); | |
jQuery('body').prepend(jQuery('#wpnb-bar')); | |
var wpnb_bar_state = wpnbCookies.get('wpnb_3'); | |
if(wpnb_bar_state == undefined ){ | |
show_wpnb_bar(); | |
}else if(wpnb_bar_state == 'shown'){ | |
show_wpnb_bar(); | |
} | |
if(wpnb_bar_state == 'hidden' ){ | |
$( "#wpnbio-show" ).show(); | |
//console.log(wpnb_bar_state); | |
} | |
// show hide logic | |
$( "#wpnbio-close" ).click(function() { | |
hide_wpnb_bar(); | |
}); | |
$( "#wpnbio-show" ).click(function() { | |
$(this).hide(); | |
if(jQuery("#wpnb-bar").css('position') == 'relative'){ | |
$('html,body').scrollTop(0); | |
} | |
show_wpnb_bar(); | |
}); | |
} | |
}); | |
}); | |
function hide_wpnb_bar(){ | |
// jQuery('#wpnb-bar').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',function(){ jQuery("#wpnb-bar").hide();}); | |
// jQuery("#wpnb-bar").addClass('animated fadeOutUpBig'); | |
jQuery("#wpnb-bar").hide(); | |
jQuery("#wpnbio-show").fadeIn(); | |
jQuery('html').attr('style','margin-top:'+ 0 +'px'); | |
wpnbCookies.set('wpnb_3', 'hidden'); | |
} | |
function show_wpnb_bar(){ | |
// Calcuate body top margin if fixed. | |
if(jQuery("#wpnb-bar").css('position') == 'fixed'){ | |
// Calcute Position if WP Admin bar is active | |
if(jQuery('#wpadminbar').length >= 1){ | |
// Logged in | |
var adminBarHeight = jQuery("#wpadminbar").height(); | |
jQuery('#wpnb-bar').css('top',jQuery("#wpadminbar").height()+'px'); | |
var htmlHeight = jQuery("#wpnb-bar").height() +10 + 0 + adminBarHeight; | |
jQuery('html').attr('style','margin-top:'+ htmlHeight +'px !important'); | |
}else{ | |
// Logged out | |
setTimeout(function(){ | |
var marginTop = jQuery("#wpnb-bar").height() +10 + 0; | |
jQuery('html').attr('style','margin-top:'+ marginTop +'px !important'); | |
}, 100); | |
} | |
} | |
// Animation | |
jQuery("#wpnb-bar").show(); | |
wpnbCookies.set('wpnb_3', 'shown'); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment