I've seen Wikis that have wordmarks that change to a random one when the page is reloaded (the EC wiki, for example); could someone explain how that works/how I could do that, please?
I've seen Wikis that have wordmarks that change to a random one when the page is reloaded (the EC wiki, for example); could someone explain how that works/how I could do that, please?
They used JavaScript to randomize their wordmark logo:
$(function() {
var images = [
'https://vignette.wikia.nocookie.net/theevilliouschronicles/images/b/b5/BannerLust4.png/revision/latest?cb=20170219070338',
'https://vignette.wikia.nocookie.net/theevilliouschronicles/images/b/b1/BannerGluttony4.png/revision/latest?cb=20170219070659',
'https://vignette.wikia.nocookie.net/theevilliouschronicles/images/0/0b/BannerPride4.png/revision/latest?cb=20170219070553',
'https://vignette.wikia.nocookie.net/theevilliouschronicles/images/1/13/BannerSloth4.png/revision/latest?cb=20170219070340',
'https://vignette.wikia.nocookie.net/theevilliouschronicles/images/5/51/BannerEnvy4.png/revision/latest?cb=20170219070552',
'https://vignette.wikia.nocookie.net/theevilliouschronicles/images/6/64/BannerGreed4.png/revision/latest?cb=20170312231002',
'https://vignette.wikia.nocookie.net/theevilliouschronicles/images/6/67/BannerWrath4.png/revision/latest?cb=20170312231025',
];
$('.wds-community-header__wordmark img').attr('src', images[Math.floor(Math.random() * images.length)]);
});
Someone actually asked that question once: https://community.fandom.com/f/p/2328247010328579015
In short, the answer is wiki JS. As you can see the wiki you linked has a script:
https://theevilliouschronicles.fandom.com/wiki/MediaWiki:Wikia.js
I'd suggest to check the already answered post for details ^^
EDIT: Whoops got sniped
Alright! Thank you both!
What do you think?