<div id='walkthrough' style='margin:auto;text-align:center;'></div>
<script>
const myUrl = 'https://avatar-dimension-studio.netlify.app/';
const horizontalRatio = 16/9;
const verticalRatio = 3/4;
$(document).ready( function (){
makeWalkthrough();
})
var myOrientation;
function makeWalkthrough () {
const myWidth = window.innerWidth;
const myHeight = window.innerHeight;
let horizPadd;
let newHeight;
if (myWidth < 768) {
horizPadd = 6
} else {
horizPadd = 11
}
const newWidth = (100 - (horizPadd*2));
if ( myHeight > myWidth) {
newHeight = horizontalRatio * newWidth;
myOrientation = 'vert'
} else {
newHeight = verticalRatio * newWidth;
myOrientation = 'horz'
}
var marzipanoWindow = document.createElement("iframe");
marzipanoWindow.style = `height:${newHeight}vw; width:${newWidth}vw`;
marzipanoWindow.src = `${myUrl}/index.html`;
$("#walkthrough").append(marzipanoWindow);
}
$(window).resize( function (){
if ( window.innerHeight > window.innerWidth && myOrientation === 'horz'){
$("#walkthrough").empty();
makeWalkthrough();
} else if (window.innerHeight < window.innerWidth && myOrientation === 'vert') {
$("#walkthrough").empty();
makeWalkthrough();
}
});
var scriptScreenful = document.createElement("script");
scriptScreenful.type = "text/javascript";
scriptScreenful.src = `${myUrl}/vendor/screenfull.min.js`;
$("head").append(scriptScreenful);
var scriptClassList = document.createElement("script");
scriptClassList.type = "text/javascript";
scriptClassList.src = `${myUrl}/vendor/classList.js`;
$("head").append(scriptClassList);
var scriptBowser = document.createElement("script");
scriptBowser.type = "text/javascript";
scriptBowser.src = `${myUrl}/vendor/bowser.min.js`;
$("head").append(scriptBowser);
var scriptEs5 = document.createElement("script");
scriptEs5.type = "text/javascript";
scriptEs5.src = `${myUrl}/vendor/es5-shim.js`;
$("head").append(scriptEs5);
var scriptEvent = document.createElement("script");
scriptEvent.type = "text/javascript";
scriptEvent.src = `${myUrl}/vendor/eventShim.js`;
$("head").append(scriptEvent);
var scriptAnimation = document.createElement("script");
scriptAnimation.type = "text/javascript";
scriptAnimation.src = `${myUrl}/vendor/requestAnimationFrame.js`;
$("head").append(scriptAnimation);
var scriptMarzipano = document.createElement("script");
scriptMarzipano.type = "text/javascript";
scriptMarzipano.src = `${myUrl}/vendor/marzipano.js`;
$("head").append(scriptMarzipano);
</script>