mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
23 lines
1.0 KiB
JavaScript
23 lines
1.0 KiB
JavaScript
|
function SplashCoverImage(path, author, link) {
|
||
|
this.path = path;
|
||
|
this.author = author;
|
||
|
this.link = link;
|
||
|
}
|
||
|
|
||
|
let images = [
|
||
|
new SplashCoverImage('Rayquaza', 'Unsettled', 'https://twitter.com/_unsettled_'),
|
||
|
new SplashCoverImage('Mountains', 'Skeddles', 'https://twitter.com/skeddles'),
|
||
|
new SplashCoverImage('Sweetie', 'GrafxKid', 'https://grafxkid.tumblr.com/'),
|
||
|
new SplashCoverImage('Glacier', 'WindfallApples', 'https://twitter.com/windfallapples'),
|
||
|
new SplashCoverImage('Polyphorge1', 'Polyphorge', 'https://lospec.com/poly-phorge'),
|
||
|
new SplashCoverImage('Fusionnist', 'Fusionnist', 'https://twitter.com/fusionnist')
|
||
|
];
|
||
|
|
||
|
|
||
|
let coverImage = document.getElementById('editor-logo');
|
||
|
let authorLink = coverImage.getElementsByTagName('a')[0];
|
||
|
let chosenImage = images[Math.round(Math.random() * (images.length - 1))];
|
||
|
|
||
|
coverImage.style.backgroundImage = 'url("/pixel-editor/' + chosenImage.path + '.png")';
|
||
|
authorLink.setAttribute('href', chosenImage.link);
|
||
|
authorLink.innerHTML = 'Art by ' + chosenImage.author;
|