mirror of
https://github.com/SirBlobby/Hoya26.git
synced 2026-02-04 03:34:34 -05:00
Code Update
This commit is contained in:
@@ -7,14 +7,11 @@
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
// State to track if we are in the Tauri App
|
||||
let isApp = $state(false);
|
||||
|
||||
onMount(() => {
|
||||
// Strategy 2: Determine mode
|
||||
isApp = isTauri();
|
||||
|
||||
// Strategy 1: Add platform class to body for global styling
|
||||
if (isApp) {
|
||||
document.body.classList.add("platform-native");
|
||||
} else {
|
||||
@@ -23,7 +20,6 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Strategy 2: Layout Splitting -->
|
||||
{#if isApp}
|
||||
<main class="app-container">
|
||||
{@render children()}
|
||||
@@ -38,38 +34,32 @@
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
/* Base styles */
|
||||
:global(body) {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||
Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
/* Web specific container */
|
||||
.web-container {
|
||||
min-height: 80vh; /* Ensure footer pushes down */
|
||||
min-height: 80vh;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* App specific container - Full height, no body scroll usually handled here or in global css */
|
||||
.app-container {
|
||||
height: 100vh;
|
||||
overflow-y: auto;
|
||||
padding: 10px;
|
||||
padding-bottom: 70px; /* Space for TabBar */
|
||||
padding-bottom: 70px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Strategy 1 Example: Global Style Overrides based on class */
|
||||
/* Web Buttons: Boxy */
|
||||
:global(.platform-web button) {
|
||||
border-radius: 4px;
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
/* Native Buttons: Rounder and larger touch targets */
|
||||
:global(.platform-native button) {
|
||||
border-radius: 20px;
|
||||
padding: 12px 24px;
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
// Tauri doesn't have a Node.js server to do proper SSR
|
||||
// so we use adapter-static with a fallback to index.html to put the site in SPA mode
|
||||
// See: https://svelte.dev/docs/kit/single-page-apps
|
||||
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
|
||||
export const ssr = false;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
async function greet(event: Event) {
|
||||
event.preventDefault();
|
||||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||
greetMsg = await invoke("greet", { name });
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user