chuck-norris-fact-element
v1.1.2
Published
A custom element that shows categorized or random chuck norris fact.
Downloads
13
Maintainers
Readme
Chuck-norris-facts-element
Demo
Install
Install the component using NPM:
$ npm install chuck-norris-fact-element --save
Usage
Import polyfill:
<!-- load webcomponents bundle, which includes all the necessary polyfills --> <script src="node_modules/@webcomponents/custom-elements/custom-elements.min.js"></script>
Import custom element:
<script type="module" src="node_modules/chuck-norris-fact-element/chuck-norris-fact.js"></script>
Start using it!
Random chuck norris fact:
<chuck-norris-fact></chuck-norris-fact>
categorized chuck norris fact:
<chuck-norris-fact category="animal"></chuck-norris-fact>
Options
Category
Options: animal, career, celebrity, dev, explicit, fashion, food, history, money, movie, music, political, religion, science, sport, travel,
Description: Used to retrieve categorized chuck norris facts.
Development
In order to run it locally you'll need to fetch some dependencies and a basic server setup.
$ npm install -g serve
Start development server and open
http://localhost:5000/
. poly$ serve