core.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { search } from "./search.js";
  2. import { pixel, percent, auto } from "./size.js";
  3. import { position, place_top } from "./position.js";
  4. import { sticky } from "./sticky.js";
  5. import { loader } from "./loader.js";
  6. import { database } from "./database.js";
  7. import { logo } from "./logo.js";
  8. document.addEventListener("DOMContentLoaded", async () => {
  9. const container = document.querySelector(".container");
  10. const parser = new loader("./database", "project.json");
  11. await parser.load();
  12. const store = new database(parser.loaded);
  13. const top_bar_builder = new sticky();
  14. top_bar_builder.width = new percent(100);
  15. top_bar_builder.height = new auto();
  16. top_bar_builder.position = new place_top();
  17. const top_bar = top_bar_builder.element;
  18. top_bar.className = "top-bar";
  19. top_bar.appendChild(document.createElement("div"));
  20. const search_bar = new search(store);
  21. top_bar.appendChild(search_bar.ui);
  22. const name = new logo(store.content.name);
  23. top_bar.appendChild(name.ui);
  24. container.appendChild(top_bar);
  25. });