@@ -165,11 +165,9 @@ function makeTeaser(body, terms) {
165165function formatSearchResultTitle(item) {
166166 var pathArray = item.ref.split( '/' );
167167
168− // first directory is in 4th element of split path array
169168 var firstPartTitle = pathArray[3];
170169 let firstTitleCapitals = firstPartTitle.charAt(0).toUpperCase() + firstPartTitle.slice(1);
171170
172− // last directory is in 2nd to last element of array
173171 var lastPartTitle = item.doc.title;
174172
175173 var fullTitle = firstTitleCapitals + '<span class="gray1 dib pl2">' + ' / ' + lastPartTitle + '</span>';
@@ -390,22 +388,26 @@ window.addEventListener("scroll", event => {
390388 link.classList.remove("current");
391389 }
392390 });
391+})};
393392
394− // this is honestly weird UX when selecting a link,
395− // as every header flies open as you scroll.
396− // for later discussion and experimentation --
397− // may just need debouncing.
398− // Also still working out the logic for closing other summary
399− // headers as you scroll.
400−
401−// headers.forEach(summary => {
402−// let thisH2 = document.querySelector("h2#" + CSS.escape(summary.id));
403−// if (
404−// (thisH2.offsetTop <= fromTop) &&
405−// (thisH2.offsetTop + thisH2.offsetHeight > fromTop)
406−// ) {
407−// summary.parentElement.open = true;
408−// }
409−// })
410−//
411−})};
393+// homepage video load behaviour on mobile
394+
395+
396+if (document.body.classList.contains("index")) {
397+ if( navigator.userAgent.match(/Android/i)
398+ || navigator.userAgent.match(/webOS/i)
399+ || navigator.userAgent.match(/iPhone/i)
400+ || navigator.userAgent.match(/iPad/i)
401+ || navigator.userAgent.match(/iPod/i)
402+ || navigator.userAgent.match(/BlackBerry/i)
403+ || navigator.userAgent.match(/Windows Phone/i)
404+ ){
405+ } else {
406+ document.getElementById("landscapevid").innerHTML = `
407+ <source src="https://media.urbit.org/site/understanding-urbit/landscape.webm" type="video/webm">
408+ <source src="https://media.urbit.org/site/understanding-urbit/landscape.mp4" type="video/mp4">`;
409+ document.getElementById("oceanvid").innerHTML = `
410+ <source src="https://media.urbit.org/site/understanding-urbit/ocean.webm" type="video/webm">
411+ <source src="https://media.urbit.org/site/understanding-urbit/ocean.mp4" type="video/mp4">`;
412+ }
413+ }