svelte-travel-transitions icon indicating copy to clipboard operation
svelte-travel-transitions copied to clipboard

Question: Fade in on page load

Open justinmoon opened this issue 5 years ago • 2 comments

Is it possible to fade in content on page load?

I've tried stuff like this and it doesn't seem to work in Sapper.

justinmoon avatar Jan 01 '20 04:01 justinmoon

I'm not sure if this is possible with sapper. With svelte you need to set intro: true when you initialise your application but I'm not 100% certain you have full access to the init options when using sapper. In svelte you would do something like:

new App({ target: some_el, intro: true })

This will enable transitions on the first load, I'll have to check this behaviour for sapper.

pngwn avatar Jan 06 '20 23:01 pngwn

@justinmoon Sapper is a little different you need to look for the app.mjs file (src/node_modules/@sapper for me) and add intro: true to root_component since that's what's calling new App()

root_component = new App({
  target,
  props,
  hydrate: true,
  intro: true
});

JHethDev avatar Jan 16 '20 20:01 JHethDev