-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Create a class for the element | ||
class FooterShebang extends HTMLElement { | ||
constructor() { | ||
// Always call super first in constructor | ||
super(); | ||
|
||
// Create a shadow root | ||
const shadow = this.attachShadow({ mode: 'open' }); | ||
|
||
// Create wrapper | ||
const img = document.createElement('img'); | ||
img.setAttribute('class', 'logo-shebang'); | ||
img.setAttribute('src', 'https://www.kaboomshebang.com/logos/shebang_3d_for_web.svg'); | ||
img.setAttribute('alt', 'The Kaboom Shebang'); | ||
|
||
// Create some CSS to apply to the shadow dom | ||
const style = document.createElement('style'); | ||
|
||
style.textContent = ` | ||
.logo-shebang { | ||
position: fixed; | ||
display: block; | ||
max-width: 3.5rem; | ||
right: 0; | ||
bottom: 1rem; | ||
} | ||
`; | ||
|
||
// Attach the created elements to the shadow dom | ||
shadow.appendChild(style); | ||
shadow.appendChild(img); | ||
} | ||
} | ||
|
||
// Define the new element | ||
customElements.define('kbsb-footer-shebang', FooterShebang); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters