mNo edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
]; |
]; |
||
− | if ( |
+ | if (wgMainPageTitle=='Main Page') { |
$('body').css('background-image','url(' + opts[0] + ')'); |
$('body').css('background-image','url(' + opts[0] + ')'); |
||
$('body').css('background-size','120%'); //for the DS3 background to look better |
$('body').css('background-size','120%'); //for the DS3 background to look better |
Revision as of 01:09, 12 January 2021
// ================================================================
// JavaScript here will be loaded only for users on the Oasis theme
// ================================================================
// Background randomiser - imported from Dead Space Wiki
function randomBack () {
var opts = [
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/f/fe/RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130712164515%21RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130712164420%21RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130712164348%21RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130712164303%21RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130712164220%21RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130420095345%21RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130331143201%21RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130331143131%21RandomBG.jpg',
'https://images.wikia.nocookie.net/luckyfredenglishpedia/images/archive/f/fe/20130712152623%21RandomBG.jpg'
];
if (wgMainPageTitle=='Main Page') {
$('body').css('background-image','url(' + opts[0] + ')');
$('body').css('background-size','120%'); //for the DS3 background to look better
}
else
$('body').css('background-image','url(' + opts[Math.floor((opts.length-1)*Math.random()+1)] + ')'); //remove +1 to include first element of the array
}
randomBack();