Skip to content

Commit 3d54975

Browse files
committed
Enhance PyodideRunner fullscreen functionality: Updated the fullscreen toggle to automatically display the code editor when entering fullscreen mode. Improved user experience by ensuring the code editor is visible by default and auto-resizes to fit content. Additionally, added programming languages to skills list and refined styles in index.astro for better layout consistency.
1 parent 461554a commit 3d54975

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/components/PyodideRunner.astro

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ const { code, title = "Python Code" } = Astro.props;
213213
button.addEventListener('click', function() {
214214
const btn = this as HTMLButtonElement;
215215
const runner = btn.closest('.pyodide-runner') as HTMLElement;
216+
const codeWrapper = runner?.querySelector('.code-editor-wrapper') as HTMLElement;
217+
const toggleBtn = runner?.querySelector('.toggle-code-btn') as HTMLButtonElement;
218+
const textarea = runner?.querySelector('.python-code') as HTMLTextAreaElement;
216219

217220
if (!runner) return;
218221

@@ -221,9 +224,21 @@ const { code, title = "Python Code" } = Astro.props;
221224
runner.classList.remove('fullscreen');
222225
document.body.style.overflow = '';
223226
} else {
224-
// Enter fullscreen
227+
// Enter fullscreen - show code by default
225228
runner.classList.add('fullscreen');
226229
document.body.style.overflow = 'hidden';
230+
231+
// Show code editor if it's hidden
232+
if (codeWrapper && codeWrapper.style.display === 'none') {
233+
codeWrapper.style.display = 'flex';
234+
if (toggleBtn) {
235+
toggleBtn.textContent = 'Hide Code';
236+
}
237+
// Auto-resize to fit content
238+
if (textarea) {
239+
autoResizeTextarea(textarea);
240+
}
241+
}
227242
}
228243
});
229244
});

src/pages/index.astro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import BaseLayout from '../layouts/BaseLayout.astro';
7474
<li>SBC prototyping</li>
7575
<li>Software development and reverse engineering</li>
7676
<li>Frontend and backend development</li>
77+
<li>Programming languages: Assembly (x86-64), C, C++, Python</li>
7778
</ul>
7879
</li>
7980
<li>
@@ -82,6 +83,7 @@ import BaseLayout from '../layouts/BaseLayout.astro';
8283
<li>Windows/Linux</li>
8384
<li>Docker (containerization)</li>
8485
<li>Documentation (LaTeX/Markdown/Typst)</li>
86+
<li>Obsidian (knowledge management)</li>
8587
</ul>
8688
</li>
8789
<li>
@@ -422,6 +424,8 @@ import BaseLayout from '../layouts/BaseLayout.astro';
422424
animation-fill-mode: forwards;
423425
word-spacing: -0.2em;
424426
letter-spacing: -0.02em;
427+
border-bottom: none;
428+
padding-bottom: 0;
425429
}
426430

427431
.h1-n-wrapper {

0 commit comments

Comments
 (0)