Copy stuff over from the template

This commit is contained in:
Badgers
2025-07-09 00:49:10 -04:00
commit 535788e75b
13 changed files with 6421 additions and 0 deletions

3
src/index.js Normal file
View File

@@ -0,0 +1,3 @@
import { BasicApp } from './view/BasicApp.js';
Hooks.once('ready', () => new BasicApp().render(true, { focus: true }));

26
src/view/BasicApp.js Normal file
View File

@@ -0,0 +1,26 @@
import { SvelteApp } from '#runtime/svelte/application';
import { deepMerge } from '#runtime/util/object';
import BasicAppShell from './BasicAppShell.svelte';
export class BasicApp extends SvelteApp
{
/**
* Default Application options
*
* @returns {SvelteApp.Options} options - SvelteApp options.
* @see https://typhonjs-fvtt-lib.github.io/api-docs/interfaces/_runtime_svelte_application.SvelteApp.Options.html
*/
static get defaultOptions()
{
return deepMerge(super.defaultOptions, {
title: 'TemplateESM.title', // Automatically localized from `lang/en.json`.
width: 300,
svelte: {
class: BasicAppShell,
target: document.body
}
});
}
}

View File

@@ -0,0 +1,24 @@
<script>
import { ApplicationShell } from '#runtime/svelte/component/application';
export let elementRoot;
</script>
<!-- This is necessary for Svelte to generate accessors TRL can access for `elementRoot` -->
<svelte:options accessors={true}/>
<!-- ApplicationShell provides the popOut / application shell frame, header bar, content areas -->
<!-- ApplicationShell exports `elementRoot` which is the outer application shell element -->
<ApplicationShell bind:elementRoot>
<main>
<h1>Basic application</h1>
</main>
</ApplicationShell>
<style lang="scss">
main {
text-align: center;
display: flex;
flex-direction: column;
}
</style>