{"size": 1222, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "chasscepts/chasscept", "max_stars_repo_stars_event_min_datetime": "2021-11-16T20:55:54.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-16T20:55:54.000Z", "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "chasscepts/chasscept", "max_issues_repo_issues_event_min_datetime": "2021-06-19T06:21:12.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-24T06:15:10.000Z", "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "chasscepts/chasscept", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 23.0566037736, "max_line_length": 80, "alphanum_fraction": 0.6080196399}
import './assets/css/style.scss';
import picture from './assets/images/pic.jpg';
import projects from './lib/projects';

// Picture
(() => {
  document.querySelector('#picture').src = picture;
})();

// Projects
(() => {
  const container = document.querySelector('#projects-container');
  projects.all.forEach((project) => container.append(projects.getDOM(project)));
})();

// Header Scroll
(() => {
  const slide = document.querySelector('#page-header-slide');
  const height = slide.clientHeight;
  let isOpen = false;

  document.addEventListener('scroll', () => {
    if (window.scrollY > height) {
      if (!isOpen) {
        isOpen = true;
        slide.classList.add('bg-open');
      }
    } else if (isOpen) {
      isOpen = false;
      slide.classList.remove('bg-open');
    }
  });
})();

// Drawer
(() => {
  const hamburger = document.querySelector('#hamburger');
  const drawer = document.querySelector('#drawer');
  let open = false;

  hamburger.addEventListener('click', () => {
    if (open) {
      hamburger.classList.remove('open');
      drawer.classList.remove('open');
    } else {
      hamburger.classList.add('open');
      drawer.classList.add('open');
    }

    open = !open;
  });
})();
