test1.js const shadow = this.shadowRoot ?? this.attachShadow({mode: 'open'});
shadow.innerHTML = `
<style>
div {
position: fixed;
top: 0; right: 0;
margin: 1rem; padding: 1rem;
background: #FFF; color: 000;
z-index: 999999;
}
</style>
<div>
${this.getAttribute('message')}
</div>`;
}
get message() {
this.getAttribute('message');
}
set message(message) {
this.setAttribute('message', message);
}
static get observedAttributes() {
return ['message'];
}
attributeChangedCallback(name, oldValue, newValue) {
this.getElementsByTagName('div')[0].textContent = newValue;
}
});
window.progressArea = document.createElement('progress-area');
document.body.appendChild(progressArea);