Skip to content

Commit

Permalink
Add fullscreen icon on the front mage
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaroran committed Mar 14, 2024
1 parent a8a8347 commit aad0722
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/lib/Others/GithubStars.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { MailIcon, WalletIcon } from "lucide-svelte";
import { isTauri, openURL } from "src/ts/storage/globalApi";
import { MailIcon, MaximizeIcon, WalletIcon } from "lucide-svelte";
import { isTauri, openURL, toggleFullscreen } from "src/ts/storage/globalApi";
</script>
<svelte:head>
Expand All @@ -27,4 +27,11 @@
}}>
<MailIcon size={24} />
</button>
{#if !isTauri}
<button class="text-textcolor" on:click={() => {
toggleFullscreen()
}}>
<MaximizeIcon size={24} />
</button>
{/if}
</div>
4 changes: 4 additions & 0 deletions src/ts/storage/globalApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1468,4 +1468,8 @@ export async function fetchNative(url:string, arg:{

export function textifyReadableStream(stream:ReadableStream<Uint8Array>){
return new Response(stream).text()
}

export function toggleFullscreen(){
document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen()
}

0 comments on commit aad0722

Please sign in to comment.