`;
class ProfilePicture extends HTMLElement{
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
this._image = this.shadowRoot.querySelector('img');
}
static get observedAttributes() { return ['picture']; }
attributeChangedCallback(name, oldValue, newValue) {
this._image.src = `domain.com/${newValue}.png`;
}
}
customElements.define('profile-picture', ProfilePicture);
`;
class ProfilePicture extends HTMLElement{
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
this._image = this.shadowRoot.querySelector('img');
}
static get observedAttributes() { return ['picture']; }
attributeChangedCallback(name, oldValue, newValue) {
this._image.src = `domain.com/${newValue}.png`;
}
}
customElements.define('profile-picture', ProfilePicture);
`;
class ProfilePicture extends HTMLElement{
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
this._image = this.shadowRoot.querySelector('img');
}
static get observedAttributes() { return ['picture']; }
attributeChangedCallback(name, oldValue, newValue) {
this._image.src = `domain.com/${newValue}.png`;
}
}
customElements.define('profile-picture', ProfilePicture);
`;
class ProfilePicture extends HTMLElement{
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
this._image = this.shadowRoot.querySelector('img');
}
static get observedAttributes() { return ['picture']; }
attributeChangedCallback(name, oldValue, newValue) {
this._image.src = `domain.com/${newValue}.png`;
}
}
customElements.define('profile-picture', ProfilePicture);
`;
class ProfilePicture extends HTMLElement{
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
this._image = this.shadowRoot.querySelector('img');
}
static get observedAttributes() { return ['picture']; }
attributeChangedCallback(name, oldValue, newValue) {
this._image.src = `domain.com/${newValue}.png`;
}
}
customElements.define('profile-picture', ProfilePicture);