{"size": 1813, "ext": "js", "max_stars_repo_path": "src/blocks/modules/service-complex/service-complex.js", "max_stars_repo_name": "Kirkusik/energym", "max_stars_repo_stars_event_min_datetime": "2021-08-06T03:55:23.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-09T00:53:04.000Z", "max_issues_repo_path": "src/blocks/modules/service-complex/service-complex.js", "max_issues_repo_name": "Kirkusik/energym", "max_issues_repo_issues_event_min_datetime": "2021-07-19T08:47:02.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-14T13:14:28.000Z", "max_forks_repo_path": "src/blocks/modules/service-complex/service-complex.js", "max_forks_repo_name": "Kirkusik/energym", "max_forks_repo_forks_event_min_datetime": "2021-11-22T18:34:06.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-29T23:15:35.000Z"}
{"max_stars_count": 2, "max_issues_count": 8, "max_forks_count": 3, "avg_line_length": 30.7288135593, "max_line_length": 80, "alphanum_fraction": 0.7584114727}
// Open and close menu on service-complex
const serviceComplex = {
  list: document.querySelector(".services-menu"),
  header: document.querySelector(".services-complex__default"),
  items: document.querySelectorAll(".services-menu__link"),
  defaultItem: document.querySelector(".services-complex__default-item"),
  closeBtn: document.querySelector(".services-complex__arrow--close"),
};

function serviceMenuClick() {
  serviceComplex.header.classList.add("services-complex__default--active-menu");
  serviceComplex.list.classList.add("services-menu--active");
}

function serviceMenuClickChoice(e) {
  serviceComplex.defaultItem.innerText = e.target.closest(
    ".services-menu__link"
  ).innerText;
  serviceComplex.items.forEach((e) => {
    e.classList.remove("services-menu__link--active");
  });
  e.target
    .closest(".services-menu__link")
    .classList.add("services-menu__link--active");
  serviceComplex.header.classList.remove(
    "services-complex__default--active-menu"
  );
  serviceComplex.list.classList.remove("services-menu--active");
}

function serviceMenuClose(e) {
  serviceComplex.header.classList.remove(
    "services-complex__default--active-menu"
  );
  serviceComplex.list.classList.remove("services-menu--active");
}

if (serviceComplex.header) {
  serviceComplex.header.addEventListener("click", serviceMenuClick);
}

if (serviceComplex.list) {
  serviceComplex.list.addEventListener("click", serviceMenuClickChoice);
}
if (serviceComplex.closeBtn) {
  serviceComplex.closeBtn.addEventListener("click", serviceMenuClose);
}

// input video on service-complex
import { createVideo } from "../../../js/import/video";

let servicesComplexVideo = document.querySelector(
  ".services-complex__video-wrapper"
);

if (servicesComplexVideo) {
  createVideo(servicesComplexVideo);
}
