Last active
October 5, 2018 23:51
-
-
Save brandonhellman/4771000278c91be203aa1cfa94b026dc to your computer and use it in GitHub Desktop.
Provides crosshairs for A9 HITs.
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
// ==UserScript== | |
// @name A9 Crosshairs | |
// @version 1.0.0 | |
// @author Kadauchi | |
// @include requester_id:3R8NDUBSF6YFJ09L5IGKXETPSAB4KD | |
// //@include https://www.mturkcontent.com/dynamic/hit* | |
// //@include https://s3.amazonaws.com/mturk_bulk/hits/* | |
// ==/UserScript== | |
const color = 'red'; | |
document.head.insertAdjacentHTML( | |
'beforeend', | |
`<style> | |
.hair { | |
left:0; | |
border-top: 2px dotted ${color}; | |
border-left: 2px dotted ${color}; | |
pointer-events: none; | |
position: fixed; | |
top:0; | |
z-index: 10000; | |
} | |
</style>` | |
); | |
const xHair = document.createElement('div'); | |
xHair.className = 'hair'; | |
xHair.style.width = '100vw'; | |
document.body.prepend(xHair); | |
const yHair = document.createElement('div'); | |
yHair.className = 'hair'; | |
yHair.style.height = '100vh'; | |
document.body.prepend(yHair); | |
document.addEventListener('mousemove', ({ x, y }) => { | |
xHair.style.top = `${y}px`; | |
yHair.style.left = `${x}px`; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example GIF below.
![GitHub Logo](https://camo.githubusercontent.com/12221a9970ee832ca443e9ad2c65d35d89c53b56d24c0f34f4215f324dd9d344/68747470733a2f2f692e6779617a6f2e636f6d2f62386530626162323862326138666236666465653534643764636134333663652e676966)