From 495035e572861995ee1c0bd05b49211279da8bc4 Mon Sep 17 00:00:00 2001 From: bat Date: Tue, 28 Feb 2023 08:06:15 +0000 Subject: [PATCH] =?UTF-8?q?A=C3=B1adir=20'components/project.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/project.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 components/project.js diff --git a/components/project.js b/components/project.js new file mode 100644 index 0000000..4f76020 --- /dev/null +++ b/components/project.js @@ -0,0 +1,20 @@ +class Project extends HTMLElement { + constructor() { + const shadow = this.attachShadow({mode: 'open'}) + const textArea = document.createElement('textarea') + textArea.defaultValue = localStorage.getItem( + window.location.hash + ) + textArea.addEventListener('input', e => { + localStorage.setItem( + window.location.hash, + e.target.defaultValue + ) + }) + shadow.appendChild(textArea) + } + + connectedCallback() { + // add css + } +} \ No newline at end of file