PageSourceSearch

https://triunitystudios.com/js/layoutBuilder/dataFiller.js

js triunitystudios.com collected 2026-10-02 01:46:46 UTC 2,666 bytes, 57 lines download raw bytes

1import * as textUtils from "../utils/textUtils.js";
2import { fillWithData, displayAdditionalSections, displayContactInfo } from "./sectionFiller.js";
3import {
4  fillWithGroupedButtons,
5  onClickWorkType,
6  onClickWorkSkill,
7  enableCollapsibleSections,
8  enableTagExclusionToggle,
9  enableClearFiltersButton,
10  setWorkSearchQuery,
11} from "./workFilters.js";
12export { displayFilteredWorks } from "./workCards.js";
13
14// - Metadata
15fillWithData("page-title", "../data/info.json", "web-title", new Map(), false);
16fillWithData("page-description", "../data/info.json", "web-description", new Map(), false, "content");
17// - Hero
18// keepMatchingStaticFallback: the generated static hero mirrors this render;
19// keeping it when the text matches avoids replaying the heroIn animation.
20// KEEP IN SYNC: changing this render (the p->h1 mapping, or how the
21// introduction markdown is treated) requires the same change in
22// buildHeroHtml() in scripts/generateSeoBlocks.js, or the mirror breaks
23// (see the "SEO fallback replacement" bullet in ./CLAUDE.md).
24fillWithData("heroContent", "../data/info.json", "introduction", new Map([["p", "h1"]]), true, "", true);
25// - About me
26fillWithData("aboutMeTitle", "../data/info.json", "aboutMeTitle", new Map([["p", "h1"]]));
27fillWithData("aboutMeImage", "../data/info.json", "aboutMeImage", new Map(), false, "src");
28fillWithData("aboutMeContents", "../data/info.json", "aboutMe");
29// - Work filters
30fillWithGroupedButtons("myWorkTypes", "types", onClickWorkType, "myWork", false);
31fillWithGroupedButtons("myWorkSkills", "skills", onClickWorkSkill, "myWork", true);
32enableCollapsibleSections("myWorkSkills");
33// - Work search (free-text filter, combined with the type/skill buttons)
34document.getElementById("myWorkSearch")?.addEventListener("input", (event) => {
35  setWorkSearchQuery(/** @type {HTMLInputElement} */ (event.target).value);
36});
37// - One-click button that excludes the skill named in its data-tag-id, and the
38//   escape hatch that clears every filter
39enableTagExclusionToggle("myWorkExcludeToggle");
40enableClearFiltersButton("myWorkClearFilters");
41
42// Load the works title from the manifest
43(async () => {
44  const worksData = await textUtils.fetchAllWorks();
45  const titleElement = document.getElementById("myWorkTitle");
46  if (titleElement && worksData.title) {
47    const { setDataInHtmlElement } = await import("../utils/uiUtils.js");
48    const fragment = document.createDocumentFragment();
49    await setDataInHtmlElement(worksData.title, fragment, new Map([["p", "h1"]]));
50    titleElement.appendChild(fragment);
51  }
52})();
53
54// - Additional sections
55displayAdditionalSections();
56// - Contact info
57displayContactInfo();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.