This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Maximilian Bredow
Posted Dec 11 - Read on Facebook

Solved: See solution in comment

How to preload dynamicly generated content in Firebase-connected prototype?

I have a Tinder-like prototype, connected with a Firebase database. Currently, with each swipe, the old card is destroyed, and a new one is generated with a random profile and image (synced with Firebase). This works ok but sometimes the images take 2 or 3 seconds to load.

How would I proceed to preload these images? I imagine I could generate a card class one swipe in advance and then move it into the screen, replacing the old card. Does my logic sound about right?

How can I ‘rename’ a layer, effectively replacing an older one? How could I preload 2 or more swipes in advance? Are there any existing prototypes that do this kind of preloading dynamicly generated content?

Thanks!

3 Comments

Yasin Arık

Any answer to this question will help me also. Up

Maximilian Bredow

This seems to work. The first time this runs 2 cards are created, of which the second is stored outside of the screen. Each additional time this function runs, newTop is renamed as top and pushed into the screen, and a new newTop created outside the screen

Yasin Arık

Happy to see that you found it. Thanks for sharing.

Read the entire post on Facebook