Skip to content

Instantly share code, notes, and snippets.

@wragge
Last active October 1, 2025 10:15
Show Gist options
  • Select an option

  • Save wragge/ebc00790f87e83128f68d992be878dc1 to your computer and use it in GitHub Desktop.

Select an option

Save wragge/ebc00790f87e83128f68d992be878dc1 to your computer and use it in GitHub Desktop.
SLV Easter Egg Hunt
// ==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);
}
});
@wragge
Copy link
Author

wragge commented Oct 1, 2025

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment