mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 16:40:41 +00:00
feat(gui): add keyboard shortcuts guide dialog (#2278)
* feat(gui): add keyboard shortcuts guide dialog * feat(gui): add dedicated keyboard shortcuts dialog
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import UIWindow from './UIWindow.js';
|
||||
|
||||
export async function openKeyboardShortcuts () {
|
||||
const shortcuts = [
|
||||
{ key: 'Ctrl + ,', action: 'Open Settings' },
|
||||
{ key: 'Ctrl + K', action: 'Open Search' },
|
||||
{ key: 'Ctrl + B', action: 'Toggle Sidebar' },
|
||||
];
|
||||
|
||||
const container = document.createElement('div');
|
||||
container.style.padding = '20px';
|
||||
|
||||
const title = document.createElement('h2');
|
||||
title.innerText = 'Keyboard Shortcuts';
|
||||
|
||||
const list = document.createElement('ul');
|
||||
shortcuts.forEach((s) => {
|
||||
const li = document.createElement('li');
|
||||
li.innerText = `${s.key} — ${s.action}`;
|
||||
list.appendChild(li);
|
||||
});
|
||||
|
||||
container.appendChild(title);
|
||||
container.appendChild(list);
|
||||
|
||||
await UIWindow({
|
||||
title: 'Keyboard Shortcuts',
|
||||
body_content: container,
|
||||
width: 500,
|
||||
height: 400,
|
||||
init_center: true,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user