<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
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.
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.
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>).
The inner of the element consists of two parts:
-
the quote itself
-
the signature of the quote (from the
fromattribute)
You can define a custom style for the element using CSS mixins :
-
--foaas-element-thememixin enables custom CSS properties for the whole elelement -
--foaas-element-quote-thememixin enables custom CSS properties for the quote -
--foaas-element-signature-thememixin enables custom CSS properties for the signature
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 serveAnd then copy-paste the url given by polymer to your favorite browser.