MediaWiki:Common.js: Difference between revisions
Content deleted Content added
Sillyvizion (talk | contribs) mNo edit summary |
Sillyvizion (talk | contribs) m Fixing JS relying on URLs |
||
(9 intermediate revisions by the same user not shown) | |||
Line 17:
Vine_Staff:"#FF5877",
Flipside:"
Valk:"#
Dom:"#
};
Line 53:
if ($("h3:contains(Pronoun(s))").length > 0) {
pronouns = $("h3:contains(Pronoun(s))").next()[0].innerHTML.toLowerCase();
if (location.pathname.split('/')[
phighterName = pronounExclusions[location.pathname.split('/')[
$("h3:contains(Pronoun(s))").next()[0].title = 'While most demons are agender and use any pronouns, ' + phighterName + ' prefers ' + pronouns + ' pronouns!';
}
Line 67:
/* It is kind of bad practice because MW is IE11 compatible. Grr */
if (document.querySelectorAll("#ph-nav-dynamic-color").length > 0) {
const nodeList = document.querySelectorAll("#ph-nav-dynamic-color");
const dynamicColor = dynamicColorLibrary[location.pathname.split('/')[
nodeList.forEach(function (currentValue, currentIndex) {
nodeList[currentIndex].addEventListener("mouseover", function (e) {
if (dynamicColor === "Flipside") {▼
{▼
flipsideColors = [dynamicColorLibrary["Valk"], dynamicColorLibrary["Dom"]];▼
▲ if (dynamicColor == "Flipside") {
▲ flipsideColors = [dynamicColorLibrary[Valk], dynamicColorLibrary[Dom]];
▲ let boxShadowColor = Math.floor(Math.random()*flipsideColors.length);
nodeList[currentIndex].style.color = flipsideColors[boxShadowColor];
Line 83 ⟶ 81:
nodeList[currentIndex].style.transition = "all 300ms ease";
}
else {
nodeList[currentIndex].style.color = dynamicColor;
nodeList[currentIndex].style.boxShadow = "5px 5px 0px 0px " + dynamicColor;
nodeList[currentIndex].style.transition = "all 300ms ease";
});
|