Readit News logoReadit News
nkrsv commented on Thoughts on Svelte   tyhopp.com/notes/thoughts... · Posted by u/naansequitur
fenomas · 3 years ago
I switched my game's UI from Vue2 to Svelte maybe a year ago, and I agree with almost all of the article.

One thing I think the author overlooks: the appeal of Svelte's built-in animations and transitions is that they work correctly when the element's lifecycle is being managed by Svelte. E.g. with code like this:

    {#if showFoo}
      <div transition:fly={{ y: -50 }}> Foo! </div>
    {/if}
When `showFoo` changes to false, Svelte will first play a flyout transition and then remove the element from the DOM, and it will correctly handle things if `showFoo` toggles back to true again before the flyout finishes, etc. You could do the same thing with CSS animations, but it would be hairy and you'd need to learn more about svelte internals than you probably want to.

nkrsv · 3 years ago
Can i ask you what type of game it is? Web or desktop? I wanted to dive into the topic of UI in desktop/native games for a while

u/nkrsv

KarmaCake day3March 27, 2023View Original