Update App.svelte in window-bindings example

The #each should use the layers as defined in the <script> section so that the parallax works correctly when the layers array is changed
pull/7181/head
Rene Kootstra 5 years ago committed by GitHub
parent 630ec4b32d
commit e12cb348b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,7 @@
<svelte:window bind:scrollY={y}/> <svelte:window bind:scrollY={y}/>
<a class="parallax-container" href="https://www.firewatchgame.com"> <a class="parallax-container" href="https://www.firewatchgame.com">
{#each [0, 1, 2, 3, 4, 5, 6, 7, 8] as layer} {#each layers as layer}
<img <img
style="transform: translate(0,{-y * layer / (layers.length - 1)}px)" style="transform: translate(0,{-y * layer / (layers.length - 1)}px)"
src="https://www.firewatchgame.com/images/parallax/parallax{layer}.png" src="https://www.firewatchgame.com/images/parallax/parallax{layer}.png"

Loading…
Cancel
Save