Skip to content

Commit

Permalink
Compatibility with Framer Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
marckrenn committed Aug 23, 2017
1 parent 780ba79 commit 9f41e0e
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ These examples include access to a public demo database for the purpose of demon

## Getting started in under 5 minutes

I'd also like to recommend reading [*Supercharge your Framer prototype with Firebase, pt.1*](https://medium.com/@marc_krenn/framerfirebase1-e7d13a939cf4) on Medium, if you haven't already.
<a href='https://open.framermodules.com/Firebase'>
<img alt='Install with Framer Modules'
src='https://www.framermodules.com/assets/[email protected]' width='160' height='40' /></a>

<strong>OR</strong>

| Step | Instruction |
| :---: | :--- |
Expand All @@ -39,6 +43,7 @@ I'd also like to recommend reading [*Supercharge your Framer prototype with Fire
| **6** | Back in Framer, add `firebase = new Firebase` and set the required [Class Properties](https://github.com/marckrenn/framer-Firebase#1-properties) |
| **7** | Save, load and sync data using the available [Class Methods](https://github.com/marckrenn/framer-Firebase#2-methods). Also, check out the [Demo Projects](https://github.com/marckrenn/framer-Firebase#demo-projects). |

I'd also like to recommend reading [*Supercharge your Framer prototype with Firebase, pt.1*](https://medium.com/@marc_krenn/framerfirebase1-e7d13a939cf4) on Medium, if you haven't already.

### Tips

Expand Down
35 changes: 35 additions & 0 deletions example.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@


# Please deactivate Auto Refresh and reload manually using CMD+R!


# The required information is located at https://firebase.google.com → Console → YourProject → ...
demoDB = new Firebase
projectID: "framer-demo" # ... Database → first part of URL
secret: "K2ZJjo4RXG5nlHEWgjgwBzNkeVJCz9YZAQF8dk9g" # ... Project Settings → Service Accounts → Database Secrets → Show (mouse-over)



# Layers

new BackgroundLayer

slider = new SliderComponent
slider.center()

slider.knob.backgroundColor = "grey"
slider.knob.draggable.momentum = false



# Events + Firebase

slider.knob.onDragEnd ->
demoDB.put("/sliderValue",slider.value) # `put´ writes data to Firebase,
# see http://bit.ly/firebasePut

demoDB.onChange "/sliderValue", (value) -> # Retreives data onLoad and when it was changed
# see http://bit.ly/firebaseOnChange
slider.animateToValue(value) unless slider.knob.isDragging


Binary file added firebase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Firebase",
"description": "Allows to load, save and sync data effortlessly between multiple sessions and devices.",
"author": "Marc Krenn",

"require": "{Firebase} = require 'firebase''",
"install": "firebase.coffee",
"example": "example.coffee",

"thumb": "firebase.png"
}

0 comments on commit 9f41e0e

Please sign in to comment.