Skip to content

An element that saves the presence of the user at a route and gets all other users at that route

License

Notifications You must be signed in to change notification settings

convoo/presence-fire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Presence-Fire

presence-fire

Simple way to add presence to your app using firebase.


Install

bower install presence-fire --save

<presence-fire>

An element that saves the presence of the user at a route and gets all other users at that route.

<link rel="import" href="/bower_components/presence-fire/presence-fire.html">
<!--What you need:-->
<firebase-app
    name="presencefire"
    api-key="AIzaSyAhoCXxkY-ffNwA_7L7HIwBVpASYj1btNE"
    auth-domain="convoo-login-demo.firebaseapp.com"
    database-url="https://convoo-login-demo.firebaseio.com">
</firebase-app>

<presence-fire
    app-name="presencefire"
    uid="[[user.uid]]"
    photo="[[user.photoURL]]" 
    name="[[user.displayName]]" 
    route="{{route}}"
    status="{{status}}"
    present="{{present}}"
    private="{{private}}">
</presence-fire>

<!--Just for the demo:-->
<social-login-fire 
    twitter 
    app-name="presencefire"
    user="{{user}}">
</social-login-fire>

<div>
    Currently here:<br><br>
    <div class="photoContainer">
        <template is="dom-repeat" items="{{present}}">
            <img src$="{{item.photo}}" alt="{{item.name}}" class="photo">
        </template>
    </div>
</div>

<paper-input id="route" label="Route" value="{{route}}" readonly></paper-input>

<br>

<paper-button raised onclick="_changeRoute('a')">Route A</paper-button>
<paper-button raised onclick="_changeRoute('b')">Route B</paper-button>
<paper-button raised onclick="_changeRoute('c')">Route C</paper-button>

<br><br>

<paper-toggle-button checked="{{private}}">Private Browsing</paper-toggle-button>

Contributing

Install the Polymer-CLI

First, make sure you have the Polymer CLI installed. Then run polymer serve to serve your application locally.

Viewing Your Application

$ polymer serve

Building Your Application

$ polymer build

This will create a build/ folder with bundled/ and unbundled/ sub-folders containing a bundled (Vulcanized) and unbundled builds, both run through HTML, CSS, and JS optimizers.

You can serve the built versions by giving polymer serve a folder to serve from:

$ polymer serve build/bundled

Running Tests

$ polymer test

Your application is already set up to be tested via web-component-tester. Run polymer test to run your application's test suite locally.

About

An element that saves the presence of the user at a route and gets all other users at that route

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages