-->
`;
const embedded = createRawHtml(rawHtml);
embedded.appendChild(appendScript("https://platform.twitter.com/widgets.js"));
return embedded;
}
function processSingleContentElement(contentElement) {
switch (contentElement.displayType) {
case 'section': return contentElement.elements.map(it => processSingleContentElement(it));
case 'paragraph': return createSimpleTextElement(contentElement.text);
case 'header': return createSimpleTextElement(contentElement.text, 'h' + contentElement.level);
case 'image': return createImage(contentElement);
case 'twitter': return createTwitter(contentElement);
case 'youtube': return createYoutube(contentElement);
default: return createSimpleTextElement(JSON.stringify(contentElement));
}
}
function fillContentIntoElement(createdElement, htmlEl) {
try {
console.log(createdElement, htmlEl);
if (createdElement.length) {
createdElement.forEach(ch => htmlEl.appendChild(ch));
} else {
htmlEl.appendChild(createdElement);
}
} catch (e) {
console.error(e.message);
}
}
function fillContent(contentElementsList, htmlElements) {
const contentElements = Array.from(contentElementsList);
console.log(contentElements);
const lastElementIndex = htmlElements.length - 1;
htmlElements.forEach((htmlEl, index) => {
htmlEl.innerHTML = '';
if(contentElements.length > index) {
if(index === lastElementIndex) {
contentElements.slice(index).forEach(ce => fillContentIntoElement(processSingleContentElement(ce),htmlEl))
} else {
const createdElement = processSingleContentElement(contentElements[index]);
fillContentIntoElement(createdElement, htmlEl);
}
}
});
}
function createSlides(slides) {
const templateWrapper = document.getElementById('slide-template');
const template = templateWrapper.content.querySelector(".slide-template");
return slides.map((it, index) => {
const cloned = template.cloneNode(true);
const contentPlaceholders = cloned.querySelectorAll(".content-placeholder");
fillContent(it.elements, contentPlaceholders)
if (infiniteLayout) {
cloned.querySelectorAll(".adslot").forEach(slot => {
slot.id = slot.id + '_' + index;
});
}
return cloned;
});
}
var slides = [{"elements":[{"text":"","level":3,"displayType":"header"},{"elements":[{"text":"You probably spent some time making paper airplanes as a kid, but this definitely isn't your childhood paper plane: It's an intricately designed, fully functional and equipped jet that's as cool on the inside as on the out, and the whole thing is made entirely out of delicate paper. For the video, American designer Luca Iaconi-Stewart used over 3000 hand cut pieces cut from manila envelopes to create the plane, the seats, and the sliding doors for the suite compartment -- and the chairs even recline. The entire thing took over 1,000 hours to complete, and the finished product is absolutely beautiful. Check out the video below.","level":0,"displayType":"paragraph"},{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]}];
var slide_index = parseInt(0);
var slide_json = createSlides(slides);
var initial_slide = slide_index;
var initial_url = location.pathname + location.search;
var base_url = '/singapore-airlines';
var next_gallery = '/bird-panhandling';
var first_load = true;
var has_scrolled = false;
var title = "What This Guy Creates Out Of Paper Really Needs To Be Seen To Be Believed.";
var path = base_url
var utm_campaign, utm_subid, utm_source, utm_content, utm_term = 'n/a';
// try {
// var url = new URL(window.location.href);
// utm_campaign = encodeURIComponent(url.searchParams.get("utm_campaign"));
// utm_source = encodeURIComponent(url.searchParams.get("utm_source"));
// utm_content = encodeURIComponent(url.searchParams.get("utm_content"));
// utm_term = encodeURIComponent(url.searchParams.get("utm_term"));
// utm_medium = encodeURIComponent(url.searchParams.get("utm_medium"));
// if (utm_content && utm_campaign){
// var googletag = googletag || {};
// googletag.cmd = googletag.cmd || [];
// googletag.cmd.push(function() {
// googletag.pubads().setTargeting("utm_subid", utm_term);
// googletag.pubads().setTargeting("utm_subid_c", utm_campaign);
// });
// }
// } catch (e) {
// }