Skip to content

Commit

Permalink
Refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Jan 7, 2025
1 parent 15bc3de commit 1ccc5a2
Show file tree
Hide file tree
Showing 1,473 changed files with 46,495 additions and 28,250 deletions.
210 changes: 210 additions & 0 deletions packages/website/api-docs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="xeokit - SDK for Browser-Based 3D BIM Visualization">
<meta name="author" content="Lindsay Kay">
<meta name="keywords"
content="BIM,IFC,WebGL,JavaScript,Browser,BCF,Web,xeolabs,3D,3D Viewer,Lindsay Kay,xeokit,MedViz,ArchViz,Open Source,Browser,Viewer">

<title>xeokit - 3D Web Programming Toolkit for BIM and Engineering Visualization</title>

<link href="./../libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="./../css/business-frontpage.css" rel="stylesheet">

<link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script src="./../libs/jquery/jquery.min.js"></script>
<script src="./../libs/bootstrap/js/bootstrap.bundle.min.js"></script>

<title></title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top ">
<span style="color: #ffffff;"><a class="navbar-home" href="http://xeolabs.com">xeolabs</a>/<a class="navbar-parent" href="../../">@xeokit/sdk</a>/<a
class="navbar-brand" href="./index.html">API Docs</a> <!-- /<a class="navbar-brand" href="./index.html"><span id="moduleName"></span></a>--></span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="/index.html?foo=0">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link" href="/examples/index.html">Examples</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link" href="/models/index.html">Models</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/articles/index.html">Articles</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/api-docs">API Docs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/xeokit/sdk">GitHub</a>
</li>
<!-- <li class="nav-item">-->
<!-- <a class="nav-link" href="https://xeokit.io/index.html?foo=2#pricing">Pricing</a>-->
<!-- </li>-->
<!-- <li class="nav-item">-->
<!-- <a class="nav-link" href="https://xeokit.io/download.html">Download</a>-->
<!-- </li>-->
</ul>
</div>

</nav>

<section id="intro" class=" alabaster">
<div class="container-fluid">
<div class="row iframe-container">
<div class="col-12 p-0">
<iframe id="autoIframe" src="./docs/api" title="Content frame"></iframe>
</div>
</div>
</div>
</section>
<footer class="py-5 bg-dark xeokit-footer">
<div class="container pt-5">
<div class="row">
<div class="col-md-4 col-sm-12 mb-3 text-left">
<h2>xeokit SDK</h2>
<p>Powering Engineering Graphics on the Web</p>
<img src="/images/xeokitLogoAlphaBG.png">
</div>
<div class="col-md-8 col-sm-12">

<div class="col-md-4 col-sm-6 col-6 p-0 float-left mb-3">
<h5 class="mb-4 font-weight-bold text-uppercase ">Learn</h5>
<ul class="list-group">
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="./examples">Examples</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2 "><a
href="./articles">Tutorials</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2 "><a
href="./api-docs.html">API Docs</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="">Pricing</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="">FAQ</a></li>

</ul>
</div>

<div class="col-md-4 col-sm-6 col-6 p-0 mb-3 float-left">
<h5 class="mb-4 font-weight-bold text-uppercase ">Develop</h5>
<ul class="list-group">
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://github.com/xeokit/sdk/releases">Download</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://github.com/xeokit/sdk">Source Code</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://github.com/xeokit/xeokit-sdk/issues">Issues</a></li>
</ul>
</div>

<div class="col-md-4 col-sm-6 col-6 mb-3 p-0 float-left">
<h5 class="mb-4 font-weight-bold text-uppercase ">Connect</h5>
<ul class="list-group">
<li class="list-group-item bg-transparent border-0 p-0 mb-2">
<a href="http://www.xeolabs.com"><i class="fa fa-globe mr-1"></i>
xeolabs.com</a>
</li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2">
<a href="https://www.linkedin.com/company/xeolabs"><i class="fa fa-linkedin mr-1"></i>
LinkedIn</a>
</li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2">
<a href="https://github.com/xeolabs" target="_code"><i class="fa fa-github mr-1"></i>
Github</a>
</li>
</ul>
</div>
</div>
<div class="col-md-12">
<div class="py-4 d-flex justify-content-center align-items-center">
<p class="m-0 text-center">Copyright &copy; <a href="http://xeolabs.com">xeolabs</a> 2025</p>
</div>
</div>
</div>
</div>
</footer>

</body>
<script>

const iframe = document.getElementById('autoIframe');
const iframeWindow = iframe.contentWindow;

// const moduleNameSpan = document.getElementById("moduleName");

function resizeIframe() {
iframe.style.height = (iframe.contentWindow.document.body.scrollHeight + 50) + 'px';
}

document.getElementById('autoIframe').addEventListener('load', resizeIframe);

function detectHashChange() {
iframe.addEventListener('load', () => {
try {
iframeWindow.addEventListener('hashchange', () => {
console.log('Iframe hash changed to:', iframeWindow.location.hash);
resizeIframe(); // Optional: Adjust height on hash change
window.location.hash = iframeWindow.location.pathname + "___" + iframeWindow.location.hash.substring(1);
});
} catch (err) {
console.error('Error adding hashchange listener:', err);
}
});
}

function scrollToTopOnLoad() {
iframe.addEventListener('load', () => {
resizeIframe();
window.scrollTo(0, 0);
iframeWindow.scrollTo(0, 0);

});
}

function synchPageHashToIframe() {
setInterval(() => {
const pathname = iframeWindow.location.pathname;
const iframeHash = `${pathname}___${iframeWindow.location.hash.substring(1)}`;
if (`#${iframeHash}` !== window.location.hash) {
window.location.hash = iframeHash;
// const moduleName = pathname.substring(pathname.lastIndexOf("/") + 1, pathname.indexOf(".html"))
// moduleNameSpan.innerText = moduleName;
}
}, 100);
}

detectHashChange();
scrollToTopOnLoad();
synchPageHashToIframe();

function decodeHash(hash) {
const i = hash.indexOf("___");
if (i === -1) {
return {path: hash.substring(1), hash: null};
}
const path = hash.substring(1, i);
return {path: `.${path}`, hash: hash.substring(i + 3)};
}

const {path, hash} = decodeHash(window.location.hash);
if (hash) {
iframe.src = hash ? `${path}#${hash}` : path;
} else {
iframe.src = path || "./docs/api/modules.html";
iframeWindow.scrollTo(0, 0);
window.scrollTo(0, 0);
}


</script>
</html>
Loading

0 comments on commit 1ccc5a2

Please sign in to comment.