mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
moved mode switcher on splash to below quickstart
This commit is contained in:
@ -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';
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
|
Reference in New Issue
Block a user