Actualizar 'components/project.js'

file-group-page
bat 3 years ago
parent f79e664f03
commit 0fb1ef4932

@ -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)

Loading…
Cancel
Save