core.js 872 B

12345678910111213141516171819202122232425262728
  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. document.addEventListener("DOMContentLoaded", async () => {
  8. const container = document.querySelector(".container");
  9. const parser = new loader("./database", "project.json");
  10. await parser.load();
  11. const store = new database(parser.loaded);
  12. const top_bar_builder = new sticky();
  13. top_bar_builder.width = new percent(100);
  14. top_bar_builder.height = new auto();
  15. top_bar_builder.position = new place_top();
  16. const top_bar = top_bar_builder.element;
  17. const search_bar = new search(store);
  18. top_bar.appendChild(search_bar.ui);
  19. container.appendChild(top_bar);
  20. });