Skip to content

Instantly share code, notes, and snippets.

@tvst
Last active October 11, 2019 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvst/0bdd07513c5abfcc465d009b99cbb9a9 to your computer and use it in GitHub Desktop.
Save tvst/0bdd07513c5abfcc465d009b99cbb9a9 to your computer and use it in GitHub Desktop.
Make Gmail more Inbox-like (RIP)
javascript:(() => {
/* Autohide header */
const header = document.querySelector('.nH.w-asV.aiw');
hide = () => {
header.style.transition = 'opacity 300ms 300ms, transform 300ms 300ms';
header.style.opacity = 0;
header.style.transform = 'translateY(-50px)';
};
show = () => {
header.style.transition = 'opacity 150ms 0ms, transform 150ms 0ms';
header.style.opacity = 1;
header.style.transform = '';
};
header.addEventListener('mouseover', show);
header.addEventListener('mouseout', hide);
hide();
const css = document.createElement('style');
css.innerText = `
/* header */
.nH.w-asV.aiw {
position: fixed;
background: #fff;
boxShadow: 0 2px 10px rgba(0, 0, 0, 0.2);
border: none;
}
/* main body */
.nH.bkK.nn > .nH {
width: 50em;
margin: 20px auto;
}
/* footer */
.Tm.aeJ > .aeG {
display: none;
}
`;
document.body.append(css);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment