+ let steps = [
+ { e: c.side_bar, t: 1300},
+ { e: c.logo, t: 200},
+ { e: c.nav_text, t: 500},
+ { e: c.footer, t: 500}
+ ];
+
+ steps.reduceRight((acc, curr) => reveal_element(curr.e, curr.t)(acc),
+ open_section)(s);
+}
+
+export function hide_photo() {
+ enable_scroll();
+ hide_element(c.photo_layer);
+}
+
+export function photo_layer_visible() {
+ return is_visible(c.photo_layer);
+}
+
+function fill_containers(l) {
+ l.forEach(s => {
+ let i = s.replaceAll("-", "_");
+ c[i] = document.getElementById(s);
+ });
+}
+
+export function init_dom(photos) {
+ fill_containers(["logo",
+ "carousel",
+ "carousel-grid",
+ "carousel-title",
+ "nav-links",
+ "nav-text",
+ "photo-layer",
+ "photo-frame",
+ "side-bar",
+ "thumb-layer",
+ "footer"]);
+
+ c.photo_layer.addEventListener("click", () => {
+ event.stopPropagation();
+ hide_photo();
+ });
+
+ // c.carousel_grid.addEventListener("wheel", (e) => {
+ // e.preventDefault();
+ // c.carousel_grid.scrollLeft += e.deltaY * 5;
+ // });
+
+ // let section_list = [];
+ let section = "";
+ let section_id = "";
+
+ photos.forEach((p, _i) => {
+ p.thm = memo(make_thumbnail, p);
+ p.img = memo(make_picture, p);
+
+ // this branch can't run on the first loop
+ // so grid will always be non null
+ if (section === p.date) {
+ photo_book.get(section_id).push(p.thm);
+ } else {
+ section = p.date;
+ section_id = section.toLowerCase().replaceAll(" ", "-");
+ // section_list.push(p.date);
+ add_nav_link(section, section_id);
+ photo_book.set(section_id, [ p.thm ]);