UI improvements...

added icons from original doc (they still need minifying).
removed highlight demo.
added shift-toggle for opacity.
added escape to end editing.
This commit is contained in:
Rich Boakes
2023-09-20 17:06:51 +01:00
parent 2dab4a6377
commit dc258bbd0d
14 changed files with 201 additions and 11 deletions

18
script.js Normal file
View File

@@ -0,0 +1,18 @@
const gridItems = document.querySelectorAll('.grid-item');
function toggleItem(event) {
if (event.metaKey || event.shiftKey) {
const toggleThis = event.target.closest('.grid-item');
toggleThis?.classList.toggle('lo');
}
}
for (const item of gridItems) {
item.addEventListener('click', toggleItem);
}
document.addEventListener('keydown', event => {
if (event.key === 'Escape') {
document.activeElement.blur();
}
});