Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. static headerView() {
  2. const header = document.createElement('header');
  3. header.innerHTML = `
  4. <h1 class = "site-name"> glebogram </h1>
  5. ${this.isLoggedUser ? `<button class="add-post"><i class="fas fa-plus fa-2x"></i></button>
  6. <div class = "user-name">gleb9990</div>
  7. <button id = "log-out"><img src="images/user-image.png" alt="user-image" id = "user-pic"></button>` : ''}
  8. ${this.isLoggedUser ? '' : '<button id = "sign-in"><span>sign in</span></button>'}`;
  9. const body = document.getElementsByTagName('body')[0];
  10. body.parentNode.appendChild(header);
  11. body.insertAdjacentElement('afterbegin', header);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement