troodle-expcontent/test.html

51 lines
1.4 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<style>
html, body {
overflow: hidden;
}
</style>
</head>
<body>
<script src='https://cdn.exp360.com/embed/js/exp360-embed-3.8.59.js?v=3&d=d667dff2-97bb-437e-85d2-f7550d87a4d0&p=web'></script>
<script>
function startContent() {
exp360.openContent('{1513cf9a-d385-4793-b97e-d7626ab6c12a}', { popup: false,autorotate:true,autorotate_speed:5,autorotate_delay:2500,teleport_animation:false });
}
var currentUrl = window.location.href;
var url = new URL(currentUrl);
var searchParams = new URLSearchParams(url.search);
var params = {};
searchParams.forEach((value, key) => {
params[key] = value;
});
function initialize() {
// Create a new div element
var newDiv = document.createElement("div");
// Set the required attributes
newDiv.setAttribute("data-exp360-type", "player");
var contentId = params['contentid'] || '1513cf9a-d385-4793-b97e-d7626ab6c12a';
newDiv.setAttribute("data-exp360-id", contentId);
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
// Set the data-exp360-params attribute with the current window width and height
newDiv.setAttribute("data-exp360-params", `width=${windowWidth};height=${windowHeight};`);
// Append the new div to the body (or another desired parent element)
document.body.appendChild(newDiv);
}
window.onload = initialize;
</script>
</body>
</html>