Skip to content

Commit

Permalink
Add new component footerShebang
Browse files Browse the repository at this point in the history
  • Loading branch information
frdsndr committed Dec 13, 2021
1 parent cf1d414 commit 9393389
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,20 @@
<!-- default kbsb navigation component -->
<kbsb-navbar></kbsb-navbar>

<kbsb-message data-text="Test">Person by Knut M. Synstad from NounProject.com</kbsb-message>


<section class="section">
<div class="container">
<h1 class="heading">
Typescript Portfolio Filter
</h1>
</div>
</section>

<!-- profile app -->
<div id="app"></div>

<!-- default kbsb footer -->
<kbsb-footer></kbsb-footer>
<kbsb-footer-shebang></kbsb-footer-shebang>

</body>
</html>
36 changes: 36 additions & 0 deletions src/components/footerShebang.ts
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);
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import './style.css';
import './components/filterButton';
import './components/navBar';
import './components/footer';
import './components/footerShebang';

// a map of all the unique skills
// value represents the filter state // default false (inactive)
Expand Down

0 comments on commit 9393389

Please sign in to comment.