ToastModule Fixes in the styles and small tweaks, also lib renamed to MWinLib
This commit is contained in:
@@ -1,27 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { addToast } from '$lib/stores/toasts';
|
||||
import { FileSystem } from '$lib/termos/filesystem/filesystem';
|
||||
import { onMount } from 'svelte';
|
||||
import Terminal from '../../modules/Terminal.svelte';
|
||||
import type { ToastMessage } from '../admin/util';
|
||||
import { mwin_movable } from '$lib/mwinlib/mwin_controller.svelte';
|
||||
import type { MWinAPI } from '$lib/mwinlib/mwin_util';
|
||||
|
||||
function bye(tm: ToastMessage): void {
|
||||
console.log('Funkcja wywolana');
|
||||
}
|
||||
|
||||
let wrapper = $state<HTMLElement>();
|
||||
|
||||
let username = 'test';
|
||||
|
||||
onMount(async () => {
|
||||
await FileSystem.init();
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') {
|
||||
addToast('success', 'Hi~', '', 5000, undefined, undefined, true, false, bye, bye);
|
||||
}
|
||||
});
|
||||
});
|
||||
let API: MWinAPI;
|
||||
</script>
|
||||
|
||||
<Terminal {username}></Terminal>
|
||||
<div class="wrapper relative h-screen w-1/2 bg-blue-500">
|
||||
<div
|
||||
class="absolute h-128 w-5xl bg-red-400 will-change-auto"
|
||||
use:mwin_movable={{
|
||||
wrapper: '.wrapper',
|
||||
baseZIndex: 10,
|
||||
resizable: { threshold: 24 },
|
||||
onAPI: (api) => (API = api)
|
||||
}}
|
||||
>
|
||||
<div></div>
|
||||
<button onclick={() => API.maximize()}>click me</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user