You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pages/components/project.js

20 lines
477 B
JavaScript

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
}
}