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

Save Automatically?

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

              
                <html>

    <head>
        <link href="https://fonts.googleapis.com/css?family=Arimo" rel="stylesheet">
        <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>

        <!-- Include the Singular Graphic JavaSrcipt library -->
        <script src="https://app.singular.live/libs/singularplayer/0.1.2/singularplayer.js"></script>
    </head>

    <body>
      <header>
        <div class="container">
      <div class="logo">
        <img src="https://static.wixstatic.com/media/7e7b4f_bd1a8a2e023c4329880c7bb12994f1fd~mv2.png/v1/crop/x_0,y_71,w_1578,h_155/fill/w_205,h_23,al_c,usm_0.66_1.00_0.01/7e7b4f_bd1a8a2e023c4329880c7bb12994f1fd~mv2.png" width="150" alt="Singular_Logo" title="">
      </div>
      <div class="logo2">
        <a href="https://www.singular.live/">
                        <img src="https://static.wixstatic.com/media/7e7b4f_3ca9325e528747baabaa13dd349ad13b~mv2.png/v1/crop/x_83,y_0,w_580,h_517/fill/w_157,h_121,al_c,usm_0.66_1.00_0.01/7e7b4f_3ca9325e528747baabaa13dd349ad13b~mv2.png" width="30px">
                    </a>
      </div>
    </div>
  </header>
        <!-- Comments -- START -->        
        <!--Dropdown Cpmosition Selector-->
        <div class="box grid">        
            <div class="box box1">
                <div class="dropdown-size">
                    <div class="dropdown">
                      <a href="javascript:void(0)" class="dropbtn custom-dropdown">Select Composition</a>
                      <div class="dropdown-content">
                        <button onclick='compositionLoader(9178)'>Spring (ID=9178)</button>
                        <button onclick='compositionLoader(9179)'>Passport (ID=9179)</button>
                      </div>
                    </div>
                </div>    
            </div>

            <div class="box box2">
                <!-- load Singular Player into iFrame -->
                <!-- define iframe size with aspect ratio 16:9 -->
                <iframe id="SingularPlayer"  src="https://app.singular.live/singularplayer/client"></iframe>
                <div><b id='status'>Status: </b></div>
                </div>
            </div>
        <!-- Comments -- END -->
    </body>

</html>

              
            
!

CSS

              
                @font-face {
    font-family: 'Lato';
    src: url("https://fonts.googleapis.com/css?family=Lato");
}

html{
  overflow-y: hidden;
}

body{
    font-family: 'Lato' ,'Arimo', sans-serif;
    margin: 0;
}

h1 {
    color: lightgrey;
    font-size: 25px;
    text-align: center;
}

p {
    font-size: 15px;
    color: lightgrey;
    text-align: center;
}

header {
  display: grid;
  grid-auto-columns: 1fr 2fr 1fr;
  background: #add136;
  margin-bottom: 20px;
  overflow: hidden;
  text-align: center;
  box-shadow: 3px 7px 15px #ccc;
}

.logo {
  float: left;
  margin-left: 30px;
  padding: 7px;
}

.logo2 {
  float: right;
  position: relative;
  margin-right: 30px;
}

.logo,
.logo2 {
  margin-top: 7px;
  margin-bottom: -3px;
}

.grid{
  height: 370px;
  display: grid;
  grid-template-rows: 37px 1fr;
  grid-template-columns:153px 1fr;
  grid-gap: 4px;
  margin-left: 7px;
}

.box{
  border: solid 0px black
}

.box1{
  grid-row: 1/2;
  grid-column: 1/2;
}

.box2{
  grid-row: 2/3;
  grid-column: 1/3;
  height: 55vw;
}

iframe{
  height: 100%;
  width: 100%;
  border: solid 1px black;
  margin-bottom: 0px;
  padding: 0px;
  max-height: 300px;
  max-width: 532px;
}

#status{
  font-size: 11px;
}

/*DROPDOWN*/
/*--------*/
/*--------*/

div button, .dropbtn {
    display: inline-block;
    color: white;
    text-align: center;
    padding: 10px 16px;
    text-decoration: none;
    background-color: #add136;
    border: none;
    border-radius: 7px;
}

div button:hover, .dropdown:hover .dropbtn { 
    background-color: rgba(173, 209, 54, 0.5);
    border-bottom-left-radius: 0px; 
    border-bottom-right-radius: 7px;
}

div.dropdown {
    display: inline-block;
    width: 10px;
    margin-bottom: 0px;

}

div.controlButtons {
    display: inline;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    z-index: 1;
    top: 58px;
    
    
}

.dropdown-content button {
    color: black;
    padding: 7px 12px;
    text-decoration: none;
    display: block;
    text-align: left;
    width: 150px;
    border-bottom: solid 2px #ccc;
    display: relative;
    border-radius: 0px; 
}

.dropdown-content button:last-child{
  border:0;
}

.dropdown-content button:hover {
  background-color: #58B947;
  border-radius:0;
}

.dropdown:hover .dropdown-content {
    display: block;
    margin-top: 36px;
}

.dropdown a{
    font-size: 13px;
    width: 125px;
    text-align: left;
    float: left;
    padding-left: 10px;
}

/*DropdownArrows*/
/*--------------*/
/*--------------*/
.custom-dropdown {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.custom-dropdown select {
  color: #fff;
  font-size: inherit;
  padding: .5em;
  padding-right: 2.5em;	
  border: 0;
  margin: 0;
  border-radius: 3px;
  text-indent: 0.01px;
  text-overflow: '';
  -webkit-appearance: button; /* hide default arrow in chrome OSX */
}

.custom-dropdown::before,
.custom-dropdown::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.custom-dropdown::after { /*  Custom dropdown arrow */
  content: "\25BC";
  height: 10px;
  font-size: .625em;
  line-height: 1;
  right: 1.2em;
  top: 50%;
  margin-top: -3px;
}

.custom-dropdown::before { /*  Custom dropdown arrow cover (dark-gray)*/
  width: 2em;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: 0 3px 3px 0;
}

.custom-dropdown select[disabled] {
  color: rgba(0,0,0,0.3);
}

.custom-dropdown select[disabled]::after {
  color: rgba(0,0,0,.3);
}

.custom-dropdown::before {
  background-color: rgba(0,0,0,0.4);
}

.custom-dropdown::after {
  color: rgba(0,0,0,.4);
}
              
            
!

JS

              
                // define Singular Player Instance
var player;

$(document).ready(function () {

  // create player object from iframe 'SingularPlayer'
  player = SingularPlayer("SingularPlayer");

  compositionLoader(9178);

  // load composition with a specific id into the player 
/*  player.renderAppOutput(9178, undefined, function compositionLoaded() {
    $('#status').text('INFO: Composition loaded');
  });
*/
  // Listen to error report

  player.addListener('error', undefined, function (event, msg) {
    if (event == 'error')
//      $('#status').text("ERROR:" + msg.error.message);
      $('#status').text("ERROR:" + msg.desc);  
  });

});

function compositionLoader(id) {

  player.renderAppOutput(id, undefined, function compositionLoaded() {
    $("#control").show();
    $("#status").text("Status: Composition loaded");
  });
}



              
            
!
999px

Console