-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
3 lines (3 loc) · 36.6 KB
/
Copy pathscript.js
File metadata and controls
3 lines (3 loc) · 36.6 KB
1
2
3
(()=>{var J=null;async function le(){return J=await(await fetch("/data/site.json")).json(),J}function U(){return J}function re(e){let n=e.trim().split(`
`),s=n[0].split(","),i=[];for(let l=1;l<n.length;l++){let r=n[l].split(","),c={};s.forEach((o,a)=>{c[o]=r[a]}),i.push(c)}return i}var I={baseball:'<svg width="24" height="24" viewBox="0 0 32 32" fill="currentColor"><path d="M26.08 5A14.37 14.37 0 0 0 16 1 14.3 14.3 0 0 0 6 5a14.68 14.68 0 0 0-5 11 15 15 0 0 0 4.93 11.09A14.62 14.62 0 0 0 16 31a14.57 14.57 0 0 0 10.05-3.9A15 15 0 0 0 31 16a14.68 14.68 0 0 0-4.92-11ZM29 16a13 13 0 0 1-3.62 9 13 13 0 0 1-2.12-3 1 1 0 1 0 0-2h-.86a12.76 12.76 0 0 1-.59-3h.45a1 1 0 1 0 0-2h-.45a12.56 12.56 0 0 1 .59-3h.86a1 1 0 1 0 0-2 12.51 12.51 0 0 1 2.12-2.89A12.7 12.7 0 0 1 29 16ZM3 16a12.71 12.71 0 0 1 3.62-8.89A12.51 12.51 0 0 1 8.74 10a1 1 0 0 0 0 2h.86a12.56 12.56 0 0 1 .59 3h-.44a1 1 0 0 0 0 2h.44a12.76 12.76 0 0 1-.59 3h-.86a1 1 0 0 0 0 2 13 13 0 0 1-2.12 3A13 13 0 0 1 3 16Zm5.09 10.3A14.88 14.88 0 0 0 11 22h.77a1 1 0 1 0 0-2h-.07a15.19 15.19 0 0 0 .52-3h.56a1 1 0 0 0 0-2h-.56a15.07 15.07 0 0 0-.52-3h.07a1 1 0 1 0 0-2H11a14.39 14.39 0 0 0-2.91-4.25A12.43 12.43 0 0 1 16 3a12.43 12.43 0 0 1 7.91 2.75A14.39 14.39 0 0 0 21 10h-.77a1 1 0 0 0 0 2h.07a15.07 15.07 0 0 0-.52 3h-.55a1 1 0 0 0 0 2h.55a15.19 15.19 0 0 0 .52 3h-.07a1 1 0 0 0 0 2H21a14.88 14.88 0 0 0 2.88 4.3A12.7 12.7 0 0 1 16 29a12.66 12.66 0 0 1-7.91-2.7Z"/></svg>',pen:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="M2 2l7.586 7.586"/><circle cx="11" cy="11" r="2"/></svg>',code:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>',microphone:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="22"/></svg>',coffee:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 8h1a4 4 0 0 1 0 8h-1"/><path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"/><line x1="6" y1="1" x2="6" y2="4"/><line x1="10" y1="1" x2="10" y2="4"/><line x1="14" y1="1" x2="14" y2="4"/></svg>',book:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>',headphones:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 18v-6a9 9 0 0 1 18 0v6"/><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"/></svg>',chess:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 16l-1.447.724a1 1 0 0 0-.553.894V20h12v-2.382a1 1 0 0 0-.553-.894L16 16"/><path d="M8.5 16a6.5 6.5 0 1 1 7 0"/><path d="M12 2v4"/><path d="M10 4h4"/></svg>',lightbulb:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18h6"/><path d="M10 22h4"/><path d="M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14"/></svg>',twitter:'<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>',email:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>',resume:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>',linkedin:'<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>',substack:'<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M22.539 8.242H1.46V5.406h21.08v2.836zM1.46 10.812V24L12 18.11 22.54 24V10.812H1.46zM22.54 0H1.46v2.836h21.08V0z"/></svg>',github:'<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>',instagram:'<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>',externalLink:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>',arrow:'<span class="arrow">\u2192</span>',retweet:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 1l4 4-4 4"/><path d="M3 11V9a4 4 0 0 1 4-4h14"/><path d="M7 23l-4-4 4-4"/><path d="M21 13v2a4 4 0 0 1-4 4H3"/></svg>',heart:'<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>',bookmark:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/></svg>'};function t(e,n={},s=[]){let i=document.createElement(e);return Object.entries(n).forEach(([l,r])=>{l==="className"?i.className=r:l==="textContent"?i.textContent=r:l.startsWith("data")?i.dataset[l.slice(4).toLowerCase()]=r:i.setAttribute(l,r)}),s.forEach(l=>{typeof l=="string"?i.appendChild(document.createTextNode(l)):l&&i.appendChild(l)}),i}function B(e,n){e.innerHTML=n}function k(e){let n=document.createElement("span");return n.className="icon-wrapper",B(n,I[e]||""),n}function j(e){let n=localStorage.getItem("theme")||"hopkins";return e.profile.headshots&&e.profile.headshots[n]?e.profile.headshots[n]:e.profile.headshot}function de(e,n,s={}){let{extraClass:i="",excludePlatforms:l=[],includeResumeCta:r=!1,reuseExisting:c=!1}=s,o=c?e.querySelector(".hero-intro"):null,a=!!o;if(!o){let x=i?`hero-intro ${i}`:"hero-intro";o=t("div",{className:x})}let d=o.querySelector("script");d&&d.remove();let p=c?document.getElementById("hero-headshot-img"):null;p?(p.src=j(n),p.alt=n.profile.name):(p=t("img",{src:j(n),alt:n.profile.name,className:"hero-headshot",fetchpriority:"high",width:100,height:100}),o.appendChild(p));let v=c?o.querySelector(".hero-name"):null;v||(v=t("h1",{className:"hero-name"}),o.appendChild(v)),v.textContent=n.profile.name;let f=c?o.querySelector(".hero-description"):null;f||(f=t("p",{className:"hero-description"}),o.appendChild(f)),f.textContent=n.profile.bio;let u=c?o.querySelector(".social-links"):null;return u||(u=t("div",{className:"social-links"}),o.appendChild(u)),n.socials.forEach(x=>{if(l.includes(x.platform))return;let M=x.url.startsWith("http"),H={href:x.url};M&&(H.target="_blank",H.rel="noopener noreferrer");let A=t("a",H);A.setAttribute("aria-label",x.label),x.platform==="resume"&&r?(A.classList.add("resume-cta"),A.appendChild(t("span",{textContent:"R\xE9sum\xE9"}))):A.appendChild(k(x.platform)),u.appendChild(A)}),a||e.appendChild(o),o}function ce(e){let n=document.querySelector("header");if(!n)return;let s=t("nav",{className:"container"}),i=t("a",{href:"#top",className:"logo"}),l=t("img",{src:j(e),alt:e.profile.name,className:"logo-headshot"}),r=t("span",{className:"logo-text",textContent:e.profile.name});i.appendChild(l),i.appendChild(r),s.appendChild(i);let c=t("div",{className:"nav-links"});e.sections.forEach(o=>{let a=t("a",{href:`#${o.id}`});a.dataset.section=o.id;let d=t("span",{className:"nav-icon"});d.appendChild(k(o.icon)),a.appendChild(d),a.appendChild(t("span",{className:"nav-text",textContent:o.title})),c.appendChild(a)}),s.appendChild(c),n.textContent="",n.appendChild(s)}var Le={field:"On the Field",writing:"On the Page",lab:"In the Lab",media:"In the Media",offtheClock:"Off the Clock"};function pe(e){let n=document.getElementById("about");if(!n)return;let s=n.querySelector(".container");s||(s=t("div",{className:"container"}),n.appendChild(s)),de(s,e,{includeResumeCta:!0,reuseExisting:!0});let i=s.querySelector(".social-links"),l=i?.querySelector(".evolution-cta");i&&!l&&(l=t("a",{href:"/evolution/",className:"evolution-cta"}),l.textContent="Evolution",i.appendChild(l));let r=s.querySelector(".hero-nav");r||(r=t("nav",{className:"hero-nav"}),s.appendChild(r)),e.sections.forEach(c=>{let o=t("a",{href:`#${c.id}`,className:"hero-nav-item"});o.dataset.section=c.id,o.style.setProperty("--section-accent",c.accentColor);let a=t("div",{className:"hero-nav-icon"});a.appendChild(k(c.icon)),o.appendChild(a);let d=t("div",{className:"hero-nav-text"}),p=Le[c.id]||c.title;d.appendChild(t("span",{className:"hero-nav-label",textContent:p})),c.subtitle&&d.appendChild(t("span",{className:"hero-nav-subtitle",textContent:c.subtitle})),o.appendChild(d),o.appendChild(t("span",{className:"hero-nav-arrow",textContent:"\u2193"})),r.appendChild(o)}),s.classList.add("rendered")}function he(e){let n=document.querySelector("footer");if(!n)return;let s=t("div",{className:"container"}),i=t("div",{className:"footer-content"}),l=t("div",{className:"theme-switcher"});l.appendChild(t("span",{className:"theme-label",textContent:"Team colors"}));let r=t("div",{className:"theme-switcher-buttons"});e.footer.themes.forEach(c=>{let o=t("button",{className:"theme-btn",textContent:c.label});o.dataset.theme=c.id,r.appendChild(o)}),l.appendChild(r),i.appendChild(l),s.appendChild(i),n.textContent="",n.appendChild(s)}function me(e){let n=document.createElement("div");n.className="content-grid-wrapper",e.parentNode.insertBefore(n,e),n.appendChild(e);function s(){let{scrollLeft:i,scrollWidth:l,clientWidth:r}=e,c=i<l-r-10;n.classList.toggle("has-overflow-right",c)}setTimeout(s,0),e.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s,{passive:!0})}function ue(e,n){let s=document.createElement("p");s.textContent=n,s.style.color="var(--text-muted)",s.style.fontStyle="italic",e.appendChild(s)}function P(e){let[n,s,i]=e.split("-");return new Date(n,s-1,i).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function T(e,n){let[s,i,l]=e.split("-"),r=new Date(s,i-1,l),a=(new Date-r)/(1e3*60*60*24);return a<=n&&a>=0}function W(e){return e.sort((n,s)=>{if(n.pinned&&!s.pinned)return-1;if(!n.pinned&&s.pinned)return 1;let[i,l,r]=n.date.split("-"),[c,o,a]=s.date.split("-");return new Date(c,o-1,a)-new Date(i,l-1,r)})}function K(e){let n=typeof e=="string"?document.getElementById(e):e;if(!n)return;let s=document.createElement("p");s.textContent="Content not available.",s.style.color="var(--text-muted)",s.style.fontStyle="italic",n.appendChild(s)}function Q(e,n,s={}){let i=typeof e=="string"?document.getElementById(e):e;if(!i)return;i.textContent="",s.containerClass&&(i.className=s.containerClass);let l=s.emptyMessage||"No items to display yet.";if(!n||n.length===0){ue(i,l);return}let r;s.type==="projects"?r=n.sort((c,o)=>c.pinned&&!o.pinned?-1:!c.pinned&&o.pinned?1:(o.stars||0)-(c.stars||0)):r=W(n),r.forEach(c=>{let o;switch(s.type){case"projects":o=Me(c);break;case"tweets":o=Ae(c,s.handle);break;default:o=Be(c)}i.appendChild(o)}),me(i)}function Ce(e,n){Q(e,n,{type:"projects",emptyMessage:"No projects to display yet."})}function fe(e,n){Q(e,n,{type:"content",emptyMessage:"No items to display yet."})}function ge(e,n,s){Q(e,n,{type:"tweets",emptyMessage:"No tweets to display yet.",handle:s})}var Se={JavaScript:"#f1e05a",Python:"#3572A5",TypeScript:"#3178c6",Swift:"#F05138",Java:"#b07219","C++":"#f34b7d",C:"#555555","C#":"#178600",Ruby:"#701516",Go:"#00ADD8",Rust:"#dea584",PHP:"#4F5D95",HTML:"#e34c26",CSS:"#563d7c",Shell:"#89e051",Kotlin:"#A97BFF",R:"#198CE7",Jupyter:"#DA5B0B"};function Me(e){let n=document.createElement("a");n.className=e.pinned?"content-card project-card pinned":"content-card project-card",n.href=e.url,n.target="_blank",n.rel="noopener noreferrer";let s=document.createElement("h3");s.textContent=e.title,n.appendChild(s);let i=e.date&&T(e.date,30),l=e.url&&e.url.includes("gist.github.com");if(i||e.pinned||l){let o=document.createElement("div");if(o.className="card-badge-row",e.pinned){let a=document.createElement("span");a.className="pinned-badge",a.textContent="Pinned",o.appendChild(a)}if(i){let a=document.createElement("span");a.className="new-badge",a.textContent="New",o.appendChild(a)}if(l){let a=document.createElement("span");a.className="gist-badge",a.textContent="Gist",o.appendChild(a)}n.appendChild(o)}let r=document.createElement("div");if(r.className="project-content",e.description&&e.description.trim()){let o=document.createElement("p");o.className="card-description",o.textContent=e.description,r.appendChild(o)}if(e.topics&&e.topics.length>0){let o=document.createElement("div");o.className="project-topics",e.topics.slice(0,3).forEach(a=>{let d=document.createElement("span");d.className="project-topic",d.textContent=a,o.appendChild(d)}),r.appendChild(o)}if(n.appendChild(r),e.language||e.stars!==void 0||e.forks!==void 0){let o=document.createElement("div");if(o.className="project-stats",e.language){let a=document.createElement("span");a.className="project-language";let d=Se[e.language]||"#858585",p=document.createElement("span");p.className="language-dot",p.style.backgroundColor=d,a.appendChild(p),a.appendChild(document.createTextNode(e.language)),o.appendChild(a)}if(e.stars!==void 0){let a=document.createElement("span");a.className="project-stat";let d=document.createElement("span");d.className="icon-wrapper",B(d,'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z"/></svg>'),a.appendChild(d);let p=document.createElement("span");p.textContent=e.stars,a.appendChild(p),o.appendChild(a)}if(e.forks!==void 0){let a=document.createElement("span");a.className="project-stat";let d=document.createElement("span");d.className="icon-wrapper",B(d,'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"/></svg>'),a.appendChild(d);let p=document.createElement("span");p.textContent=e.forks,a.appendChild(p),o.appendChild(a)}n.appendChild(o)}return n}function Ae(e,n){let s=document.createElement("a");s.className=e.pinned?"tweet-card pinned":"tweet-card",s.href=e.url,s.target="_blank",s.rel="noopener noreferrer";let i=document.createElement("div");i.className="tweet-header";let l=document.createElement("div");l.className="tweet-handle",l.textContent=`@${n}`,i.appendChild(l);let r=document.createElement("span");r.className="tweet-date",r.textContent=P(e.date),i.appendChild(r),s.appendChild(i);let c=T(e.date,30);if(c||e.pinned){let f=document.createElement("div");if(f.className="card-badge-row",e.pinned){let u=document.createElement("span");u.className="pinned-badge",u.textContent="Pinned",f.appendChild(u)}if(c){let u=document.createElement("span");u.className="new-badge",u.textContent="New",f.appendChild(u)}s.appendChild(f)}let o=document.createElement("div");o.className="tweet-content";let a=document.createElement("p");a.className="tweet-text";let d=e.text||e.title;if(d.length>280&&(d=d.substring(0,280).trim()+"..."),d.split(/(@\w+)/g).forEach(f=>{if(f.startsWith("@")){let u=document.createElement("span");u.className="tweet-mention",u.textContent=f,a.appendChild(u)}else a.appendChild(document.createTextNode(f))}),o.appendChild(a),s.appendChild(o),e.retweets!==void 0||e.likes!==void 0||e.bookmarks!==void 0){let f=document.createElement("div");if(f.className="tweet-stats",e.retweets!==void 0){let u=document.createElement("span");u.className="tweet-stat",u.appendChild(k("retweet")),u.appendChild(document.createTextNode(e.retweets.toLocaleString())),f.appendChild(u)}if(e.likes!==void 0){let u=document.createElement("span");u.className="tweet-stat",u.appendChild(k("heart")),u.appendChild(document.createTextNode(e.likes.toLocaleString())),f.appendChild(u)}if(e.bookmarks!==void 0){let u=document.createElement("span");u.className="tweet-stat",u.appendChild(k("bookmark")),u.appendChild(document.createTextNode(e.bookmarks.toLocaleString())),f.appendChild(u)}s.appendChild(f)}return s}function Be(e){let n=document.createElement("a");n.className=e.pinned?"content-card pinned":"content-card",n.href=e.url,n.target="_blank",n.rel="noopener noreferrer";let s=T(e.date,30),i=s||e.pinned;if(e.thumbnail){let a=document.createElement("div");a.className="thumbnail-wrapper";let d=document.createElement("img");if(d.className="thumbnail",d.src=e.thumbnail,d.alt=e.title,d.loading="lazy",d.referrerPolicy="no-referrer",d.onerror=()=>{d.style.display="none",a.classList.add("thumbnail-error")},a.appendChild(d),i){let p=document.createElement("div");if(p.className="card-badge-overlay",e.pinned){let v=document.createElement("span");v.className="pinned-badge",v.textContent="Pinned",p.appendChild(v)}if(s){let v=document.createElement("span");v.className="new-badge",v.textContent="New",p.appendChild(v)}a.appendChild(p)}n.appendChild(a)}let l=document.createElement("div");l.className="card-meta-row";let r=document.createElement("div");r.className="card-meta-left";let c=document.createElement("span");if(c.className="date",c.textContent=P(e.date),r.appendChild(c),!e.thumbnail&&i){if(e.pinned){let a=document.createElement("span");a.className="pinned-badge",a.textContent="Pinned",r.appendChild(a)}if(s){let a=document.createElement("span");a.className="new-badge",a.textContent="New",r.appendChild(a)}}if(l.appendChild(r),e.source){let a=document.createElement("span");a.className="source",a.textContent=e.source,l.appendChild(a)}n.appendChild(l);let o=document.createElement("h3");if(o.textContent=e.title,n.appendChild(o),e.authors&&e.authors.length>0){let a=document.createElement("div");a.className="authors",a.textContent=e.authors.join(", "),n.appendChild(a)}if(e.retweets!==void 0||e.likes!==void 0||e.bookmarks!==void 0){let a=document.createElement("div");if(a.className="tweet-stats",e.retweets!==void 0){let d=document.createElement("span");d.className="tweet-stat";let p=document.createElement("span");p.className="tweet-stat-icon",B(p,I.retweet),d.appendChild(p),d.appendChild(document.createTextNode(e.retweets.toLocaleString())),a.appendChild(d)}if(e.likes!==void 0){let d=document.createElement("span");d.className="tweet-stat";let p=document.createElement("span");p.className="tweet-stat-icon",B(p,I.heart),d.appendChild(p),d.appendChild(document.createTextNode(e.likes.toLocaleString())),a.appendChild(d)}if(e.bookmarks!==void 0){let d=document.createElement("span");d.className="tweet-stat";let p=document.createElement("span");p.className="tweet-stat-icon",B(p,I.bookmark),d.appendChild(p),d.appendChild(document.createTextNode(e.bookmarks.toLocaleString())),a.appendChild(d)}n.appendChild(a)}if(e.description&&e.description.trim()){let a=document.createElement("p");a.className="card-description",a.textContent=e.description,n.appendChild(a)}return n}async function ve(e){let n=document.querySelector("main"),s=e.sections.map(async(l,r)=>{let c=t("section",{id:l.id,className:"content-section"+(r%2===0?" alt-bg":"")});return l.type==="stats"?await He(c,l,e):l.type==="personal"?await Te(c,l,e):await Ie(c,l,e),c});(await Promise.all(s)).forEach(l=>n.appendChild(l))}async function He(e,n,s){let l=await(await fetch("/"+n.statsFile)).text(),r=re(l),c={College:r.find(h=>h.Season==="College Career"),Independent:r.find(h=>h.Season==="Independent Career"),Minors:r.find(h=>h.Season==="Minors Career")},o=r.filter(h=>/^\d{4}$/.test(h.Season)&&/\d+\s*teams?$/i.test(h.Team)),a={"Rk+":"level-roa","A-":"level-a-short","A+":"level-a-plus",AA:"level-aa",AAA:"level-aaa",NCAA:"level-ncaa",Independent:"level-independent"},d={Mets:"org-mets",Phillies:"org-phillies","Johns Hopkins":"org-hopkins",Westside:"org-westside",Baltimore:"org-baltimore"},p={Mets:"NYM",Phillies:"PHI","Johns Hopkins":"JHU",Westside:"WWM",Baltimore:"Baltimore Dodgers"},v={NCAA:"College",Independent:"Independent","Rk+":"Minors","A-":"Minors","A+":"Minors",AA:"Minors",AAA:"Minors"},f={};r.forEach(h=>{if(/^\d{4}$/.test(h.Season)&&!/\d+\s*teams?$/i.test(h.Team)){let m=v[h.Level]||h.Level,C=`${h.Season}-${m}`;f[C]||(f[C]=[]);let w=h.Level;f[C].includes(w)||f[C].push(w)}});let u={ERA:"ERA","W-L":"W-L Record",G:"Games",IP:"Innings",SO:"Strikeouts",WHIP:"WHIP"},x=t("div",{className:"container"}),M=t("div",{className:"section-header"}),H=t("a",{href:`#${n.id}`,className:`section-icon ${n.id}-icon`});H.appendChild(k(n.icon)),M.appendChild(H);let A=t("div");A.appendChild(t("h2",{textContent:n.title})),A.appendChild(t("p",{className:"section-subtitle",textContent:n.subtitle})),M.appendChild(A),x.appendChild(M),n.description&&x.appendChild(t("p",{className:"section-intro",textContent:n.description}));let R=t("div",{className:"subsection"}),q=t("div",{className:"subsection-header"});q.appendChild(t("h3",{textContent:"Career Stats"}));let X={Minors:n.statsLinks.find(h=>h.name==="MiLB"),College:n.statsLinks.find(h=>h.name==="BBRef"),Independent:n.statsLinks.find(h=>h.name==="BBRef")},$=t("a",{href:X.Minors?.url||"#",target:"_blank",rel:"noopener noreferrer",className:"view-all-link",textContent:"View MiLB"});q.appendChild($),R.appendChild(q);let D={};o.forEach(h=>{let m=h.Level,C=parseInt(h.Season,10);D[m]||(D[m]=[]),D[m].push(C)});let be=h=>{let m=D[h]||[];if(m.length===0)return"";let C=Math.min(...m),w=Math.max(...m);if(C===w)return`${C}`;let b=String(w).slice(-2);return`${C}-${b}`},V=t("div",{className:"stats-category-selector"});["College","Independent","Minors"].forEach(h=>{let m=t("button",{className:`stats-category-btn${h==="Minors"?" active":""}`});m.dataset.category=h;let C=t("span",{className:"stats-category-name",textContent:h}),w=t("span",{className:"stats-category-years",textContent:be(h)});m.appendChild(C),m.appendChild(w),V.appendChild(m)}),R.appendChild(V);let ee=h=>{let m=c[h];return{ERA:m?.ERA||"-","W-L":m?`${m.W}-${m.L}`:"-",G:m?.G||"-",IP:m?.IP||"-",SO:m?.SO||"-",WHIP:m?.WHIP||"-"}},_=t("div",{className:"stats-overview"}),Ee=ee("Minors");n.statsHighlights.forEach(h=>{let m=t("div",{className:"stat-card-large"}),C=t("div",{className:"stat-value",textContent:Ee[h]});C.dataset.stat=h,m.appendChild(C),m.appendChild(t("div",{className:"stat-label",textContent:u[h]})),_.appendChild(m)}),R.appendChild(_);let ke={College:{name:"NCAA D3",className:"league-ncaa"},Independent:{name:"USPBL",className:"league-independent"}},te=t("div",{className:"stats-table-wrapper"}),z=t("table",{className:"stats-table"}),O=t("thead"),ne=t("tr");["Year","Org","Levels","W","L","ERA","G","SV","IP","H","SO","BB","WHIP"].forEach(h=>{let m=t("th",{textContent:h});h==="Org"&&(m.dataset.column="team"),h==="Levels"&&(m.dataset.column="levels"),ne.appendChild(m)}),O.appendChild(ne),z.appendChild(O);let G=t("tbody");o.forEach(h=>{let m=t("tr"),C=h.Level;m.dataset.category=C,C!=="Minors"&&(m.style.display="none"),m.appendChild(t("td",{textContent:h.Season}));let w=t("td");if(h.Org&&h.Org!=="-"){let N=p[h.Org]||h.Org,g=t("span",{className:`org-badge ${d[h.Org]||""}`,textContent:N});w.appendChild(g)}m.appendChild(w);let b=t("td");if(C==="Minors"){let N=`${h.Season}-${C}`;(f[N]||[]).forEach(g=>{let y=t("span",{className:`level-badge ${a[g]||""}`,textContent:g});b.appendChild(y),b.appendChild(document.createTextNode(" "))})}else{let N=ke[C];if(N){let g=t("span",{className:`league-badge ${N.className}`,textContent:N.name});b.appendChild(g)}}m.appendChild(b),["W","L","ERA","G","SV","IP","H","SO","BB","WHIP"].forEach(N=>{let g=h[N];N==="SV"&&(g==="-"||g==="")&&(g="0"),m.appendChild(t("td",{textContent:g}))}),G.appendChild(m)}),z.appendChild(G);let F=t("tfoot");if(["College","Independent","Minors"].forEach(h=>{let m=c[h];if(!m)return;let C=t("tr");C.dataset.category=h,h!=="Minors"&&(C.style.display="none"),C.appendChild(t("td")),C.appendChild(t("td")),C.appendChild(t("td")),["W","L","ERA","G","SV","IP","H","SO","BB","WHIP"].forEach(w=>{let b=m?.[w]||"-";w==="SV"&&(b==="-"||b==="")&&(b="0");let N=t("td");N.appendChild(t("strong",{textContent:b})),C.appendChild(N)}),F.appendChild(C)}),z.appendChild(F),te.appendChild(z),R.appendChild(te),V.addEventListener("click",h=>{let m=h.target.closest(".stats-category-btn");if(!m)return;let C=m.dataset.category;V.querySelectorAll(".stats-category-btn").forEach(y=>{y.classList.toggle("active",y===m)});let w=O.querySelector('th[data-column="team"]'),b=O.querySelector('th[data-column="levels"]');w&&(w.textContent=C==="Minors"?"Org":"Team"),b&&(b.textContent=C==="Minors"?"Levels":"League");let N=ee(C);_.querySelectorAll(".stat-value").forEach(y=>{let S=y.dataset.stat;y.textContent=N[S]});let g=X[C];g&&($.href=g.url,$.textContent=C==="Minors"?"View MiLB":"View BBRef"),G.querySelectorAll("tr").forEach(y=>{y.style.display=y.dataset.category===C?"":"none"}),F.querySelectorAll("tr").forEach(y=>{y.style.display=y.dataset.category===C?"":"none"})}),x.appendChild(R),n.trainingFile)try{let m=await(await fetch("/"+n.trainingFile)).json();if(m&&m.length>0){let C=t("div",{className:"subsection"}),w=t("div",{className:"subsection-header"});w.appendChild(t("h3",{textContent:"My Training"}));let b=t("a",{href:"/evolution",className:"view-all-link",textContent:"View Evolution"});w.appendChild(b),C.appendChild(w);let N=t("div",{className:"content-grid"});W(m).forEach(g=>{if(g.type==="video"){let y=g.url?t("a",{href:g.url,target:"_blank",rel:"noopener noreferrer",className:"training-card-link"}):null,S=t("div",{className:"training-card"});if(g.poster){let E=t("div",{className:"training-bg-wrapper"}),L=t("img",{src:g.poster,alt:"Training video thumbnail",loading:"lazy"});L.onerror=()=>{E.remove(),S.classList.add("no-poster")},E.appendChild(L),S.appendChild(E);let oe=t("div",{className:"training-bg-overlay"});S.appendChild(oe)}let Z=t("div",{className:"training-header"});if(g.credit){let E=t("div",{className:"training-handle",textContent:`@${g.credit.handle}`});Z.appendChild(E)}if(g.date){let E=t("span",{className:"training-date",textContent:P(g.date)});Z.appendChild(E)}S.appendChild(Z);let ae=g.date&&T(g.date,30);if(ae||g.pinned){let E=t("div",{className:"card-badge-row"});if(g.pinned){let L=t("span",{className:"pinned-badge",textContent:"Pinned"});E.appendChild(L)}if(ae){let L=t("span",{className:"new-badge",textContent:"New"});E.appendChild(L)}S.appendChild(E)}let se=t("div",{className:"training-card-content"});if(g.caption){let E=t("p",{className:"training-caption"}),L=g.caption;L.length>280&&(L=L.substring(0,280).trim()+"..."),L.split(/(@\w+)/g).forEach(Y=>{if(Y.startsWith("@")){let ie=t("span",{className:"training-mention"});ie.textContent=Y,E.appendChild(ie)}else E.appendChild(document.createTextNode(Y))}),se.appendChild(E)}S.appendChild(se),y?(y.appendChild(S),N.appendChild(y)):N.appendChild(S)}}),C.appendChild(N),x.appendChild(C)}}catch(h){console.error("Error loading training data:",h)}e.appendChild(x)}async function Ie(e,n,s){let i=t("div",{className:"container"}),l=t("div",{className:"section-header"}),r=t("a",{href:`#${n.id}`,className:`section-icon ${n.id}-icon`});r.appendChild(k(n.icon)),l.appendChild(r);let c=t("div");if(c.appendChild(t("h2",{textContent:n.title})),c.appendChild(t("p",{className:"section-subtitle",textContent:n.subtitle})),l.appendChild(c),i.appendChild(l),n.description&&i.appendChild(t("p",{className:"section-intro",textContent:n.description})),n.topics&&n.topics.length>0){let a=t("div",{className:"section-topics"});n.topicsLabel&&a.appendChild(t("span",{className:"section-topics-label",textContent:n.topicsLabel}));let d=t("div",{className:"section-topics-tags"});n.topics.forEach(p=>{d.appendChild(t("span",{className:"section-topic-tag",textContent:p}))}),a.appendChild(d),i.appendChild(a)}let o=n.subsections.map(a=>{let d=t("div",{className:"subsection"}),p=t("div",{className:"subsection-header"});if(p.appendChild(t("h3",{textContent:a.title})),a.viewAllUrl){let u=t("a",{href:a.viewAllUrl,target:"_blank",className:"view-all-link",textContent:a.viewAllLabel});p.appendChild(u)}d.appendChild(p);let v=a.displayType==="projects"?"content-grid content-grid--projects":"content-grid",f=t("div",{className:v});return d.appendChild(f),i.appendChild(d),fetch("/"+a.dataFile).then(u=>u.json()).then(u=>{a.displayType==="projects"?Ce(f,u):a.displayType==="tweets"?ge(f,u,a.handle):fe(f,u)}).catch(()=>{K(f)})});await Promise.all(o),e.appendChild(i)}async function Te(e,n,s){let i=t("div",{className:"container"}),l=t("div",{className:"section-header"}),r=t("a",{href:`#${n.id}`,className:`section-icon ${n.id}-icon`});r.appendChild(k(n.icon)),l.appendChild(r);let c=t("div");c.appendChild(t("h2",{textContent:n.title})),c.appendChild(t("p",{className:"section-subtitle",textContent:n.subtitle})),l.appendChild(c),i.appendChild(l);try{let a=await(await fetch("/"+n.dataFile)).json(),d=t("div",{className:"content-grid"});if(a.reading){let p=t("a",{href:a.reading.book.url,target:"_blank",rel:"noopener noreferrer",className:"personal-card"}),v=t("div",{className:"personal-card-icon"});v.appendChild(k("book")),p.appendChild(v),p.appendChild(t("h3",{className:"personal-card-title",textContent:a.reading.title}));let f=t("img",{src:a.reading.book.cover,alt:a.reading.book.title,className:"personal-cover",loading:"lazy"});p.appendChild(f),p.appendChild(t("p",{className:"personal-item-title",textContent:a.reading.book.title})),p.appendChild(t("p",{className:"personal-item-subtitle",textContent:a.reading.book.author})),d.appendChild(p)}if(a.listening){let p=t("a",{href:a.listening.album.url,target:"_blank",rel:"noopener noreferrer",className:"personal-card"}),v=t("div",{className:"personal-card-icon"});v.appendChild(k("headphones")),p.appendChild(v),p.appendChild(t("h3",{className:"personal-card-title",textContent:a.listening.title}));let f=t("img",{src:a.listening.album.cover,alt:a.listening.album.title,className:"personal-cover",loading:"lazy"});p.appendChild(f),p.appendChild(t("p",{className:"personal-item-title",textContent:a.listening.album.title})),p.appendChild(t("p",{className:"personal-item-subtitle",textContent:a.listening.album.artist})),d.appendChild(p)}if(a.chess){let p=t("div",{className:"personal-card personal-card-multi"}),v=t("div",{className:"personal-card-icon"});v.appendChild(k("chess")),p.appendChild(v),p.appendChild(t("h3",{className:"personal-card-title",textContent:a.chess.title}));let f=t("div",{className:"personal-card-links"});Object.values(a.chess.links).forEach(u=>{let x=t("a",{href:u.url,target:"_blank",rel:"noopener noreferrer",className:"personal-card-link"});x.appendChild(t("span",{className:"personal-link-label",textContent:u.label}));let M=t("span",{className:"personal-link-rating-container"});M.appendChild(t("span",{className:"personal-link-type",textContent:u.ratingType})),M.appendChild(t("span",{className:"personal-link-rating",textContent:u.rating})),x.appendChild(M),f.appendChild(x)}),p.appendChild(f),d.appendChild(p)}i.appendChild(d)}catch{K(i)}e.appendChild(i)}function we(){let e=document.querySelectorAll(".theme-btn"),n=localStorage.getItem("theme")||"hopkins",s=U(),i=window.__themeConfig?.colors||{driveline:"#0a0a0a",hopkins:"#0a0e1a",mets:"#0a1428",phillies:"#120a0c"};function l(r){document.documentElement.setAttribute("data-theme",r);let c=document.querySelector('meta[name="theme-color"]');if(c&&c.setAttribute("content",i[r]||i.hopkins),document.body.style.backgroundColor=i[r]||i.hopkins,s&&s.profile.headshots){let o=s.profile.headshots[r]||s.profile.headshot;document.querySelectorAll(".hero-headshot, .logo-headshot").forEach(a=>{a.src=o})}}l(n),e.forEach(r=>{r.dataset.theme===n&&r.classList.add("active"),r.addEventListener("click",()=>{let c=r.dataset.theme;l(c),localStorage.setItem("theme",c),e.forEach(o=>o.classList.remove("active")),r.classList.add("active")})})}function Ne(){let e=document.querySelectorAll(".content-section"),n=new IntersectionObserver(s=>{s.forEach(i=>{i.isIntersecting?i.target.classList.add("revealed"):i.boundingClientRect.top>0&&i.target.classList.remove("revealed")})},{threshold:.1,rootMargin:"-50px 0px"});e.forEach(s=>{n.observe(s)})}function xe(){document.querySelectorAll('a[href^="#"]').forEach(o=>{o.addEventListener("click",a=>{a.preventDefault();let d=document.querySelector(o.getAttribute("href"));d&&d.scrollIntoView({behavior:"smooth",block:"start"})})});let e=document.querySelector("header"),n=document.querySelectorAll("section[id]"),s=document.querySelectorAll(".nav-links a[data-section]"),i=400,l=[];window.__recacheLayoutValues=r;function r(){let o=document.querySelector("section.content-section");o&&(i=o.offsetTop-100),l=Array.from(n).map(a=>({id:a.getAttribute("id"),top:a.offsetTop,bottom:a.offsetTop+a.offsetHeight}))}function c(){let o=window.scrollY;e&&(o>i?e.classList.add("visible"):e.classList.remove("visible"));let a=o+150;for(let d of l)if(a>=d.top&&a<d.bottom){s.forEach(p=>{p.classList.remove("active"),p.getAttribute("data-section")===d.id&&p.classList.add("active")});break}}window.addEventListener("load",()=>{r(),c()}),window.addEventListener("resize",r,{passive:!0}),window.addEventListener("scroll",c,{passive:!0}),setTimeout(()=>{r(),c()},0)}function ye(e=600,n=null){let s=document.querySelector(".hero-headshot");s&&(setTimeout(()=>{s.classList.add("animation-ready")},e),s.addEventListener("click",()=>{if(s.classList.contains("animation-ready")){if(n){window.location.href=n;return}s.classList.remove("clicked","transitioning-out"),s.offsetWidth,s.classList.add("clicked"),setTimeout(()=>{s.classList.add("transitioning-out"),requestAnimationFrame(()=>{s.classList.remove("clicked"),setTimeout(()=>{s.classList.remove("transitioning-out")},300)})},300)}}))}async function Re(){try{let e=await le();ce(e),pe(e),await ve(e),he(e),we(),xe(),Ne(),window.__recacheLayoutValues&&window.__recacheLayoutValues()}catch(e){console.error("Error initializing site:",e)}}document.addEventListener("DOMContentLoaded",async()=>{history.scrollRestoration&&(history.scrollRestoration="manual"),window.scrollTo(0,0),!document.body.classList.contains("resume-page")&&!document.body.classList.contains("evolution-page")&&(await Re(),ye(600))});})();
//# sourceMappingURL=script.js.map