MediaWiki:Vector-2022.js: Difference between revisions

    From Nonbinary Wiki
    No edit summary
    (update logo flags with self-hosted version)
     
    (26 intermediate revisions by the same user not shown)
    Line 1: Line 1:
    var picArr = ["https://static.miraheze.org/nonbinarywiki/c/c1/Neutrois.png", "https://static.miraheze.org/nonbinarywiki/thumb/c/c0/Nonbinary.png/800px-Nonbinary.png", "https://static.miraheze.org/nonbinarywiki/c/cd/Transgender.png", "https://static.miraheze.org/nonbinarywiki/b/b5/Genderqueer.png", "https://static.miraheze.org/nonbinarywiki/1/12/Genderfluid.png", "https://static.miraheze.org/nonbinarywiki/a/ae/Genderflux.png", "https://static.miraheze.org/nonbinarywiki/8/83/Agender.png", "https://static.miraheze.org/nonbinarywiki/7/73/Androgyne.png", "https://static.miraheze.org/nonbinarywiki/2/2e/Ambonec.png", "https://static.miraheze.org/nonbinarywiki/4/48/Aporagender.png", "https://static.miraheze.org/nonbinarywiki/7/7c/Bigender_by_no-bucks-for-this-doe.png", "https://static.miraheze.org/nonbinarywiki/e/ee/Deminonbinary.png", "https://static.miraheze.org/nonbinarywiki/a/a2/Graygender_flag.png", "https://nonbinary.wiki/wiki/File:Intergender.png", "https://static.miraheze.org/nonbinarywiki/3/3b/Multigender.png", "https://static.miraheze.org/nonbinarywiki/e/e2/Maverique.png", "https://static.miraheze.org/nonbinarywiki/8/87/Polygender.png", "https://static.miraheze.org/nonbinarywiki/4/40/Trigender.png", "https://static.miraheze.org/nonbinarywiki/5/5c/Demiboy.png", "https://static.miraheze.org/nonbinarywiki/8/80/Demigirl.png", "https://static.miraheze.org/nonbinarywiki/f/f1/Gender_neutral_2_by_enbygsrd.png", "https://static.miraheze.org/nonbinarywiki/8/8d/Transmasculine_pride_flag.png", "https://static.miraheze.org/nonbinarywiki/b/b4/Transfeminine_pride_flag.png"];
    /* ---- RANDOM PRIDE FLAGS IN THE LOGO ---- */
    var picArr = {"neutrois": "https://nonbinary.wiki/images/thumb/c/c1/Neutrois.png/320px-Neutrois.png",
    "nonbinary": "https://nonbinary.wiki/images/thumb/c/c0/Nonbinary.png/320px-Nonbinary.png",
    "transgender": "https://nonbinary.wiki/images/thumb/c/cd/Transgender.png/320px-Transgender.png",
    "genderqueer": "https://nonbinary.wiki/images/thumb/b/b5/Genderqueer.png/320px-Genderqueer.png",
    "genderfluid": "https://nonbinary.wiki/images/thumb/1/12/Genderfluid.png/320px-Genderfluid.png",
    "genderflux": "https://nonbinary.wiki/images/thumb/a/ae/Genderflux.png/320px-Genderflux.png",
    "agender": "https://nonbinary.wiki/images/thumb/8/83/Agender.png/320px-Agender.png",
    "androgyne": "https://nonbinary.wiki/images/thumb/7/73/Androgyne.png/320px-Androgyne.png",
    "ambonec": "https://nonbinary.wiki/images/thumb/2/2e/Ambonec.png/320px-Ambonec.png",
    "aporagender": "https://nonbinary.wiki/images/thumb/4/48/Aporagender.png/320px-Aporagender.png",
    "bigender": "https://nonbinary.wiki/images/thumb/7/7c/Bigender_by_no-bucks-for-this-doe.png/320px-Bigender_by_no-bucks-for-this-doe.png",
    "deminonbinary": "https://nonbinary.wiki/images/thumb/e/ee/Deminonbinary.png/320px-Deminonbinary.png",
    "graygender": "https://nonbinary.wiki/images/a/a2/Graygender_flag.png",
    "intergender": "https://nonbinary.wiki/images/thumb/d/d3/Intergender.png/320px-Intergender.png",
    "multigender": "https://nonbinary.wiki/images/thumb/3/3b/Multigender.png/320px-Multigender.png",
    "maverique": "https://nonbinary.wiki/images/thumb/e/e2/Maverique.png/320px-Maverique.png",
    "polygender": "https://nonbinary.wiki/images/thumb/8/87/Polygender.png/320px-Polygender.png",
    "trigender": "https://nonbinary.wiki/images/thumb/4/40/Trigender.png/320px-Trigender.png",
    "demiboy": "https://nonbinary.wiki/images/thumb/5/5c/Demiboy.png/320px-Demiboy.png",
    "demigirl": "https://nonbinary.wiki/images/thumb/8/80/Demigirl.png/320px-Demigirl.png",
    "gender neutral": "https://nonbinary.wiki/images/thumb/f/f1/Gender_neutral_2_by_enbygsrd.png/320px-Gender_neutral_2_by_enbygsrd.png",
    "transmasculine": "https://nonbinary.wiki/images/thumb/8/8d/Transmasculine_pride_flag.png/320px-Transmasculine_pride_flag.png",
    "transfeminine": "https://nonbinary.wiki/images/thumb/b/b4/Transfeminine_pride_flag.png/320px-Transfeminine_pride_flag.png",
    "xenogender": "https://nonbinary.wiki/images/thumb/7/7b/Xenogender.png/320px-Xenogender.png",
    "firegender": "https://nonbinary.wiki/images/3/3a/Firegender-1.png",
    "genderfuck": "https://nonbinary.wiki/images/thumb/e/e1/Genderfuck_by_januceit.png/320px-Genderfuck_by_januceit.png",
    "genderfaun": "https://nonbinary.wiki/images/5/52/Genderfaunet.png",
    "genderfaer": "https://nonbinary.wiki/images/2/29/Genderfaer_1.png",
    "nonbinary man": "https://nonbinary.wiki/images/thumb/a/ac/Nonbinary_man_by_bulldykebutch.png/320px-Nonbinary_man_by_bulldykebutch.png",
    "nonbinary woman": "https://nonbinary.wiki/images/thumb/a/a8/Nonbinary_woman_by_bulldykebutch.png/320px-Nonbinary_woman_by_bulldykebutch.png",
    "libramasculine": "https://nonbinary.wiki/images/thumb/f/fb/Libramasculine.png/320px-Libramasculine.png",
    "librafeminine": "https://nonbinary.wiki/images/thumb/a/a8/Librafeminine.png/320px-Librafeminine.png",
    "faesari": "https://nonbinary.wiki/images/thumb/7/70/Faesari.png/320px-Faesari.png"
    };


    var myNumber = Math.floor((Math.random() * 23));
    var myNumber = Math.floor((Math.random() * 33));
    var key = Object.keys(picArr)[myNumber];


    var div = document.getElementById("mw-head");
    document.getElementsByClassName("mw-logo-icon")[0].src=picArr[key];
    div.style.backgroundImage="linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)), url('" + picArr[myNumber] + "')";
    document.getElementsByClassName("mw-logo")[0].title="Currently showing the " + key + " flag!";
    div.innerHTML += '<span class="nbweek-banner">Happy Nonbinary Awareness Week!</span>';

    Latest revision as of 23:19, 23 June 2023

    /* ---- RANDOM PRIDE FLAGS IN THE LOGO ---- */
    var picArr = {"neutrois": "https://nonbinary.wiki/images/thumb/c/c1/Neutrois.png/320px-Neutrois.png",
    "nonbinary": "https://nonbinary.wiki/images/thumb/c/c0/Nonbinary.png/320px-Nonbinary.png",
    "transgender": "https://nonbinary.wiki/images/thumb/c/cd/Transgender.png/320px-Transgender.png",
    "genderqueer": "https://nonbinary.wiki/images/thumb/b/b5/Genderqueer.png/320px-Genderqueer.png",
    "genderfluid": "https://nonbinary.wiki/images/thumb/1/12/Genderfluid.png/320px-Genderfluid.png",
    "genderflux": "https://nonbinary.wiki/images/thumb/a/ae/Genderflux.png/320px-Genderflux.png",
    "agender": "https://nonbinary.wiki/images/thumb/8/83/Agender.png/320px-Agender.png",
    "androgyne": "https://nonbinary.wiki/images/thumb/7/73/Androgyne.png/320px-Androgyne.png",
    "ambonec": "https://nonbinary.wiki/images/thumb/2/2e/Ambonec.png/320px-Ambonec.png",
    "aporagender": "https://nonbinary.wiki/images/thumb/4/48/Aporagender.png/320px-Aporagender.png",
    "bigender": "https://nonbinary.wiki/images/thumb/7/7c/Bigender_by_no-bucks-for-this-doe.png/320px-Bigender_by_no-bucks-for-this-doe.png",
    "deminonbinary": "https://nonbinary.wiki/images/thumb/e/ee/Deminonbinary.png/320px-Deminonbinary.png",
    "graygender": "https://nonbinary.wiki/images/a/a2/Graygender_flag.png",
    "intergender": "https://nonbinary.wiki/images/thumb/d/d3/Intergender.png/320px-Intergender.png",
    "multigender": "https://nonbinary.wiki/images/thumb/3/3b/Multigender.png/320px-Multigender.png",
    "maverique": "https://nonbinary.wiki/images/thumb/e/e2/Maverique.png/320px-Maverique.png",
    "polygender": "https://nonbinary.wiki/images/thumb/8/87/Polygender.png/320px-Polygender.png",
    "trigender": "https://nonbinary.wiki/images/thumb/4/40/Trigender.png/320px-Trigender.png",
    "demiboy": "https://nonbinary.wiki/images/thumb/5/5c/Demiboy.png/320px-Demiboy.png",
    "demigirl": "https://nonbinary.wiki/images/thumb/8/80/Demigirl.png/320px-Demigirl.png",
    "gender neutral": "https://nonbinary.wiki/images/thumb/f/f1/Gender_neutral_2_by_enbygsrd.png/320px-Gender_neutral_2_by_enbygsrd.png",
    "transmasculine": "https://nonbinary.wiki/images/thumb/8/8d/Transmasculine_pride_flag.png/320px-Transmasculine_pride_flag.png",
    "transfeminine": "https://nonbinary.wiki/images/thumb/b/b4/Transfeminine_pride_flag.png/320px-Transfeminine_pride_flag.png",
    "xenogender": "https://nonbinary.wiki/images/thumb/7/7b/Xenogender.png/320px-Xenogender.png",
    "firegender": "https://nonbinary.wiki/images/3/3a/Firegender-1.png",
    "genderfuck": "https://nonbinary.wiki/images/thumb/e/e1/Genderfuck_by_januceit.png/320px-Genderfuck_by_januceit.png",
    "genderfaun": "https://nonbinary.wiki/images/5/52/Genderfaunet.png",
    "genderfaer": "https://nonbinary.wiki/images/2/29/Genderfaer_1.png",
    "nonbinary man": "https://nonbinary.wiki/images/thumb/a/ac/Nonbinary_man_by_bulldykebutch.png/320px-Nonbinary_man_by_bulldykebutch.png",
    "nonbinary woman": "https://nonbinary.wiki/images/thumb/a/a8/Nonbinary_woman_by_bulldykebutch.png/320px-Nonbinary_woman_by_bulldykebutch.png",
    "libramasculine": "https://nonbinary.wiki/images/thumb/f/fb/Libramasculine.png/320px-Libramasculine.png",
    "librafeminine": "https://nonbinary.wiki/images/thumb/a/a8/Librafeminine.png/320px-Librafeminine.png",
    "faesari": "https://nonbinary.wiki/images/thumb/7/70/Faesari.png/320px-Faesari.png"
    };
    
    var myNumber = Math.floor((Math.random() * 33));
    var key = Object.keys(picArr)[myNumber];
    
    document.getElementsByClassName("mw-logo-icon")[0].src=picArr[key];
    document.getElementsByClassName("mw-logo")[0].title="Currently showing the " + key + " flag!";