MediaWiki:Common.js: Difference between revisions
From The Jadnix Codex
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* ============================================================ | /* ============================================================ | ||
JADNIX CODEX: CORE SCRIPTS | |||
============================================================ */ | ============================================================ */ | ||
$(function() { | $(function() { | ||
// 1. | // 1. DEFINE LOGOS | ||
const | const logos = { | ||
still: 'https://files.catbox.moe/0cmhjh.png', | |||
dealer: 'https://files.catbox.moe/73m0cp.png', | |||
skipper: 'https://files.catbox.moe/YOUR_SKIPPER_LOGO_URL_HERE.png' // <--- PASTE URL HERE | |||
}; | |||
// | // 2. HELPER FUNCTION: FORCE LOGO SWAP | ||
function | function swapLogo(url) { | ||
// Target | // Target standard MW logo | ||
$('.mw-logo-icon').attr('src', url); | $('.mw-logo-icon').attr('src', url); | ||
// | // Target Citizen Header logo | ||
$('.citizen- | $('.citizen-header__logo img').attr('src', url); | ||
// Target Footer logo | |||
$('.citizen-footer__logo img').attr('src', url); | |||
// Target Mobile/Drawer logo | |||
$('.citizen-drawer__logo img').attr('src', url); | |||
} | } | ||
// | // 3. APPLY THEMES & LOGOS | ||
// DEALERS | // DEALERS | ||
if ($('.faction-dealer').length | if ($('.faction-dealer').length) { | ||
$('body').addClass('theme-dealer'); | $('body').addClass('theme-dealer'); | ||
swapLogo(logos.dealer); | |||
} | } | ||
// SKIPPERS | |||
// SKIPPERS | else if ($('.faction-skipper').length) { | ||
else if ($('.faction-skipper').length | |||
$('body').addClass('theme-skipper'); | $('body').addClass('theme-skipper'); | ||
swapLogo(logos.skipper); | |||
} | } | ||
// THE STILL (Default/Home) | |||
// THE STILL ( | else if ($('.faction-still').length) { | ||
else if ($('.faction-still').length | |||
$('body').addClass('theme-still'); | $('body').addClass('theme-still'); | ||
swapLogo(logos.still); | |||
} | |||
// 4. CRDD CALCULATOR LOGIC (Keep the calculator working!) | |||
if ($('#crdd-interface').length) { | |||
$('.crdd-range').on('input', function() { | |||
$(this).next('.crdd-value-display').text($(this).val()); | |||
}); | |||
// (Re-paste the calculator logic function here if you lost it, | |||
// or just ensure the calculator part from the previous step is included) | |||
} | } | ||
}); | }); | ||
Revision as of 15:57, 9 February 2026
/* ============================================================
JADNIX CODEX: CORE SCRIPTS
============================================================ */
$(function() {
// 1. DEFINE LOGOS
const logos = {
still: 'https://files.catbox.moe/0cmhjh.png',
dealer: 'https://files.catbox.moe/73m0cp.png',
skipper: 'https://files.catbox.moe/YOUR_SKIPPER_LOGO_URL_HERE.png' // <--- PASTE URL HERE
};
// 2. HELPER FUNCTION: FORCE LOGO SWAP
function swapLogo(url) {
// Target standard MW logo
$('.mw-logo-icon').attr('src', url);
// Target Citizen Header logo
$('.citizen-header__logo img').attr('src', url);
// Target Footer logo
$('.citizen-footer__logo img').attr('src', url);
// Target Mobile/Drawer logo
$('.citizen-drawer__logo img').attr('src', url);
}
// 3. APPLY THEMES & LOGOS
// DEALERS
if ($('.faction-dealer').length) {
$('body').addClass('theme-dealer');
swapLogo(logos.dealer);
}
// SKIPPERS
else if ($('.faction-skipper').length) {
$('body').addClass('theme-skipper');
swapLogo(logos.skipper);
}
// THE STILL (Default/Home)
else if ($('.faction-still').length) {
$('body').addClass('theme-still');
swapLogo(logos.still);
}
// 4. CRDD CALCULATOR LOGIC (Keep the calculator working!)
if ($('#crdd-interface').length) {
$('.crdd-range').on('input', function() {
$(this).next('.crdd-value-display').text($(this).val());
});
// (Re-paste the calculator logic function here if you lost it,
// or just ensure the calculator part from the previous step is included)
}
});