diff --git a/index.html b/index.html index ebbec05..ca7d322 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@

WebComponents workshop

In this workshop, we will create new custom HTML Components

- +
@@ -37,5 +37,6 @@ } + \ No newline at end of file diff --git a/src/components/cat-img-fast.js b/src/components/cat-img-fast.js new file mode 100644 index 0000000..dd30cc2 --- /dev/null +++ b/src/components/cat-img-fast.js @@ -0,0 +1,20 @@ +class CatImgFastElement extends CatImgElement { + + constructor(){ + super(); + } + + render(){ + console.log(`rendering with ${this.xsize} ${this.ysize}`); + this.innerHTML = ` +

Here comes a better image

+ `; + } +} + +window.customElements.define( + 'cat-img-fast', + CatImgFastElement);