-
Notifications
You must be signed in to change notification settings - Fork 0
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
0fc5003
commit b33f844
Showing
8 changed files
with
128 additions
and
113 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 |
---|---|---|
@@ -1,66 +1,23 @@ | ||
<script lang="ts"> | ||
import { onMount } from 'svelte'; | ||
import { get, writable } from 'svelte/store'; | ||
import PaneSignupNews from './sections/PaneSignupNews.svelte'; | ||
import PaneBlog from './sections/PaneBlog.svelte'; | ||
import paneManager from '../lib/PaneManager'; | ||
import type { PaneType } from '../lib/types'; | ||
import Pane from '../components/Pane/Pane.svelte'; | ||
const INITIAL_PANES: PaneType[] = [ | ||
{ | ||
id: 'signup-news', | ||
obj: writable({ | ||
x: 500, | ||
y: 200, | ||
zIndex: 1 | ||
}) | ||
}, | ||
{ | ||
id: 'blog', | ||
obj: writable({ | ||
x: 150, | ||
y: 100, | ||
zIndex: 1 | ||
}) | ||
} | ||
]; | ||
export let x: number = 100; | ||
export let y: number = 150; | ||
export let zIndex: number = 2; | ||
export let id: string = 'home'; | ||
let panes = writable<PaneType[]>(INITIAL_PANES); | ||
onMount(() => { | ||
INITIAL_PANES.forEach((pane) => { | ||
paneManager.createPane(pane.id, get(pane.obj).x, get(pane.obj).y, get(pane.obj).zIndex); | ||
}); | ||
const unsubscribe = paneManager.subscribe((value) => { | ||
panes.set(value); | ||
}); | ||
return () => { | ||
unsubscribe(); | ||
}; | ||
}); | ||
const COMPONENTS = new Map<string, typeof PaneSignupNews | typeof PaneBlog>(); | ||
COMPONENTS.set('signup-news', PaneSignupNews); | ||
COMPONENTS.set('blog', PaneBlog); | ||
export let onBringToFront = () => {}; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>Russell Jones | Home</title> | ||
<meta name="description" content="Russell Jones" /> | ||
</svelte:head> | ||
|
||
<div> | ||
{#each $panes as pane (pane.id)} | ||
<svelte:component | ||
this={COMPONENTS.get(pane.id)} | ||
{...get(pane.obj)} | ||
id={pane.id} | ||
onBringToFront={() => { | ||
console.log('Bringing pane to front:', pane.id); | ||
paneManager.updateZIndex(pane.id); | ||
}} | ||
/> | ||
{/each} | ||
</div> | ||
<Pane title="Home" {id} {x} {y} {zIndex} {onBringToFront}> | ||
<div class="text-column"> | ||
<h1>Home of dev.</h1> | ||
|
||
<p>Dev home.</p> | ||
</div> | ||
</Pane> |
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,25 +1,25 @@ | ||
<script> | ||
import { base } from '$app/paths'; | ||
<script lang="ts"> | ||
import Pane from '../../components/Pane/Pane.svelte'; | ||
export let x: number = 100; | ||
export let y: number = 150; | ||
export let zIndex: number = 2; | ||
export let id: string = 'about'; | ||
export let onBringToFront = () => {}; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>About</title> | ||
<meta name="description" content="About this app" /> | ||
<meta name="description" content="About Russell" /> | ||
</svelte:head> | ||
|
||
<div class="text-column"> | ||
<h1>About this app</h1> | ||
|
||
<p> | ||
This is a <a href="https://kit.svelte.dev">SvelteKit</a> app. You can make your own by typing the | ||
following into your command line and following the prompts: | ||
</p> | ||
|
||
<pre>npm create svelte@latest</pre> | ||
|
||
<p> | ||
The page you're looking at is purely static HTML, with no client-side interactivity needed. | ||
Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening | ||
the devtools network panel and reloading. | ||
</p> | ||
</div> | ||
<Pane title="About" {id} {x} {y} {zIndex} {onBringToFront}> | ||
<div class="text-column"> | ||
<h1>About Russell</h1> | ||
|
||
<p> | ||
Me dev. | ||
</p> | ||
</div> | ||
</Pane> |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
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,14 @@ | ||
// src/stores.ts | ||
import { writable } from 'svelte/store'; | ||
|
||
export interface SessionData { | ||
openAboutInPane?: boolean; | ||
// other session properties here | ||
} | ||
|
||
const initialSession: SessionData = { | ||
openAboutInPane: false, | ||
// other session properties here | ||
}; | ||
|
||
export const session = writable<SessionData>(initialSession); |