moved mode switcher on splash to below quickstart

This commit is contained in:
skeddles
2021-07-06 20:37:47 -04:00
parent 512981be63
commit 80e33b4ff1
7 changed files with 58 additions and 79 deletions

View File

@ -8,29 +8,14 @@ let modes = {
}
let infoBox = document.getElementById('editor-mode-info');
let currentSplashButton = document.getElementById("sp-mode-palette").children[0].children[1];
function splashMode(mouseEvent, mode) {
if (currentSplashButton == undefined) {
currentSplashButton = mouseEvent.target.parentElement;
}
if (mode !== pixelEditorMode) {
// Remove selected class to old button
currentSplashButton.classList.remove("sp-interface-selected");
// Add selected class to new button
mouseEvent.target.parentElement.classList.add("sp-interface-selected");
// Setting the new mode
pixelEditorMode = mode;
}
// Setting the new selected button
currentSplashButton = mouseEvent.target.parentElement;
}
on('click', 'switch-editor-mode-splash', function (e) {
console.log('switching mode')
switchMode();
});
function switchMode(mustConfirm = true) {
console.log('switching mode', 'current:',pixelEditorMode)
//switch to advanced mode
if (pixelEditorMode == 'Basic') {
// Switch to advanced ez pez lemon squez
@ -41,6 +26,9 @@ function switchMode(mustConfirm = true) {
// Hide the palette menu
document.getElementById('colors-menu').style.right = '200px'
//change splash text
document.querySelector('#sp-quickstart-container .mode-switcher').classList.add('advanced-mode');
pixelEditorMode = 'Advanced';
}
//switch to basic mode
@ -71,6 +59,10 @@ function switchMode(mustConfirm = true) {
// Move the palette menu
document.getElementById('colors-menu').style.right = '0px';
//change splash text
document.querySelector('#sp-quickstart-container .mode-switcher').classList.remove('advanced-mode');
pixelEditorMode = 'Basic';
}
}

View File

@ -5,7 +5,7 @@ var dragging = false;
var lastMouseClickPos = [0,0];
var dialogueOpen = true;
var documentCreated = false;
var pixelEditorMode = "Advanced";
var pixelEditorMode = "Basic";
//common elements
var brushPreview = document.getElementById("brush-preview");