Created
July 25, 2019 00:59
-
-
Save jh3y/e4df23eac6a6b074b4e2e8527b1aa718 to your computer and use it in GitHub Desktop.
Bookmarklet for "Focussed Twitter" π¦
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
// Create a new bookmark in your browsers' Bookmark Manager pointing at the following script: | |
javascript:(function(){let a;const b=new CSSStyleSheet;b.insertRule("header, [data-testid=\"sidebarColumn\"] { transition: opacity .5s ease; }"),b.insertRule(".fade-noise header, .fade-noise [data-testid=\"sidebarColumn\"] { opacity: 0.005; }"),document.adoptedStyleSheets=[b];const c=()=>{document.body.classList.add("fade-noise"),a&&clearTimeout(a),a=setTimeout(()=>{document.body.classList.remove("fade-noise")},2500)};window.addEventListener("scroll",c)})(); | |
// NOTE:: You can modify the behavior by updating the values in the injected CSS | |
// 1. transition time for opacity (0.5s default) | |
// 2. opacity of non-focussed items (0.05 default) | |
// 3. time it takes for non-focussed items to return to full opacity (2500ms default) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment