added basic slide transition

This commit is contained in:
Samuel Walker 2024-10-26 23:39:21 -06:00
parent 4e6ea6f22b
commit 98e03a3e60
2 changed files with 20 additions and 12 deletions

View File

@ -5,6 +5,7 @@
import {CheckPrerequisites} from '../wailsjs/go/main/App.js'
import { onMount } from 'svelte'
import { loading } from './global.ts'
import { slide } from 'svelte/transition'
let width: int = 10
@ -18,9 +19,13 @@
<main>
<img alt="Wails logo" id="logo" src="{logo}">
{#if $loading}
<div transition:slide="{{duration:100}}">
<Loading />
</div>
{:else}
<div transition:slide="{{duration:100}}">
<Instances />
</div>
{/if}
</main>

View File

@ -4,6 +4,7 @@
import {LaunchInstance} from '../wailsjs/go/main/Prism.js'
import {onMount} from 'svelte'
import {loading} from './global.ts'
import {slide} from 'svelte/transition'
let modpacks: Modpack[] = []
let pack: string
@ -67,6 +68,7 @@
<button on:click={onclick}>Launch</button>
<br/>
{#if addingInstance}
<div transition:slide="{{duration:300}}">
<select id="pack" on:change={onchange} bind:value={pack} name="pack">Select a Modpack:
{#each modpacks as pack}
<option value={pack.Id}>{pack.Name}</option>
@ -77,6 +79,7 @@
<br/>
<button on:click={install}>Install</button>
<button on:click={() => {addingInstance = false}}>Cancel</button>
</div>
{:else}
<button on:click={() => {addingInstance = true}}>Add Instance</button>
{/if}