Skip to content

Collect3/framer-primer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Framer Primer Module

The Primer module provides the ability to preload images and display a loading indicator. Sometimes when sharing a framer it's desirable to ensure images are loaded before the reciever can view or interact with the Framer, this module tries to solve that issue.

Example

http://share.framerjs.com/e1i852qzxiar/

Including the Module

Place the primer.coffee module into the /modules directory of your project. Then require the module at the top of your prototype.

Primer = require 'Primer' 

Getting Started

The Primer preloader is a layer that will default to the size of the screen and can be created at the end of your prototype.

# ...
# Your code above here

primer = new Primer
primer.load()

Adding images

By default any layers that have an image associated will be preloaded automatically when the load function is called. If there are dynamically loaded images that you want to precache, you can call addImage

primer.addImage('/images/the-image-to-load.png')

Load event

Assign a function to the property onload to be notified when loading is finished

primer.onload = () ->
    print "loaded"

About

Framer module to preload images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages