Closed viniith21 closed 8 months ago
<div class="container"> <model-viewer id="model" alt="3D MODEL" src="" auto-rotate shadow-intensity="1" camera-controls touch-action="pan-y"> </model-viewer> <div class="model-info"> <label for="title">Model Title</label> <p id="title">Loading...</p> <label for="description">Model Description</label> <p id="description"></p> </div> </div> <script> const urlParams = new URLSearchParams(window.location.search); const modelUrl = urlParams.get('model'); const metadataString = urlParams.get('metadata'); if (modelUrl) { const modelViewer = document.querySelector('model-viewer'); modelViewer.src = modelUrl; } if (metadataString) { const metadata = JSON.parse(decodeURIComponent(metadataString)); const title = metadata.title || 'No Title'; const description = metadata.description || 'No Description'; const titleElement = document.getElementById('title'); titleElement.textContent = title; const descriptionElement = document.getElementById('description'); descriptionElement.textContent = description; } </script>