MediaWiki:Vector-2022.js

    From Nonbinary Wiki
    Revision as of 18:09, 20 June 2023 by Ondo (talk | contribs)

    Note: After publishing, 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: Press Ctrl-F5.
    /* ---- RANDOM PRIDE FLAGS IN THE HEADER ---- */
    var picArr = {"neutrois": "https://static.miraheze.org/nonbinarywiki/c/c1/Neutrois.png",
    "nonbinary": "https://static.miraheze.org/nonbinarywiki/thumb/c/c0/Nonbinary.png/800px-Nonbinary.png",
    "transgender": "https://static.miraheze.org/nonbinarywiki/c/cd/Transgender.png",
    "genderqueer": "https://static.miraheze.org/nonbinarywiki/b/b5/Genderqueer.png",
    "genderfluid": "https://static.miraheze.org/nonbinarywiki/1/12/Genderfluid.png",
    "genderflux": "https://static.miraheze.org/nonbinarywiki/a/ae/Genderflux.png",
    "agender": "https://static.miraheze.org/nonbinarywiki/8/83/Agender.png",
    "androgyne": "https://static.miraheze.org/nonbinarywiki/7/73/Androgyne.png",
    "ambonec": "https://static.miraheze.org/nonbinarywiki/2/2e/Ambonec.png",
    "aporagender": "https://static.miraheze.org/nonbinarywiki/4/48/Aporagender.png",
    "bigender": "https://static.miraheze.org/nonbinarywiki/7/7c/Bigender_by_no-bucks-for-this-doe.png",
    "deminonbinary": "https://static.miraheze.org/nonbinarywiki/e/ee/Deminonbinary.png",
    "graygender": "https://static.miraheze.org/nonbinarywiki/a/a2/Graygender_flag.png",
    "intergender": "https://static.miraheze.org/nonbinarywiki/d/d3/Intergender.png",
    "multigender": "https://static.miraheze.org/nonbinarywiki/3/3b/Multigender.png",
    "maverique": "https://static.miraheze.org/nonbinarywiki/e/e2/Maverique.png",
    "polygender": "https://static.miraheze.org/nonbinarywiki/8/87/Polygender.png",
    "trigender": "https://static.miraheze.org/nonbinarywiki/4/40/Trigender.png",
    "demiboy": "https://static.miraheze.org/nonbinarywiki/5/5c/Demiboy.png",
    "demigirl": "https://static.miraheze.org/nonbinarywiki/8/80/Demigirl.png",
    "gender neutral": "https://static.miraheze.org/nonbinarywiki/f/f1/Gender_neutral_2_by_enbygsrd.png",
    "transmasculine": "https://static.miraheze.org/nonbinarywiki/8/8d/Transmasculine_pride_flag.png",
    "transfeminine": "https://static.miraheze.org/nonbinarywiki/b/b4/Transfeminine_pride_flag.png",
    "xenogender": "https://static.miraheze.org/nonbinarywiki/thumb/6/6f/Xenogender_without_symbol.png/800px-Xenogender_without_symbol.png",
    "firegender": "https://static.miraheze.org/nonbinarywiki/3/3a/Firegender-1.png",
    "genderfuck": "https://static.miraheze.org/nonbinarywiki/e/e1/Genderfuck_by_januceit.png",
    "genderfaun": "https://static.miraheze.org/nonbinarywiki/5/52/Genderfaunet.png",
    "genderfaer": "https://static.miraheze.org/nonbinarywiki/2/29/Genderfaer_1.png",
    "nonbinary man": "https://static.miraheze.org/nonbinarywiki/a/ac/Nonbinary_man_by_bulldykebutch.png",
    "nonbinary woman": "https://static.miraheze.org/nonbinarywiki/a/a8/Nonbinary_woman_by_bulldykebutch.png",
    "libramasculine": "https://static.miraheze.org/nonbinarywiki/f/fb/Libramasculine.png",
    "librafeminine": "https://static.miraheze.org/nonbinarywiki/a/a8/Librafeminine.png",
    "faesari": "https://static.miraheze.org/nonbinarywiki/7/70/Faesari.png"
    };
    
    var noarticle = ["libramasculine", "librafeminine", "faesari"];
    
    var myNumber = Math.floor((Math.random() * 33));
    var key = Object.keys(picArr)[myNumber];
    
    var div = document.getElementsByTagName("body")[0];
    div.style.backgroundImage="linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('" + picArr[key] + "')";
    
    if (noarticle.includes(key)) {
    	div.innerHTML += '<span class="nbweek-banner"><span class="nbweek-flag">Currently showing the ' + key + ' flag.</span></span>';
    } else {
    	div.innerHTML += '<span class="nbweek-banner"><span class="nbweek-flag">Currently showing the <a href="https://nonbinary.wiki/wiki/' + key + '">' + key + '</a> flag.</span></span>';	
    }