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

              
                <div class="custom_button_style">
  <div id="XS-pay2play-widget-1" class="cta_button">
      <div class="preloader"></div>
  </div>
</div>



<div class="custom_button_style">
  <div id="XS-pay2play-widget-2" class="cta_button">
      <div class="preloader"></div>
  </div>
</div>


<div class="custom_button_style">
  <div id="XS-pay2play-widget-3" class="cta_button">
      <div class="preloader"></div>
  </div>
</div>

<div class="custom_button_style">
  <div id="XS-pay2play-widget-4" class="cta_button">
      <div class="preloader"></div>
  </div>
</div>


<div class="custom_button_style">
  <div id="XS-pay2play-widget-5" class="cta_button">
      <div class="preloader"></div>
  </div>
</div>



<div id="dropdown" class="dropdown">
          <div data-ico="" class="language ico" onclick="toggleMenu();">English</div>
          <div id="dropdown-menu" class="hidden">
            <ul>
              <li class="ico" onclick="setLocale('en');">English</li>
              <li class="ico" onclick="setLocale('ko');">한국어</li>
              <li class="ico" onclick="setLocale('cn');">简体中文</li>
              <li class="ico" onclick="setLocale('de');">Deutsch</li>
              <li class="ico" onclick="setLocale('pt');">Português</li>
              <li class="ico" onclick="setLocale('ru');">Русский</li>
              <li class="ico" onclick="setLocale('es');">Español</li>
              <li class="ico" onclick="setLocale('fr');">Français</li>
            </ul>
          </div>
        </div>
              
            
!

CSS

              
                
body {padding: 4em; background: #000; color: white; font-family: Arial; font-size: 18px;}



/* Stylize button*/
.custom_button_style {
  position: relative;
  display: inline-block;
  min-width: 120px;
  min-height: 20px;
  padding: 1em 2em;
  background: #e8a745;
  /*border: 1px solid #00FF; */
  color: black;
}



/* Xsolla styles do not change*/
.preloader {
  position: absolute;
  left: 0px;
  top: 0px;
  right: 0px;
  bottom: 0px;
  z-index: 1;
  background-color: #000;
  background-image: url('https://uploads-ssl.webflow.com/5a9f30ef690c3d0001d3fc4b/5a9f4d1a690c3d0001d40a9b_pre-loader.gif');
  background-position: 50% 50%;
  background-size: auto 50%;
  background-repeat: no-repeat;
  opacity: 1;
}

/* PAY2PLAY button for landings START*/
.xpay2Play-widget-simple,
.xpay2Play-widget-simple-button-block,
.xpay2Play-widget-simple-payment-button,
.xpay2play-widget-simple-payment-button-amount {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  display: -webkit-box !important;
  display: -webkit-flex !important;
  display: -ms-flexbox !important;
  display: flex !important;
  flex-direction: column !important;
  -webkit-justify-content: center !important;
  -ms-flex-pack: center !important;
  justify-content: center !important;
}
.xpay2Play-widget-simple-payment-button {
  padding-right: 1.4em !important;
  padding-left: 1.4em !important;
}
.xpay2Play-widget-simple-payment-button-amount {
  display: -webkit-box !important;
  display: -webkit-flex !important;
  display: -ms-flexbox !important;
  display: flex !important;
  flex-direction: row !important;
  -webkit-box-pack: center !important;
  -webkit-justify-content: center !important;
  -ms-flex-pack: center !important;
  justify-content: center !important;
  -webkit-box-align: center !important;
  -webkit-align-items: center !important;
  -ms-flex-align: center !important;
  align-items: center !important;
}
.formatted-currency.discount {
  text-decoration: line-through;
  margin-left: 0.4em;
}


/* Error Overrides */
.xpay2Play-widget-simple .error-message {
  margin-top: 0 !important;
  position:absolute !important;
  z-index:4 !important;
  top:0 !important;
  bottom:0 !important;
  left:0 !important;
  right:0 !important;
  width: 100% !important;
  justify-content: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box !important;
  display: -webkit-flex !important;
  display: -ms-flexbox !important;
  display: flex !important;
  flex-direction: row !important;
  -webkit-box-pack: center !important;
  -webkit-justify-content: center  !important
}
.error-message>div>svg {
  display: none !important;
}
.error-message>div {
  margin:0 0.1em;
  display: block !important;
  display: -webkit-box !important;
  display: -webkit-flex !important;
  display: -ms-flexbox !important;
  display: flex !important;
  flex-direction: row !important;
  -webkit-box-pack: center !important;
  -webkit-justify-content: center
}

.xpay2Play-widget-simple-payment-buttonamount-discount {
  padding-top: 0.2em;
  font-size: 0.9em !important;
}



/* PAY2PLAY button for landings END*/





/* Locale DropDown*/

div.dropdown {
  position: absolute;
  top: 20px;
  left: 2em;
  background-size: 10px 5px;
  background-repeat: no-repeat;
  background-position: 90px 15px;
  background-image: url("https://livedemo.xsolla.com/gc-xsolla-demo-store/images/drop-arrow.svg");
  background-color: #ffdaa1;
  -webkit-border-radius: 2px;
  -moz-border-radius: 2px;
  border-radius: 2px;
  z-index:10;
}

div.dropdown .language, #dropdown-menu li {
  box-sizing: border-box;
  font-size: 14px;
  color: #000;
  width: 110px;
  height: 34px;
  padding: 8px 0 0 16px;
  text-align: left;
  cursor: pointer;
}

div#dropdown-menu.hidden {
  display: none;
}

#dropdown-menu ul {
  margin: 5px 0 0 0;
  padding: 0;
  border-radius: 3px;
}

#dropdown-menu li {
  list-style: none;
}

div.dropdown .language, #dropdown-menu li {
  box-sizing: border-box;
  font-size: 14px;
  color: #000;
  width: 110px;
  height: 34px;
  padding: 8px 0 0 16px;
  text-align: left;
  cursor: pointer;
}

.ico {
  background-size: 24px 24px;
  background-position: 10px 5px;
  background-repeat: no-repeat;
}

/* end Locale DropDown*/
              
            
!

JS

              
                var project_id = 36179 
var digital_content1 = "EncasedDigitalCopy";
var digital_content2 = "EncasedDigitalDeluxeCopy";
var digital_content3 = "EncasedDigitalCollectors";
var digital_content4 = "EncasedDigitalFirstAccess";



var options = {
  access_data: {
    settings: {
      project_id: project_id, //PROJECT ID
    },

    purchase: {
      pin_codes: {
        codes: [
          {
            digital_content: digital_content1 //SKU NAME IN PUBLISHER
          }
        ]
      }
    }
  },

  theme: {
    foreground: "gold",
    background: "dark"
  },

  target_element: "#XS-pay2play-widget-1", //TARGET

  template: "simple",

  lightbox: {
    height: "685px"
  }
};

var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "https://cdn.xsolla.net/embed/pay2play/2.1.3/widget.min.js";
s.addEventListener(
  "load",
  function(e) {
    
    var options1 = options;
    options1.target_element = "#XS-pay2play-widget-1", //TARGET
    options1.access_data.purchase.pin_codes.codes[0].digital_content = digital_content1;
    var widgetInstance1 = XPay2PlayWidget.create(options1);

    var options2 = options;
    options2.target_element = "#XS-pay2play-widget-2", //TARGET
    options2.access_data.purchase.pin_codes.codes[0].digital_content = digital_content2;
    var widgetInstance2 = XPay2PlayWidget.create(options2);

    var options3 = options;
    options3.target_element = "#XS-pay2play-widget-3", //TARGET
    options3.access_data.purchase.pin_codes.codes[0].digital_content = digital_content3;
    var widgetInstance3 = XPay2PlayWidget.create(options3);
    
    var options4 = options;
    options4.target_element = "#XS-pay2play-widget-4", //TARGET
    options4.access_data.purchase.pin_codes.codes[0].digital_content = digital_content4;
    var widgetInstance4 = XPay2PlayWidget.create(options4);
    
    var options5 = {
      access_data: {
        settings: {
          project_id: 37869, //PROJECT ID
        },
        purchase: {
          pin_codes: {
            codes: [
              {
                digital_content: "KCD6" //SKU NAME IN PUBLISHER
              }
            ]
          }
        }
      },
      theme: {
        foreground: "gold",
        background: "dark"
      },
      target_element: "#XS-pay2play-widget-5", //TARGET
      template: "simple",
      lightbox: {
        height: "685px"
      }
    };
    var widgetInstance5 = XPay2PlayWidget.create(options5);
    
  },
  false
);

var head = document.getElementsByTagName("head")[0]; 

head.appendChild(s);











/* Locale DropDown*/



      function toggleMenu(){
          $('#dropdown-menu').toggleClass('hidden');
      }
      function setLocale(local) {
          var heading = $('.heading'),
              textBlock = $('.text-block'),
              textBlock2 = $('.text-block-2');



          if(local != $('.language').data('ico')) {
          $.ajax({
              url: 'https://livedemo.xsolla.com/gc-xsolla-demo-store/token.php',
              data: {
                  'locale': local
              },
              method: 'get',
              dataType: 'json',
              beforeSend: function () {
                  $('#dropdown-menu').addClass('hidden');
                  $('.shop-button').addClass('disable').attr('disabled', 'disabled');
                  var ico = $('.language').data('ico');
                  $('.language').data('ico', local);
                  if(typeof languageCurrency[ico] != "undefined"){
                      $('.language').removeClass('ico-' + languageCurrency[ico].flag)
                  }
                  $('.language').text(languageCurrency[local].name);
              },
              success: function (data) {
                  var options = {
                      access_token: data['token'],
                      lightbox: {
                          width: '100%',
                          height: '100%',
                          spinner: 'round',
                          spinnerColor: '#cccccc'
                      }
                  };
                  XPayStationWidget.init(options);
                  $('.shop-button').removeClass('disable').removeAttr('disabled');
              }
          });
          }else{
              $('#dropdown-menu').addClass('hidden');
          }
      }


/* end Locale DropDown*/
              
            
!
999px

Console