Last active
October 1, 2025 10:15
-
-
Save wragge/ebc00790f87e83128f68d992be878dc1 to your computer and use it in GitHub Desktop.
SLV Easter Egg Hunt
This file contains hidden or 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 SLV easter egg hunt | |
| // @namespace wraggelabs.com/slv_easter_egg_hunt | |
| // @match *://viewer.slv.vic.gov.au/?entity=* | |
| // @grant none | |
| // @version 1.0 | |
| // @author - | |
| // @description 28/09/2025, 14:41:35 | |
| // @require https://cdn.jsdelivr.net/gh/CoeJoder/[email protected]/waitForKeyElements.js | |
| // ==/UserScript== | |
| // These are the pages on which the eggs will appear | |
| const pages = [ | |
| "https://viewer.slv.vic.gov.au/?entity=IE741728&mode=browse", | |
| "https://viewer.slv.vic.gov.au/?entity=IE4152304&mode=browse", | |
| "https://viewer.slv.vic.gov.au/?entity=IE223183&mode=browse" | |
| ]; | |
| // The message on page 1 gives clues to page 2 etc | |
| const messages = [ | |
| "WELL DONE!\n\nYou've found the first egg\n\nHere's some clues to help you find the next one:\n\n\t• Part of the anti-conscription campaign in WWI\n\t• 'The Death ______'\n\n", | |
| "GREAT JOB!\n\nYou've found the second egg\n\nHere's some clues to help you find the next one:\n\n\t• Copyright registration\n\t• full of 'vegetable bitters'\n\n", | |
| "SMASHED IT!\n\nYou've found all the eggs, but why not keep exploring the Library's digitised collections?\n\n", | |
| ] | |
| // Check to see if the current page needs an egg | |
| function getOrder() { | |
| for (let i=0; i<pages.length; i++) { | |
| if (window.location.href == pages[i]) { | |
| console.log("found", i); | |
| return i; | |
| } | |
| } | |
| return false; | |
| } | |
| function addEgg(order) { | |
| let footerList = document.querySelector("nav.footer-navigation ul"); | |
| let egg = document.createElement("li"); | |
| egg.className = "footer-navigation__item"; | |
| egg.innerHTML = "🥚"; | |
| egg.onclick = function() { alert(messages[order]);} | |
| egg.style.cursor = "pointer"; | |
| footerList.appendChild(egg); | |
| } | |
| waitForKeyElements("#handleURL", (handleInput) => { | |
| const order = getOrder(); | |
| if (order !== false) { | |
| addEgg(order); | |
| } | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SLV digitised collections egg hunt
Create a simple treasure hunt. Each page embeds some clues that point to the next digitised item. If there's an easter egg, click on it to view the clues!
Start with the author of For the term of his natural life.
Make sure you view the digitised item to find the egg!