-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
966fb98
commit fe91736
Showing
8 changed files
with
134 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script lang="ts"> | ||
</script> | ||
|
||
<h1>Graphics</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script lang="ts"> | ||
</script> | ||
|
||
<h1>Logging</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script lang="ts"> | ||
</script> | ||
|
||
<h1>System</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,7 @@ | ||
<script lang="ts"> | ||
import Header from "$components/Header.svelte"; | ||
import Footer from "$components/Footer.svelte"; | ||
import { Game } from "$models/Game"; | ||
import GameLibrary from "$components/GameLibrary.svelte"; | ||
let sonicGame = new Game("Sonic Mania", "./icon0.png", "SEGA", "1.03", "CUSA07023", 197927919); | ||
let weAreDoomedGame = new Game("WE ARE DOOMED", "./icon1.png", "Vertex Pop Inc.", "1.00", "CUSA02394", 197927919); | ||
let games = [sonicGame, weAreDoomedGame, sonicGame, sonicGame, sonicGame, sonicGame, sonicGame, sonicGame, sonicGame]; | ||
let filteredGames: Game[] = []; | ||
let searchTerm = ""; | ||
let gameCount = 0; | ||
const searchGames = () => { | ||
filteredGames = games.filter(game => { | ||
let gameTitle = game.name.toLowerCase(); | ||
return gameTitle.includes(searchTerm.toLowerCase()) | ||
}); | ||
gameCount = filteredGames.length; | ||
} | ||
searchGames() | ||
</script> | ||
|
||
<div class="min-h-full h-full flex flex-col"> | ||
<Header bind:searchTerm on:input={searchGames} /> | ||
<main class="flex-grow overflow-y-scroll" id="content"> | ||
<GameLibrary games={filteredGames} /> | ||
<slot /> | ||
</main> | ||
<Footer bind:gameCount /> | ||
</div> | ||
<main class="flex flex-col h-full max-h-full" id="content"> | ||
<slot /> | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,33 @@ | ||
<script lang="ts"> | ||
import { invoke } from "@tauri-apps/api/core"; | ||
import Header from "$components/Header.svelte"; | ||
import Footer from "$components/Footer.svelte"; | ||
import { Game } from "$models/Game"; | ||
import GameLibrary from "$components/GameLibrary.svelte"; | ||
let name = ""; | ||
let greetMsg = ""; | ||
let sonicGame = new Game("Sonic Mania", "./icon0.png", "SEGA", "1.03", "CUSA07023", 197927919); | ||
let weAreDoomedGame = new Game("WE ARE DOOMED", "./icon1.png", "Vertex Pop Inc.", "1.00", "CUSA02394", 197927919); | ||
let games = [sonicGame, weAreDoomedGame, sonicGame, sonicGame, sonicGame, sonicGame, sonicGame, sonicGame, sonicGame]; | ||
let filteredGames: Game[] = []; | ||
async function greet() { | ||
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command | ||
greetMsg = await invoke("greet", { name }); | ||
} | ||
let searchTerm = ""; | ||
let gameCount = 0; | ||
const searchGames = () => { | ||
filteredGames = games.filter(game => { | ||
let gameTitle = game.name.toLowerCase(); | ||
return gameTitle.includes(searchTerm.toLowerCase()) | ||
}); | ||
gameCount = filteredGames.length; | ||
} | ||
searchGames() | ||
</script> | ||
|
||
<div class="min-h-full h-full flex flex-col"> | ||
<Header bind:searchTerm on:input={searchGames} /> | ||
<div class="flex-grow overflow-y-scroll"> | ||
<GameLibrary games={filteredGames} /> | ||
</div> | ||
<Footer bind:gameCount /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<script lang="ts"> | ||
import type { IconSource } from "@steeze-ui/heroicons"; | ||
import type { ComponentType } from "svelte"; | ||
import { Icon, CpuChip, Sparkles, DocumentText } from "svelte-hero-icons"; | ||
import System from "$components/settings/System.svelte"; | ||
import Graphics from "$components/settings/Graphics.svelte"; | ||
import Logging from "$components/settings/Logging.svelte"; | ||
class Tab { | ||
icon: IconSource; | ||
label: string; | ||
content: ComponentType; | ||
constructor(icon: IconSource, label: string, content: ComponentType) | ||
{ | ||
this.icon = icon; | ||
this.label = label; | ||
this.content = content; | ||
} | ||
} | ||
let tabs: Tab[] = [ | ||
{ | ||
icon: CpuChip, | ||
label: "System", | ||
content: System | ||
}, | ||
{ | ||
icon: Sparkles, | ||
label: "Graphics", | ||
content: Graphics | ||
}, | ||
{ | ||
icon: DocumentText, | ||
label: "Logging", | ||
content: Logging | ||
}, | ||
]; | ||
let activeTab = tabs[0]; | ||
function setActiveTab(tab: Tab) { | ||
activeTab = tab; | ||
} | ||
</script> | ||
|
||
<div class="bg-neutral-900 flex h-full p-2 space-x-2"> | ||
<ul class="flex-col space-y-2"> | ||
{#each tabs as tab} | ||
<li> | ||
<button on:click={() => {setActiveTab(tab)}} class="{activeTab == tab ? "ring-1" : ""} inline-flex items-center p-2 w-full rounded-lg border border-neutral-600 bg-neutral-700 hover:bg-neutral-600 active:bg-neutral-700 shadow-sm"> | ||
<div class="w-5 h-5 me-2 text-white"> | ||
<Icon src="{tab.icon}" solid /> | ||
</div> | ||
{tab.label} | ||
</button> | ||
</li> | ||
{/each} | ||
</ul> | ||
<div class="border border-neutral-600 bg-neutral-800 rounded-lg p-2 h-full w-full"> | ||
<svelte:component this={activeTab.content} /> | ||
</div> | ||
</div> |