Last active
September 14, 2022 02:10
-
-
Save magasine/94f5b70d9f0744a3adfa1212b622dc95 to your computer and use it in GitHub Desktop.
! Cursor w/ ruler line - Toggle
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
javascript : (function () { | |
if (!document.getElementById("redLine")) { | |
h = document.createElement("div"); | |
h.setAttribute("id", "redLine"); | |
h.setAttribute("style", "width:100%;height:3px;background-color:red;font-size:inherit;line-height:inherit;position:absolute;left:0px;top:0px;z-index:999;opacity:1;"); | |
document.getElementsByTagName("body")[0].appendChild(h); | |
window.onmousemove = function (e) { | |
var h = document.getElementById("redLine"); | |
h.style.top = (e.pageY + 15) + "px"; | |
h.setAttribute("class", e.pageY); | |
} | |
} else { | |
h.remove(); | |
} | |
})(); | |
// Bookmarklet | |
// Adapted from https://gist.github.com/bradmontgomery/1787016 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment