-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
33 lines (28 loc) · 779 Bytes
/
Copy pathmain.js
File metadata and controls
33 lines (28 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Navigation extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
fetch('/components/navigation.html')
.then(response => response.text())
.then(html => {
this.shadowRoot.innerHTML = html;
});
}
}
customElements.define('pd-nav', Navigation);
class Header extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
fetch('/components/header.html')
.then(response => response.text())
.then(html => {
this.shadowRoot.innerHTML = html;
});
}
}
customElements.define('pd-header', Header);