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

              
                <head>
  <!-- Include the Singular Graphic JavaSrcipt library -->
  <script src="https://app.singular.live/libs/singularplayer/0.1.2/singularplayer.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
</head>
<!---->
<!---->
<!--Watch the Pen Settings for the <head> and additional JS Scripts-->
<!---->
<!---->
<!-- Comments -- START -->

<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>

  <div class="grid-all">
    <div class="box box-top">
      <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>
        </div>
      </div>
    </div>
    <div class="box box-mid">
        <iframe id="SingularGraphic" src="https://app.singular.live/singularplayer/client"></iframe>
    </div>
    <div class="box box-bot" id="controls">
      <!--EVENT BUG-->
      <div class="box box-row row1">
        <div class="box box-item1">EventBug</div>
        <div class="box box-item2">
          <input type="text" id="EventBug">
        </div>
        <div class="box box-item3">
          <a class="variantbutton" onclick="setText('EventBug')">SEND<i class="fa fa-paper-plane"></i></a>
        </div>
        <div class="box box-item4">
          <label class="switch">
                            <input id="EventBugSwitch" type="checkbox" checked onclick="showSubcomp2('EventBug')">
                            <span class="slider"></span>
                        </label>
        </div>
      </div>
      <!--LOCATION BUG-->
      <div class="box box-row row2">
        <div class="box box-item1">LocationBug</div>
        <div class="box box-item2">
          <input type="text" id="LocationBug">
        </div>
        <div class="box box-item3">
          <a class="variantbutton" onclick="setText('LocationBug')">SEND<i class="fa fa-paper-plane"></i></a>
        </div>
        <div class="box box-item4">
          <label class="switch">
                            <input id="LocationBugSwitch" type="checkbox" checked onclick="showSubcomp2('LocationBug')">
                            <span class="slider"></span>
                        </label>
        </div>
      </div>
      <!--1 LINE TOPIC BAR-->
      <div class="box box-row row3">
        <div class="box box-item1">1 Line Topic Bar</div>
        <div class="box box-item2">
          <input type="text" id="1TopicText">
        </div>
        <div class="box box-item3">
          <a class="variantbutton" onclick="setText('1 Line Topic Bar')">SEND<i class="fa fa-paper-plane"></i></a>
        </div>
        <div class="box box-item4">
          <label class="switch">
                            <input id="1 Line Topic BarSwitch" type="checkbox" onclick="showSubcomp2('1 Line Topic Bar')">
                            <span class="slider"></span>
                        </label>
        </div>
      </div>
      <!--2 LINE TOPIC BAR-->
      <div class="box box-row row4">
        <div class="box box-item1">2 Line Topic Bar</div>
        <div class="box box-item2">
          <input type="text" id="2TopicTitle">
        </div>
        <div class="box box-item3">
          <a class="variantbutton" onclick="setText('2 Line Topic Bar')">SEND<i class="fa fa-paper-plane"></i></a>
        </div>
        <div class="box box-item4">
          <label class="switch">
                            <input id="2 Line Topic BarSwitch" type="checkbox" checked onclick="showSubcomp2('2 Line Topic Bar')">
                            <span class="slider"></span>
                        </label>
        </div>
      </div>
      <div class="box box-row row5">
        <div class="box box-item1"></div>
        <div class="box box-item2">
          <input type="text" id="2TopicText">
        </div>
        <div class="box box-item3"></div>
        <div class="box box-item4"></div>
      </div>
      <!--TICKER HEAD-->
      <div class="box box-row row6">
        <div class="box box-item1">Ticker</div>
        <div class="box box-item2">
          <input type="text" id="TickerTitle">
        </div>
        <div class="box box-item3">
          <a class="variantbutton" onclick="setText('Ticker')">SEND<i class="fa fa-paper-plane"></i></a>
        </div>
        <div class="box box-item4">
          <label class="switch">
                            <input id="TickerSwitch" type="checkbox" checked onclick="showSubcomp2('Ticker')">
                            <span class="slider"></span>
                        </label>
        </div>
      </div>
      <!--TICKER BODY-->
      <div class="box box-row row7">
        <div class="box box-item1"></div>
        <div class="box box-item2">
          <input type="text" id="TickerText">
        </div>
        <div class="box box-item3"></div>
        <div class="box box-item4"></div>
      </div>
      <!--SIDE PANEL IMAGE-->
      <div class="box box-row row8">
        <div class="box box-item1">Side Panel Image</div>
        <div class="box box-item2">
          <label class="switch">
                            <input id="Side Panel PictureSwitch" type="checkbox" checked onclick="showSubcomp2('Side Panel Picture')">
                            <span class="slider"></span>
                        </label>
        </div>
        <div class="box box-item3"></div>
        <div class="box box-item4"></div>
      </div>
      <!--SIDE PANEL TEXT-->
      <div class="box box-row row9">
        <div class="box box-item1">Side Panel Text</div>
        <div class="box box-item2">
          <label class="switch">
                            <input id="Side Panel TextSwitch" type="checkbox" onclick="showSubcomp2('Side Panel Text')">
                            <span class="slider"></span>
                        </label>
        </div>
        <div class="box box-item3"></div>
        <div class="box box-item4"></div>
      </div>
      <!--BACKGROUND IMAGE-->
      <div class="box box-row row10">
        <div class="box box-item1">Background Image</div>
        <div class="box box-item2">
          <label class="switch">
                            <input id="BackgroundImageSwitch" type="checkbox" checked  onclick="showSubcomp2('BackgroundImage')">
                            <span class="slider"></span>
                        </label>
        </div>
        <div class="box box-item3"></div>
        <div class="box box-item4"></div>
      </div>
      <!--BACKGROUND WEBCAM-->
      <div class="box box-row row11">
        <div class="box box-item1">Background WebCam</div>
        <div class="box box-item2">
          <label class="switch">
                            <input id="BackgroundWebCamSwitch" type="checkbox" onclick="showSubcomp2('BackgroundWebCam')">
                            <span class="slider"></span>
                        </label>
        </div>
        <div class="box box-item3"></div>
        <div class="box box-item4"></div>
      </div>

    </div>
  </div>
  <div><b id="status">Status: </b></div>
</body>

<!-- Comments -- END -->
              
            
!

CSS

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

body {
  font-size: 12px;
  margin: 0;
  width: 100%;
  height: 800px;
  font-family: "Lato", Times, sans-serif;
}

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;
}

#SingularGraphic {
  height: 100%;
  width: 100%;
  z-index: 1;
  max-width: 633px;
}

#status {
  margin-left: 10px;
}

input {
  width: 95%;
}

/*GRID------*/
/*----------*/
/*----------*/

.grid-all {
  display: grid;
  height: 90%;
  min-width: 455px;
  grid-template-columns: 150px 1fr 1fr 1fr 1fr;
  grid-template-rows: 40px 3fr 2fr;
  grid-gap: 7px;
  margin-left: 7px;
}

.box {
  border-radius: 5px;
  border: 0px dodgerblue solid;
}

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

.box-mid {
  grid-column: 1/ 4;
  grid-row: 2 / 3;
  height: 100%;
}

.box-bot {
  width: 80%;
  align-self: center;
  grid-column: 1/5;
  grid-row: 3 / 4;
  display: grid;
  grid-template-rows: repeat(11, 1fr);
  grid-gap: 2px;
  border-radius: 7px;
  padding: 2px;
}

.box-row {
  display: grid;
  grid-template-columns: 2fr 3fr 70px 1fr;
  margin: 0px;
  grid-gap: 3px;
  border-bottom: solid 2px #ccc;
  border-radius: 0;
}

.box-row:last-child {
  border: 0;
}

.box-bot > .box-row > div:first-child {
  font-size: 1em;
  background-color: #add136;
  padding: 2px 4px;
  height: calc(100% - 6px);
}

.box > .row5 > div:first-child,
.box > .row7 > div:first-child {
  background-color: transparent;
}

/*END OF GRID-----------*/
/*----------------------*/
/*----------------------*/

/*Set-Buttons-----------*/
.variantbutton {
  font-family: "Lato";
  background-color: #add136;
  color: #333333;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 11px;
  border-radius: 5px;
  cursor: default;
  padding: 4px 8px;
}

.variantbutton:hover {
  background-color: #aaa;
}

.fa-paper-plane {
  font-size: 11px;
  margin-left: 7px;
}
/*Set-Buttons-END------------------------*/

/*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: solid 2px #ccc;
  display: relative;
  border-radius: 0px;
}

.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;
}

.switch {
  position: relative;
  display: inline-block;
  width: 57px;
  height: 20px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0px;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 15px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #97f9bb;
}

input:focus + .slider {
  box-shadow: 0 0 1px #97f9bb;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(36px);
}

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

.custom-dropdown select {
  color: #fff;
  font-size: inherit;
  padding: 0.5em;
  padding-right: 2.5em;
  border: 0;
  margin: 0;
  border-radius: 0px;
  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: 1em;
  font-size: 0.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;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 0 7px 7px 0;
}

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

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

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

              
            
!

JS

              
                // add singular player
var player;

$(document).ready(function() {
  $("#control").hide();

  // create player object from iframe 'SingularPlayer'
  player = SingularPlayer("SingularGraphic");
  
  compositionLoader("268JKrDN0RNd6TCY5qMpVA"); // using app token
  // Listen to error report
  player.addListener("error", function(event, msg) {
    if (event == "error") $("#status").text(msg.error.message);
  });
});

function setText(id) {
  var subComp = player.getMainComposition().find(id)[0];
  if (id == "EventBug") {
    var text = $("#EventBugState").val();

    subComp.setPayload({
      Event: text
    });
  } else if (id == "LocationBug") {
    var text = $("#LocationBug").val();
    subComp.setPayload({
      Location: text
    });
  } else if (id == "1 Line Topic Bar") {
    var text = $("#1TopicText").val();
    subComp.setPayload({
      Text: text
    });
  } else if (id == "2 Line Topic Bar") {
    var text = $("#2TopicTitle").val();
    subComp.setPayload({
      Title: text
    });
    var text = $("#2TopicText").val();
    subComp.setPayload({
      Text: text
    });
  } else if (id == "Ticker") {
    var text = $("#TickerTitle").val();
    subComp.setPayload({
      Title: text
    });
    var text = $("#TickerText").val();
    subComp.setPayload({
      "Text Field": text
    });
  }
}

function showSubcomp(id, show) {
  var subComp = player.getMainComposition().find(id)[0];
  if (show || show === undefined) subComp.playTo("In");
  else subComp.playTo("Out");
}

function showSubcomp2(id) {
  var subComp = player.getMainComposition().find(id)[0];
  var state = document.getElementById(id+'Switch').checked;
  if (state == true) {
      subComp.playTo("In");
      if (id == '2 Line Topic Bar') document.getElementById('1 Line Topic BarSwitch').checked = false;
      if (id == '1 Line Topic Bar') document.getElementById('2 Line Topic BarSwitch').checked = false;
      if (id == 'Side Panel Picture') document.getElementById('Side Panel TextSwitch').checked = false;
      if (id == 'Side Panel Text') document.getElementById('Side Panel PictureSwitch').checked = false;
      if (id == 'BackgroundImage') document.getElementById('BackgroundWebCamSwitch').checked = false;
      if (id == 'BackgroundWebCam') document.getElementById('BackgroundImageSwitch').checked = false;
  }
  else subComp.playTo("Out");
}

//     var x = document.getElementById("slider_1").checked;

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

              
            
!
999px

Console