cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

              <html lang="en">
  <meta charset="UTF-8"/>
<link href='https://fonts.googleapis.com/css?family=Sintony:400' rel='stylesheet' type='text/css'>
  <script src='//w.soundcloud.com/player/api.js'></script>
	<div class='player'>
	  <div class='art'></div>
	  <div class='info'>
      <div class='title'></div>
      <div class='song'></div>
	    <div class='progress'>
	      <div class='progress-bar'></div>
	  <div class='controls'>
	    <button class='play glyphicon glyphicon-play'></button>    
	    <button class='backward glyphicon glyphicon glyphicon-backward'></button>
	    <button class='forward glyphicon glyphicon-forward'></button>      
      <div class="settings glyphicon glyphicon-cog"></div>
  <iframe class="sc-widget" src="//w.soundcloud.com/player/?url=//soundcloud.com/caribouband"></iframe>
              * { 
  box-sizing: border-box;
  transition: background 1s ease-in;
iframe { display: none; }
  background: #d2d5d6;
  font-family: 'Sintony', sans-serif;
  font-size: 16px;
.player {
  overflow: hidden;
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  margin: auto;
  height: 250px;
  width: 220px;
  background: #edf0f2;
  border-radius: 10px;
    0 8px 10px 2px rgba(0,0,0,.1),
    0 30px 15px -5px rgba(0,0,0,.05);
.art {
  overflow: hidden;
  height: 32%;
  width: 100%;
  background: #DDD;
  background-image: url('');
  background-size: cover;
  background-position: center;
.info {
  height: 20%;
  margin-top: 15%;  
  padding: 0 10%;
.info .title { 
  height: 50%;
  width: 100%;
  font-size: 0.9em;
  color: #48586b;
  text-shadow: 0 1px #EFEFEF;
.info .song {
  height: 50%;
  display: block;
  font-size: 0.6em;
  color: #6a7888;
.info .progress {
  user-select: none;
  cursor: pointer;
  clear: both;
  overflow: hidden;
  position: relative;
  top: 18px;
  height: 4px;
  width: 100%;
  background: #333;
  border-radius: 3px;
  box-shadow: 0 -1px 0 1px #DFDFDF;
.progress .progress-bar {
  height: 100%;
  width: 0%;
  background: #cdd2d7;
  border-radius: 5px;
.controls {
  position: relative;
  margin: 18% 0 6.5% 0; 
  padding: 0 10%;
.controls button {
  cursor: pointer;
  position: absolute;
  height: 27px;
  width: 27px;
  border: none;
  text-align: center;  
  background: #414141;
  color: #d9d9d9;
  border-radius: 50%;
  font-size: 0.8em;
  transition: .1s;
  line-height: 1em;
.controls button:hover {
  opacity: 0.95;
.controls button:active{
  opacity: 0.5;
.controls .play {
  height: 37px;
  width: 37px;
  font-size: 1.2em;
  line-height: 35px;
.controls .backward, .controls .forward {
  top: .7em;
  font-size: .5em;
  letter-spacing: .4em;
  line-height: .7em;
.controls .backward {
  left: 28%;
.controls .forward {
  left: 42%;  
  letter-spacing: .3em;
  text-align: right;

.controls .settings {
  cursor: pointer;
  color: #CCC;
  float: right;
  margin-top: 5%;

.controls .settings:hover { color: #AAA; }

  var player  =  SC.Widget($('iframe.sc-widget')[0]);

	var pOffset = $('.progress').offset(); //Zero the progress bar
  var pWidth = $('.progress').width();
	var scrub;

  player.bind(SC.Widget.Events.READY, function(eventData) { setInfo();	}); //Set info on load
  player.bind(SC.Widget.Events.PLAY_PROGRESS, function(e) {
    if( e.relativePosition < 0.003 ) { setInfo(); }
    //Event listener when track is playing
    $('.progress-bar').css('width', ( e.relativePosition*100)+"%");

    if( !$(".play").hasClass('glyphicon-pause') ) {

  player.bind(SC.Widget.Events.PAUSE, function(e) {   //Event listener when track is paused

  $('.progress').mousemove(function(e){ //Get position of mouse for scrubbing
    scrub = (e.pageX-pOffset.left);

  $('.progress').click(function(){ //Use the position to seek when clicked
    var seek = player.duration*(scrub/pWidth);

  $('.play').click(function(){ player.toggle(); });    
  $('.backward').click(function(){ player.prev(); });  
  $('.forward').click(function(){ player.next(); });

  function setInfo() {
    player.getCurrentSound(function(song) {
      if(!song) {
        $('.art').css('background-image', '');
        $('.song').html('No artist found :(');
      $('.art').css('background-image', "url('" + song.artwork_url.replace('-large', '-t500x500') + "')");
      player.current = song;
      player.duration = value;

      player.getPaused = bool;

    var url = prompt('Enter Soundcloud Url','https://soundcloud.com/');
    if (url) {
    var option = {
      callback: function(){
    player.load(url , option);
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................