From 9bd7bd29961f3a0160612433b718f02de26a26ca Mon Sep 17 00:00:00 2001 From: abearxiong Date: Fri, 19 Dec 2025 13:10:57 +0800 Subject: [PATCH] feat: Update version to 0.0.5 and add fullscreen button to hotkeys app --- package.json | 6 +-- src/apps/hotkeys/components/icon.tsx | 58 ++++++++++++++++++++++++++++ src/apps/hotkeys/index.tsx | 8 +++- 3 files changed, 68 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f1f9b2d..7f32f28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/hot-api", - "version": "0.0.4", + "version": "0.0.5", "description": "", "main": "index.js", "basename": "/root/hot-api", @@ -8,8 +8,8 @@ "dev": "astro dev", "build": "astro build", "preview": "astro preview", - "pub": "envision deploy ./dist -k hot-api -v 0.0.4 -u -y y", - "pub:docs": "envision deploy ./dist -k hot-api-docs -v 0.0.4 -u", + "pub": "envision deploy ./dist -k hot-api -v 0.0.5 -u -y y", + "pub:docs": "envision deploy ./dist -k hot-api-docs -v 0.0.5 -u", "slide:dev": "slidev --open slides/index.md", "slide:build": "slidev build slides/index.md --base /root/hot-api-slide/", "slide:pub": "envision deploy ./slides/dist -k hot-api-slide -v 0.0.4 -u", diff --git a/src/apps/hotkeys/components/icon.tsx b/src/apps/hotkeys/components/icon.tsx index 0f95fc5..dd3c91e 100644 --- a/src/apps/hotkeys/components/icon.tsx +++ b/src/apps/hotkeys/components/icon.tsx @@ -1,3 +1,4 @@ +import { useState, useEffect } from 'react'; import { wrapBasename } from "@/modules/basename"; import { useStore } from "../store"; export const RefreshButton = () => { @@ -62,4 +63,61 @@ export const SettingsButton = () => { ); +}; + +export const FullscreenButton = () => { + const [isFullscreen, setIsFullscreen] = useState(false); + + const toggleFullscreen = () => { + if (!document.fullscreenElement) { + document.documentElement.requestFullscreen(); + setIsFullscreen(true); + } else { + document.exitFullscreen(); + setIsFullscreen(false); + } + }; + + useEffect(() => { + const handleFullscreenChange = () => { + setIsFullscreen(!!document.fullscreenElement); + }; + + document.addEventListener('fullscreenchange', handleFullscreenChange); + return () => { + document.removeEventListener('fullscreenchange', handleFullscreenChange); + }; + }, []); + + return ( + + ); }; \ No newline at end of file diff --git a/src/apps/hotkeys/index.tsx b/src/apps/hotkeys/index.tsx index bf08585..e6a8288 100644 --- a/src/apps/hotkeys/index.tsx +++ b/src/apps/hotkeys/index.tsx @@ -6,7 +6,7 @@ */ import { useEffect, useState } from 'react'; -import { SettingsButton, RefreshButton } from './components/icon'; +import { SettingsButton, RefreshButton, FullscreenButton } from './components/icon'; import { useStore, CardItem, StoreState } from './store'; import { useShallow } from 'zustand/shallow'; import { toast, ToastContainer } from 'react-toastify'; @@ -215,6 +215,11 @@ export const App = () => { {/* Overlay for premium look and contrast */}
+ {/* Fullscreen Button - Top Right */} +
+ +
+
{/* Header Toggle Button */}
{
)}
+