Code Monkey home page Code Monkey logo

fooas-element's Introduction

<foaas-element>

<foaas-element> will help you to add to your site quotes provided by foaas.com.

<foaas-element type="keepcalm" from="The bartender" reaction="drink beer">
</foaas-element>

Keep the fuck calm and drink beer!
- The bartender

How does it work

The elment loads a quote from foaas.com and displays it.

The type of the quote corresponds to the type attribute of the element.

The other attributes are parameters that depends of the type of the quote. A from is always required. For a mapping between the types of quote and the parameters required, please read foaas.com. A default value is provided for all the parameters.

Quote reloading

Another quote is automatically reloaded when the type attribute is setted. If you want to set the according parameters to the type of quote, be carefull that the type attribute must be the last setted.

loading attribute

During the time when the quote is loaded, a loading attribute is set to the element. You can bind to this attribute in order to do something special during loading (for example display a <paper-spinner>).

Custom style

The inner of the element consists of two parts:

  • the quote itself

  • the signature of the quote (from the from attribute)

You can define a custom style for the element using CSS mixins :

  • --foaas-element-theme mixin enables custom CSS properties for the whole elelement

  • --foaas-element-quote-theme mixin enables custom CSS properties for the quote

  • --foaas-element-signature-theme mixin enables custom CSS properties for the signature

Demo

There is a little demo of the element.

First, make sure you have the [Polymer CLI](https://www.npmjs.com/package/polymer-cli) installed. Then run polymer serve to serve your element locally.

$ polymer serve

And then copy-paste the url given by polymer to your favorite browser.

fooas-element's People

Stargazers

Tom Cully avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.