Skip to content

Instantly share code, notes, and snippets.

@whatnickcodes
Created May 8, 2017 19:07
Show Gist options
  • Save whatnickcodes/840dcb2fd654490ab2cb8da1b1547ae6 to your computer and use it in GitHub Desktop.
Save whatnickcodes/840dcb2fd654490ab2cb8da1b1547ae6 to your computer and use it in GitHub Desktop.
<style>
#side-promo {
display: block;
text-align: center;
background-color: #111;
background-size: cover;
background-position: top center;
border-radius: 4px;
padding-bottom: 15px;
padding-top: 15px;
color: #EEE;
position: fixed;
bottom: 10px;
left: 15px;
right: 15px;
line-height: 1;
-webkit-transition: .3s ease all;
-moz-transition: .3s ease all;
transition: .3s ease all;
width: 205px;
height: 175px;
width: 209px !important;
height: 221px !important;
left: 0 !important;
bottom: 0 !important;
padding-bottom: 0 !important;
z-index: 9999;
background: none !important;
}
#side-promo:hover {
opacity: 0.9;
}
#side-promo .img {
width: 100%;
height: 100%;
display: block;
background-size: contain;
background-position: 50%;
background-repeat: no-repeat;
}
.kill-ad {
position: absolute;
left: 0;
width: 100%;
text-align: center;
bottom: 100%;
font-size: 11px;
margin-bottom: 8px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: .1em;
color: #6d6b65;
opacity: 0;
position: absolute;
left: 0;
width: 100%;
text-align: center;
bottom: 100%;
font-size: 11px;
margin-bottom: 8px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: .1em;
-webkit-transition: all 225ms ease;
-moz-transition: all 225ms ease;
transition: all 225ms ease;
cursor: pointer;
color: #6d6b65;
opacity: 0;
margin: 0;
}
#side-promo:hover .kill-ad {
opacity: 1;
}
</style>
<script>
// Kill ad
var docCookies={getItem:function(a){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(a).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},setItem:function(a,b,c,d,e,f){if(!a||/^(?:expires|max\-age|path|domain|secure)$/i.test(a))return!1;var g="";if(c)switch(c.constructor){case Number:g=c===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+c;break;case String:g="; expires="+c;break;case Date:g="; expires="+c.toUTCString()}return document.cookie=encodeURIComponent(a)+"="+encodeURIComponent(b)+g+(e?"; domain="+e:"")+(d?"; path="+d:"")+(f?"; secure":""),!0},removeItem:function(a,b,c){return!(!a||!this.hasItem(a))&&(document.cookie=encodeURIComponent(a)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(c?"; domain="+c:"")+(b?"; path="+b:""),!0)},hasItem:function(a){return new RegExp("(?:^|;\\s*)"+encodeURIComponent(a).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},keys:function(){for(var a=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),b=0;b<a.length;b++)a[b]=decodeURIComponent(a[b]);return a}};
$('#side-promo .kill-ad').click(function() {
$('#side-promo').remove();
docCookies.setItem('hide_side_promo', 1, 604800);
return false;
});
if (!docCookies.getItem('hide_side_promo')) {
$('#side-promo').addClass('show');
}
</script>
<a href="https://hrd.cm/2k90ljr" id="side-promo" class="show">
<span class="img" style="background-image: url('http://192.168.33.10/wp-content/themes/scotchpress/img/hired-new-2.png');"></span>
<div class="kill-ad">Dismiss <span class="iconic iconic-x"></span></div>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment