mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Started tool tutorials
This commit is contained in:
17
js/Tool.js
17
js/Tool.js
@ -24,6 +24,7 @@ class Tool {
|
||||
biggerButton = undefined;
|
||||
smallerButton = undefined;
|
||||
brushPreview = document.getElementById("brush-preview");
|
||||
toolTutorial = document.getElementById("tool-tutorial");
|
||||
|
||||
constructor (name, options) {
|
||||
this.name = name;
|
||||
@ -34,6 +35,22 @@ class Tool {
|
||||
this.smallerButton = document.getElementById(name + "-smaller-button");
|
||||
}
|
||||
|
||||
resetTutorial() {
|
||||
this.toolTutorial.innerHTML = "<ul></ul>";
|
||||
}
|
||||
addTutorialKey(key, text) {
|
||||
this.toolTutorial.children[0].append(
|
||||
'<li><span class="keyboard-key">' + key + '</span> ' + text + '</li>');
|
||||
}
|
||||
addTutorialText(key, text) {
|
||||
this.toolTutorial.children[0].append(
|
||||
'<li>' + key + ': ' + text + '</li>');
|
||||
}
|
||||
addTutorialImg(imgPath) {
|
||||
this.toolTutorial.children[0].append(
|
||||
'<img src="' + imgPath + '"/>');
|
||||
}
|
||||
|
||||
onSelect() {
|
||||
if (this.mainButton != undefined)
|
||||
this.mainButton.parentElement.classList.add("selected");
|
||||
|
Reference in New Issue
Block a user