Skip to content

Instantly share code, notes, and snippets.

@benknight
Last active August 29, 2015 14:02
Show Gist options
  • Save benknight/d9e94c9f2154409b0b8c to your computer and use it in GitHub Desktop.
Save benknight/d9e94c9f2154409b0b8c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
(function() {
if ( ! document.body.classList.contains('logged-in') ) {
alert('Please log in before using this bookmarklet. I’m too lazy to make it work for logged-out.');
} else {
var isVisible = false;
if (document.body.classList.contains('borderless')) {
window.addEventListener('scroll', function() {
if (window.scrollY > 600 && ! isVisible ) {
document.querySelector('.footer-wrap').style.visibility = 'visible';
isVisible = true;
} else if (window.scrollY <= 600 && isVisible ) {
document.querySelector('.footer-wrap').style.visibility = 'hidden';
isVisible = false;
}
});
}
}
})();
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// Bourbon (v4.0.2)
// ----
@import "bourbon/bourbon";
.logged-in {
&.borderless {
.footer {
@include box-sizing(border-box);
z-index: -2;
height: 560px;
}
.footer-wrap {
visibility: hidden;
z-index: -1;
position: fixed;
bottom: 0;
left: 50%;
@include transform(translate(-50%));
}
}
&:not(.borderless) {
padding-bottom: 560px;
.footer {
z-index: -1;
position: fixed;
bottom: 0;
width: 100%;
}
}
}
.logged-in.borderless .footer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;z-index:-2;height:560px}.logged-in.borderless .footer-wrap{visibility:hidden;z-index:-1;position:fixed;bottom:0;left:50%;-webkit-transform:translate(-50%);-moz-transform:translate(-50%);-ms-transform:translate(-50%);-o-transform:translate(-50%);transform:translate(-50%)}.logged-in:not(.borderless){padding-bottom:560px}.logged-in:not(.borderless) .footer{z-index:-1;position:fixed;bottom:0;width:100%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment