diff --git a/components/project.js b/components/project.js index 9fed33e..75a21e2 100644 --- a/components/project.js +++ b/components/project.js @@ -1,20 +1,17 @@ export class Project extends HTMLElement { constructor() { super() + const path = this.getAttribute('path') const shadow = this.attachShadow({mode: 'open'}) const textArea = document.createElement('textarea') - const path = new URL( - window.location.hash.slice(1) || '/', - window.location - ).pathname const header = document.createElement('h1') header.innerText = path textArea.value = localStorage.getItem( - window.location.hash + path ) ?? '' textArea.addEventListener('input', e => { localStorage.setItem( - window.location.hash, + path, e.target.value ) }) @@ -29,7 +26,7 @@ export class Project extends HTMLElement { style.textContent = ` textarea { width: 80%; - height: 90dvh; + height: 45vh; } ` this.shadowRoot.append(style)