Skip to content

Commit d6a8625

Browse files
Polish Cmd+K palette
1 parent 1b8da79 commit d6a8625

1 file changed

Lines changed: 40 additions & 8 deletions

File tree

assets/js/commandPalette.js

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
layout: null
3+
---
4+
15
// Command Palette Configuration
26
// Enhanced setup with all pages and theme switching
37

@@ -70,7 +74,7 @@ document.addEventListener('DOMContentLoaded', function() {
7074
console.log('Synced ninja-keys theme to:', currentTheme);
7175
}
7276

73-
// Fix ninja-keys blur, scrollbar, and align colors with site theme
77+
// Fix ninja-keys blur, scrollbar, and hide "move to parent" footer element
7478
function fixBlurIssue() {
7579
// Wait for ninja-keys to be fully loaded
7680
setTimeout(() => {
@@ -118,6 +122,11 @@ document.addEventListener('DOMContentLoaded', function() {
118122
width: 0 !important;
119123
height: 0 !important;
120124
}
125+
126+
/* Hide the last footer element (move to parent) */
127+
.modal-footer .help:last-child {
128+
display: none !important;
129+
}
121130
`;
122131
style.appendChild(document.createTextNode(css));
123132
ninjaKeys.shadowRoot.appendChild(style);
@@ -243,10 +252,34 @@ document.addEventListener('DOMContentLoaded', function() {
243252
handler: () => window.location.href = '/uses'
244253
},
245254
{
246-
id: 'inventarium',
247-
title: 'Inventarium',
255+
id: 'nmk',
256+
title: 'Nmk',
257+
section: 'Links',
258+
handler: () => window.open('{{ site.social.nmk }}', '_blank')
259+
},
260+
{
261+
id: 'github',
262+
title: 'GitHub',
263+
section: 'Links',
264+
handler: () => window.open('{{ site.social.github }}', '_blank')
265+
},
266+
{
267+
id: 'linkedin',
268+
title: 'LinkedIn',
269+
section: 'Links',
270+
handler: () => window.open('{{ site.social.linkedin }}', '_blank')
271+
},
272+
{
273+
id: 'email',
274+
title: 'Email',
248275
section: 'Links',
249-
handler: () => window.location.href = '/inventarium'
276+
handler: () => window.location.href = 'mailto:{{ site.social.email }}'
277+
},
278+
{
279+
id: 'hashart',
280+
title: 'Understand hash art',
281+
section: 'Actions',
282+
handler: () => window.location.href = '/hashart'
250283
},
251284
{
252285
id: 'random',
@@ -320,7 +353,7 @@ document.addEventListener('DOMContentLoaded', function() {
320353
const easterEggActions = [
321354
{
322355
id: 'celebrate',
323-
title: 'Celebrate! 🎉',
356+
title: 'Celebrate a bit!',
324357
section: 'Actions',
325358
handler: () => {
326359
// Trigger confetti
@@ -349,7 +382,7 @@ document.addEventListener('DOMContentLoaded', function() {
349382
syncTheme();
350383
}, 100);
351384
}
352-
}];
385+
}, ...easterEggActions];
353386

354387
ninjaKeys.data = updatedActions;
355388
}
@@ -361,9 +394,8 @@ document.addEventListener('DOMContentLoaded', function() {
361394
ninjaKeys.data = allActions;
362395

363396
// Configure ninja-keys behavior
364-
ninjaKeys.placeholder = 'Do anything...';
397+
ninjaKeys.placeholder = 'Go and explore...';
365398
ninjaKeys.hideBreadcrumbs = true;
366-
ninjaKeys.goBackHotkey = false;
367399

368400
// Apply blur fix
369401
fixBlurIssue();

0 commit comments

Comments
 (0)