init
This commit is contained in:
25
src/routes/+layout.svelte
Normal file
25
src/routes/+layout.svelte
Normal file
@@ -0,0 +1,25 @@
|
||||
<script lang="ts">
|
||||
import '../app.css';
|
||||
import { ModeWatcher } from 'mode-watcher';
|
||||
import { ChatSocket } from '$lib/socket';
|
||||
import { onMount } from 'svelte';
|
||||
import { browser } from '$app/environment';
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
let socket;
|
||||
|
||||
onMount(() => {
|
||||
if (browser) {
|
||||
socket = new ChatSocket('ws://localhost:3000/ws');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<ModeWatcher />
|
||||
|
||||
<div class="flex h-full w-full flex-col items-center">
|
||||
<div class="my-8 flex h-full w-full max-w-screen-2xl flex-col">
|
||||
{@render children()}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user