Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- Learn about this code on sketchfab: https://sketchfab.com/developers/viewer -->
<center>

<!-- SketchFab Viewer -->

<div class="container">
  <div class="iframe-container">
    <iframe width="90%" height="400" src="" id="api-frame"></iframe>
  </div>
  
<!-- Interactions -->

<div class="iframe-interactions">
  <a href="" target="_blank" class="button ghost small ml-25 mobile-off w-button"> P L A Y </a>
</div>  
  
<!-- Messengers -->

    <p id="title" style="color: red"></p>
    <p>Sound plays on load, if not, <a href="https://developers.google.com/web/updates/2018/11/web-audio-autoplay"> it means it needs a "user click/touch permission"</a></p>
</div>



<!-- Sourcing External Java Script for SketchFab Api -->

<script type="text/javascript" src="https://static.sketchfab.com/api/sketchfab-viewer-1.10.1.js"></script>

<script type="text/javascript" src="https://uploads-ssl.webflow.com/620eec9006a1e8735a6d67f7/624451d525b286e2d958f337_whitestormhead.txt"></script>

<!-- Audio -->

<audio controls autoplay id="audio1" loop=true preload width="960" height="540">
  <source src="https://s3.us-west-2.amazonaws.com/secure.notion-static.com/373f8eff-a605-4883-ad38-4de6796be4d9/whitestorm.mp3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20220403%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20220403T164737Z&X-Amz-Expires=86400&X-Amz-Signature=738b97273d9680eed1469a80c0a831358df7da595fe077eca2730d8e784ac30e&X-Amz-SignedHeaders=host&x-id=GetObject" id="srcMP3" type="audio/mp3">
  <div>Your Browser will not support this audio</div>
</audio>

</center>
              
            
!

CSS

              
                html,
body {
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-font-smoothing: grayscale;
  font-family: Open Sans, sans-serif;
}

* {
  box-sizing: border-box;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.iframe-container {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
}

.iframe-container > iframe {
  border: 0;
  width: 100%;
  flex: 1;
}

.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  min-height: 50px;
  padding: 15px 0 0 15px;
  background-color: #F2F2F2;
  border-top: 1px solid #e7e7e7;
}

.controls > * {
  margin-right: 15px;
  margin-bottom: 15px;
}

button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 0 13px;
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  text-align: center;
  text-shadow: none;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
  outline: none;
  transition: background 0.2s;
  color: white;
  background-color: #1caad9;
  height: 25px;
  font-size: 12px;
}

button.disabled {
  background-color: #cccccc;
}

              
            
!

JS

              
                // Sketchfab Viewer API: Annotation hit also picks mesh
const version = '1.10.1';
const uid = '95d4b3b05ae946f7a4e89d224554a539';
const iframe = document.getElementById('api-frame');
const client = new window.Sketchfab(version, iframe);
let api;

const error = err => console.error('Sketchfab API error:', err);

var titleMessageElement;
var audioSample1;
var audioPlaying1;

function toggleAudio1() {

  if (!audioSample1) return;
  audioSample1.loop = true;
  if (audioPlaying1) audioSample1.pause();
  else audioSample1.play().then(function() {
    
    window.console.log("// Automatic playback started!");
    titleMessageElement.textContent  = "// Automatic playback started!";
  }).catch(function(error) {
    // Automatic playback failed.
    // Show a UI element to let the user manually start playback.
    window.console.log("// Automatic playback couldn't start!");
    window.console.log(error);
    titleMessageElement.textContent  = "// Automatic playback couldn't start! need user interaction";
  });
}

function skfbStart() {
  const success = apiClient => {
    api = apiClient;
    api.start();
    api.addEventListener('viewerready', () => {					
          toggleAudio1();
    });
  };

  client.init(uid, {
    annotation: 0, // Usage: Setting to [1 – 100] will automatically load that annotation when the viewer starts.
    annotations_visible: 1, // Usage: Setting to 0 will hide annotations by default.
    autospin: 0, // Usage: Setting to any other number will cause the model to automatically spin around the z-axis after loading.
    autostart: 1, // Usage: Setting to 1 will make the model load immediately once the page is ready, rather than waiting for a user to click the Play button.
    cardboard: 0, // Usage: Start the viewer in stereoscopic VR Mode built for Google Cardboard and similar devices.
    camera: 1, // Usage: Setting to 0 will skip the initial animation that occurs when a model is loaded, and immediately show the model in its default position.
    preload: 1, // Usage: Setting to 1 will force all resources (textures) to download before the scene is displayed.
    ui_stop: 0, // Usage: Setting to 0 will hide the "Disable Viewer" button in the top right so that users cannot stop the 3D render once it is started.
    transparent: 0, // Usage: Setting to 1 will make the model's background transparent
    ui_animations: 0, // Usage: Setting to 0 will hide the animation menu and timeline.
    ui_annotations: 0, // Usage: Setting to 0 will hide the Annotation menu.
    ui_controls: 1, // Usage: Setting to 0 will hide all the viewer controls at the bottom of the viewer (Help, Settings, Inspector, VR, Fullscreen, Annotations, and Animations).
    ui_fullscreen: 1, // Usage: Setting to 0 will hide the Fullscreen button.
    ui_general_controls: 1, // Usage: Setting to 0 will hide main control buttons in the bottom right of the viewer (Help, Settings, Inspector, VR, Fullscreen).
    ui_help: 1, // Usage: Setting to 0 will hide the Help button.
    ui_hint: 1, // Usage: Setting to 0 will always hide the viewer hint animation ("click & hold to rotate"). Setting to 1 will show the hint the first time per browser session (using a cookie). Setting to 2 will always show the hint.
    ui_infos: 0, // Usage: Setting to 0 will hide the model info bar at the top of the viewer.
    ui_inspector: 0, // Usage: Setting to 0 will hide the inspector button.
    ui_settings: 0, // Usage: Setting to 0 will hide the Settings button.
    ui_vr: 0, // Usage: Setting to 0 will hide the View in VR button.
    ui_ar: 0, // Usage: Setting to 0 will hide the View in AR button.
    ui_watermark_link: 0, // Usage: Setting to 0 remove the link from the Sketchfab logo watermark.
    ui_color: '00a8c0', // Usage: Setting to a hexidecimal color code (without the #) or a HTML color name will change the color of the viewer loading bar.
    ui_watermark: 0, // Usage: Setting to 0 remove the Sketchfab logo watermark.

    success: success,
    error: error,
    version: version
  });

}


document.addEventListener("DOMContentLoaded", function(event) {

  // sound can be paused by user, browser, only way to know is to listen 
  // to the events

  audioSample1 = document.getElementById('audio1');
  audioSample1.addEventListener("playing", function(event) {
    audioPlaying1 = true;
  });
  audioSample1.addEventListener("pause", function(event) {
    audioPlaying1 = false;
  });

titleMessageElement= document.getElementById('title');

  skfbStart();
});
              
            
!
999px

Console