diff --git a/js/minigames/text-file/text-file-minigame.js b/js/minigames/text-file/text-file-minigame.js index 6287090..c41fe5e 100644 --- a/js/minigames/text-file/text-file-minigame.js +++ b/js/minigames/text-file/text-file-minigame.js @@ -144,13 +144,13 @@ export class TextFileMinigame extends MinigameScene { }); this.addEventListener(this.minimizeBtn, 'click', () => { - // For now, just show a message (could implement minimize functionality later) - this.showSuccess("Minimize functionality not implemented", false, 2000); + // Minimize by closing the minigame (common behavior for modal windows) + this.complete(false); }); this.addEventListener(this.maximizeBtn, 'click', () => { - // For now, just show a message (could implement maximize functionality later) - this.showSuccess("Maximize functionality not implemented", false, 2000); + // Maximize by toggling fullscreen mode + this.toggleFullscreen(); }); // Copy button @@ -262,6 +262,26 @@ export class TextFileMinigame extends MinigameScene { this.showSuccess("All text selected", false, 1000); } + toggleFullscreen() { + // Toggle fullscreen mode for the minigame container + if (!document.fullscreenElement) { + // Enter fullscreen + this.container.requestFullscreen().then(() => { + this.showSuccess("Entered fullscreen mode", false, 1500); + }).catch(err => { + console.error('Error attempting to enable fullscreen:', err); + this.showSuccess("Fullscreen not supported", false, 1500); + }); + } else { + // Exit fullscreen + document.exitFullscreen().then(() => { + this.showSuccess("Exited fullscreen mode", false, 1500); + }).catch(err => { + console.error('Error attempting to exit fullscreen:', err); + }); + } + } + addToNotebook() { // Check if there's content to add if (!this.textFileData.fileContent || this.textFileData.fileContent.trim() === '') { diff --git a/test-text-file-minigame.html b/test-text-file-minigame.html index 99e834c..087de35 100644 --- a/test-text-file-minigame.html +++ b/test-text-file-minigame.html @@ -95,7 +95,7 @@
• Text file minigame should open with Mac-style window decorations
• VT323 font should be used for all text content
• Black text on white background (clean, readable interface)
-• Window controls (close, minimize, maximize) should be functional
+• Window controls: close (red), minimize (yellow - closes window), maximize (green - toggles fullscreen)
• "Add to Notebook" button should work (if notes minigame is available)
• Copy and Select All buttons should function
• Escape key should close the minigame