CoolFace
Apppublic

Omnibus/test-model-viewer

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
test6.html88 linesDownload Raw Back to root
1<!DOCTYPE html>2<html lang="en">3<head>4 5    <meta charset="utf-8" />6    <meta name="viewport" content="width=device-width" />7    <meta name="twitter:card" content="player"/>8    <meta name="twitter:site" content=""/>9    10    <meta name="twitter:player:width" content="100%"/>11    <meta name="twitter:player:height" content="100%"/>    12    <meta property="og:title" content="Test Model Viewer"/>13    <meta property="og:description" content="Embedded App"/>14    <meta property="og:image" content="https://Omnibus-test-model-viewer.static.hf.space/card_im.png"/>15 16<style>17/*  18  19  <meta name="twitter:player" content= "https://Omnibus-test-model-viewer.static.hf.space/test5.html/?" />20  <meta name="twitter:player:stream" content= "https://Omnibus-test-model-viewer.static.hf.space/test5.html/?" />21  .container {22  position: relative;23  overflow: hidden;24  width: 100%;25  padding-top: 100%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */26/*}*/27  .responsive-iframe {28  position: absolute;29  top: 0;30  left: 0;31  width: 100%;32  height: 100%;33}34.embed-container {35position: relative;36padding-top: 100%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */37/*padding-bottom: 70.75%;*/38height: 0;39overflow: hidden;40}41.embed-container iframe {42position: absolute;43top:0;44left: 0;45width: 100%;46height: 100%;47}48    </style>49  </head>50  <body>51 52<div class="embed-container">53<iframe 54  id="myIframe" 55  frameborder="0"56  class="container p-0 flex-grow space-iframe"57  allow="accelerometer; ambient-light-sensor; autoplay; battery; camera; document-domain; encrypted-media; fullscreen; geolocation; gyroscope; layout-animations; legacy-image-formats; magnetometer; microphone; midi; oversized-images; payment; picture-in-picture; publickey-credentials-get; sync-xhr; usb; vr ; wake-lock; xr-spatial-tracking" 58  sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads"59></iframe>60</div>61 62   63    <script>64    const queryString = window.location.search;65    const urlParams = new URLSearchParams(queryString);66    const model_url = urlParams.get("url");67 68    console.log(model_url);69    let myIframe = document.getElementById("myIframe");70    let url_string = "https://omnibus-model-view.hf.space/";71    let mod_url = model_url;72    let adsURL = url_string+"?url="+mod_url;73    let metasURL = url_string+"/test6.html/?url="+mod_url;74 75    var link = document.createElement('meta');76    link.setAttribute('name', 'twitter:player');77    link.content = metasURL;78    document.getElementsByTagName('head')[0].appendChild(link);79    var link_stream = document.createElement('meta');80    link_stream.setAttribute('name', 'twitter:player:stream');81    link_stream.content = metasURL;82    document.getElementsByTagName('head')[0].appendChild(link_stream);83      84    console.log(adsURL);85    myIframe.src = adsURL;86    </script>87  </body>88</html>