Added random splash images

Also added a rough class scheme of the editor for future use.
This commit is contained in:
unsettledgames
2021-04-27 11:00:27 +02:00
parent d9ae5dd21b
commit 079ea38e63
19 changed files with 72 additions and 4 deletions

25
js/_splashPage.js Normal file
View File

@@ -0,0 +1,25 @@
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))];
console.log ("Path: " + '/pixel-editor/' + chosenImage.path + '.png');
coverImage.style.backgroundImage = 'url("/pixel-editor/' + chosenImage.path + '.png")';
authorLink.setAttribute('href', chosenImage.link);
authorLink.innerHTML = 'Art by ' + chosenImage.author;

View File

@@ -53,6 +53,7 @@
//=include _resizeSprite.js
//=include _colorPicker.js
//=include _paletteBlock.js
//=include _splashPage.js
/**load file**/
//=include _loadImage.js