This is a web component for embedding images from HTTP Cats.
Here's a live demo.
bower install http-cat-element
Then just import the component in your HTML:
<link rel="import" href="bower_components/http-cat-element/http-cat.html">
Get the http-cat.html
file and then import it your markup:
<link rel="import" href="http-cat.html">
Don't forget to also include the webcomponentsjs polyfill. If you installed via bower, you can find it already inside the bower_components/
folder, because it's a dependency.
This web component extends the <img>
tag.
To use it just add the following markup to your HTML:
<img is="http-cat" status="404">
status
: change it so that the image matches the corresponding HTTP status code
MIT License