Copy stuff over from the template
This commit is contained in:
3
src/index.js
Normal file
3
src/index.js
Normal 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
26
src/view/BasicApp.js
Normal 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
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
24
src/view/BasicAppShell.svelte
Normal file
24
src/view/BasicAppShell.svelte
Normal 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>
|
||||
Reference in New Issue
Block a user