diff --git a/app.js b/app.js index be78d68..9683901 100644 --- a/app.js +++ b/app.js @@ -1,3 +1,7 @@ +import { Project } from "./components/project.js" + +customElements.define('m-project', Project) + function e(tag, attrs, content) { const el = document.createElement(tag) el.innerText = content @@ -41,6 +45,9 @@ class Setup { document.body.appendChild( e('h1', {}, location.hash) ) + document.body.appendChild( + e('m-project', {}, '') + ) } } } diff --git a/components/project.js b/components/project.js index 4f76020..0ba5f9b 100644 --- a/components/project.js +++ b/components/project.js @@ -1,4 +1,4 @@ -class Project extends HTMLElement { +export class Project extends HTMLElement { constructor() { const shadow = this.attachShadow({mode: 'open'}) const textArea = document.createElement('textarea') diff --git a/sw.js b/sw.js index c680024..3a24a32 100644 --- a/sw.js +++ b/sw.js @@ -4,6 +4,7 @@ async function initCache() { '/', '/index.html', '/app.js', + '/components/project.js', ]) }