User:Storm/darkcosmos.js
From Fallen London Wiki (Staging)
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Any JavaScript here will be loaded for users using the DarkCosmos skin */
;(function () {
if (!window.matchMedia('only screen and (min-width: 1101px)').matches) return undefined;
// var defaultHeader = '/w/images/9/9e/Prison-header.png';
var locationHeaders = {
// Starting Locations
'Ladybones Road': '/w/images/6/6c/Ladybones-header.png',
'Spite': '/w/images/0/0c/Spite-header.png',
'Veilgarden': '/w/images/2/2d/Veilgarden-header.png',
"Watchmaker's Hill": '/w/images/b/b1/Watchmakershill-header.png',
'Your Lodgings': '/w/images/a/a7/Lodgings-header.png',
'Your Social Engagements': '/w/images/a/a7/Lodgings-header.png',
'Your Activities': '/w/images/a/a7/Lodgings-header.png',
"Mrs Plenty's Carnival": '/w/images/8/88/Carnival-header.png',
// Early Game Locations in London
'Moloch Street': '/w/images/6/6c/Ladybones-header.png',
'The Clay Quarters': '/w/images/6/6c/Ladybones-header.png',
'The Forgotten Quarter': '/w/images/4/40/Forgottenquarter-header.png',
'Base Camp': '/w/images/4/40/Forgottenquarter-header.png',
'Area-Diving in Spite': '/w/images/4/4a/Crowdsofspite.png',
'The Flit': '/w/images/0/01/Flit-header.png',
'Plan a Heist': '/w/images/0/01/Flit-header.png',
'The Singing Mandrake': '/w/images/2/2d/Veilgarden-header.png',
'The Shuttered Palace': '/w/images/4/42/Shutteredpalace-header.png',
"The Medusa's Head": '/w/images/b/b1/Watchmakershill-header.png',
'Dept. of Menace Eradication': '/w/images/b/b1/Watchmakershill-header.png',
'Wolfstack Docks': '/w/images/e/ec/Wolfstack-header.png',
'The Blind Helmsman': '/w/images/e/ec/Wolfstack-header.png',
// Mid-game Locations in London
'The University': '/w/images/f/f5/University-header.png',
'Mahogany Hall': '/w/images/2/2c/Mahoganyhall-header.png',
"The Empress' Court": '/w/images/9/9b/Empresscourt-header.png',
'The Labyrinth of Tigers': '/w/images/2/28/Labyrinth-header.png',
"Wilmot's End": '/w/images/4/4a/Wilmotsend-header.png',
'Bazaar Side-streets': '/w/images/c/c6/Sidestreets.png',
'The Foreign Office': '/w/images/5/52/Foreignoffice-header.png',
'Doubt Street': '/w/images/4/46/Doubtstreet-header.png',
'Concord Square': '/w/images/6/6c/Ladybones-header.png',
// London sub-areas
'The Crowds of Spite': '/w/images/4/4a/Crowdsofspite.png',
'A Flash Lay': '/w/images/a/a7/Lodgings-header.png',
'On a Heist': '/w/images/e/e6/Noheader.png',
'Cave of the Nadir': '/w/images/0/0a/Caveofthenadir-header.png',
'University Laboratory (Place)': '/w/images/f/f5/University-header.png',
'The Bone Market': '/w/images/b/b1/Watchmakershill-header.png',
'The Temple Club': '/w/images/c/c1/Templeclub-header.png',
// Other Locations accessed in London
'Tutorial Prison': '/w/images/9/9e/Prison-header.png',
'After the Case': '/w/images/a/a7/Lodgings-header.png',
'Beneath the Silken Chapel': '/w/images/e/ec/Wolfstack-header.png',
'The Mind of a Long-Dead God': '/w/images/6/62/Delirium-header.png',
'Arbor, of the Roses': '/w/images/f/f9/Adamsway-header.png',
"The Gamekeeper's Cottage": '/w/images/b/b0/Gamekeeper_cottage-header.png',
// Menace Locations
'A state of some confusion': '/w/images/d/d4/Mad-header.png',
'The Mirror-Marches': '/w/images/0/01/Parabola-header.png',
'New Newgate Prison': '/w/images/9/9e/Prison-header.png',
'A boat trip': '/w/images/1/1e/Death-header.png',
'Disgraced exile in the Tomb-Colonies': '/w/images/3/3f/Scandal-header.png',
// Zee Areas
'Home Waters': '/w/images/4/4c/Island2-header.png',
'The Sea of Voices': '/w/images/a/a4/Seaofvoices-header.png',
'The Snares': '/w/images/3/3b/Zailing_corsairsforest-header.png',
'The Pillared Sea': '/w/images/2/2e/Zailing_pillaredsea-header.png',
'The Salt Steppes': '/w/images/6/60/Zailing_steppes-header.png',
'Stormbones': '/w/images/c/c2/Corpsecage_island-header.png',
'Shepherd\'s Wash': '/w/images/4/4b/Island1-header.png',
'Aboard a Tramp Steamer': '/w/images/d/dc/Aboard-header.png',
// Overzee Locations
'Mutton Island': '/w/images/4/4b/Island1-header.png',
"Hunter's Keep": '/w/images/4/4c/Island2-header.png',
'Bullbone Island': '/w/images/e/e6/Bullbone-header.png',
'Corpsecage Island': '/w/images/c/c2/Corpsecage_island-header.png',
'Grunting Fen': '/w/images/e/e6/Bullbone-header.png',
'Polythreme Streets': '/w/images/7/7b/Polythreme-header.png',
'Iron Republic Streets': '/w/images/c/c8/Ironrepublic-header.png',
'Heartscross House': '/w/images/0/0b/Carneliancoast-header.png',
'The Court of the Wakeful Eye': '/w/images/f/fd/Carneliancoastheader.png',
'The Copper Quarter': '/w/images/6/60/Zailing_steppes-header.png',
'Khan\'s Heart': '/w/images/6/60/Zailing_steppes-header.png',
// Major Storyline Locations
// Ambition: Nemesis Locations
'The Chambers of the Heart': '/w/images/e/ec/Chambersoftheheart-header.png',
'The tomb-colony of Venderbight': '/w/images/3/3f/Scandal-header.png',
// Ambition: Bag a Legend! Locations
'The Abyssal Depths': '/w/images/f/fc/Blackheader.png',
'The Convent': '/w/images/4/4b/Island1-header.png',
// Ambition: Light Fingers! Locations
'The shadows of the Orphanage': '/w/images/f/f7/Orphanage-header.png',
'The Silent Corridors of the Orphanage': '/w/images/f/f7/Orphanage-header.png',
'A small, velvet lined box': '/w/images/f/fc/Blackheader.png',
'A Secluded Coastline': '/w/images/c/c8/Coast2-header.png',
'Castles in the Ceiling': '/w/images/8/87/Neathroof-header.png',
'The Skin of the Sun': '/w/images/e/ee/Bazaarsun-header.png',
// SMEN Locations
"Mrs Plenty's Carnival (SMEN)": '/w/images/8/88/Carnival-header.png',
'Winking Isle': '/w/images/4/4b/Island1-header.png',
'The Chapel of Lights': '/w/images/8/8a/Chapeloflights-header.png',
'Avid Horizon': '/w/images/e/e0/Avidhorizon_port-header.png',
// Destiny Locations
'The Liberation of Night': '/w/images/9/9c/Liberationofnight-header.png',
'A Long Road': '/w/images/e/ee/Bazaarsun-header.png',
'The Castle of Forests': '/w/images/6/68/Castleofforests-header.png',
'The Approach to the Mountain': '/w/images/f/fd/Carneliancoastheader.png',
'Down among the Lorn-Flukes': '/w/images/d/d5/Flukes-header.png',
// Parabolan Locations
'Reflection of your Laboratory': '/w/images/0/01/Parabola-header.png',
'Parabolan Base-Camp': '/w/images/0/01/Parabola-header.png',
'The Waswood': '/w/images/0/01/Parabola-header.png',
'The Chessboard': '/w/images/0/01/Parabola-header.png',
'The Dome of Scales': '/w/images/0/01/Parabola-header.png',
'Viric Jungle': '/w/images/0/01/Parabola-header.png',
'The Dolorous Pavilion': '/w/images/f/f2/Bleedingforest-header.png',
// Hinterlands Locations
'Ealing Gardens': '/w/images/9/98/Railway-header.png',
'Jericho Locks': '/w/images/9/98/Railway-header.png',
'The Magistracy of the Evenlode': '/w/images/9/98/Railway-header.png',
'Balmoral': '/w/images/9/98/Railway-header.png',
'Station VIII': '/w/images/0/0e/StationVIII-header.png',
'Burrow-Infra-Mump': '/w/images/9/98/Railway-header.png',
'Moulin': '/w/images/9/98/Railway-header.png',
'Marigold Station': '/w/images/9/98/Railway-header.png',
// Special Locations
'The Gates of Hell': '/w/images/6/62/Delirium-header.png',
'Adulterine Castle': '/w/images/e/e6/Noheader.png',
};
var locations = Object.keys(locationHeaders);
var categories = [];
if (
window.RLCONF &&
window.RLCONF.wgCategories &&
window.RLCONF.wgCategories.length
) {
categories = categories.concat(window.RLCONF.wgCategories);
}
if (window.RLCONF && window.RLCONF.wgTitle) {
categories.push(window.RLCONF.wgTitle);
}
var matchingLocations = locations.filter(function (location) {
return categories.some(function (category) {
return category.indexOf(location) >= 0;
});
});
var currentHeader = (matchingLocations.length && locationHeaders[matchingLocations[0]]
? locationHeaders[matchingLocations[0]]
: undefined);
if (currentHeader) {
document.body.style.setProperty('background-image', 'url("' + currentHeader + '")');
} else {
document.body.style.setProperty('background-image', '');
}
})();