Last active
December 17, 2023 19:15
-
-
Save scottgarner/3ce88a43c72ab2aeb655e2c1e7b484f7 to your computer and use it in GitHub Desktop.
SudokuPad Userscript
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 SudokuPad Copy | |
// @namespace SudokuPad | |
// @match https://crackingthecryptic.com/* | |
// @match https://*.crackingthecryptic.com/* | |
// @match https://sudokupad.app/* | |
// @match https://*.sudokupad.app/* | |
// @grant none | |
// @version 1.0 | |
// @author Scott Garner | |
// @run-at document-end | |
// @description 3/12/2023, 4:21:46 PM | |
// ==/UserScript== | |
console.log("SudokuPad Copy Enabled!"); | |
window.document.onkeydown = (event) => { | |
if (event.key == "c" && event.ctrlKey) { | |
const sequence = Framework.app.puzzle.selectedCells.map((cell) => { | |
return cell.given||cell.value || " "; | |
}).join(""); | |
navigator.clipboard.writeText(sequence); | |
console.log("Copying sequence:", sequence); | |
} | |
} | |
const main = ()=> { | |
const gameDiv = document.querySelector(".game"); | |
console.log(gameDiv); | |
gameDiv.style.background = "limegreen"; | |
const gridDiv = document.querySelector(".grid"); | |
gridDiv.style.background = "white"; | |
} | |
main(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment