From 0fb1ef4932fd361126dc5a0bf84b8c6e3d81081f Mon Sep 17 00:00:00 2001 From: bat Date: Fri, 3 Mar 2023 23:17:51 +0000 Subject: [PATCH] Actualizar 'components/project.js' --- components/project.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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)