Skip to content

Instantly share code, notes, and snippets.

@3kh0
Created April 23, 2025 20:21
Show Gist options
  • Save 3kh0/4ce6a3e75d7284a61009802851f11c88 to your computer and use it in GitHub Desktop.
Save 3kh0/4ce6a3e75d7284a61009802851f11c88 to your computer and use it in GitHub Desktop.
Page flip bookmarklet
javascript:(function(){function f(){let fc=document.getElementById('ghu');if(!fc){fc=document.createElement('div');fc.id='ghu';Object.assign(fc.style,{position:'fixed',top:'0',left:'0',width:'100%',height:'100%',zIndex:'9999',overflow:'auto',transform:'rotate(180deg)',backgroundColor:document.body.style.backgroundColor||'white'});const bc=document.body.cloneNode(true);const ec=bc.querySelector('#ghu');if(ec){ec.remove();}fc.appendChild(bc);document.body.appendChild(fc);Array.from(document.body.children).forEach(child=>{if(child.id!=='ghu'){child.style.display='none';}});}else{fc.remove();Array.from(document.body.children).forEach(child=>{child.style.display='';});}}f();})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment