LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
  
CSS
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}
body {
  background-color: #333;
  color: #eee;
  font-family: Helvetica, Arial;
  font-size: 3vmin;
}

.hidden {
  display: none;
}

/** Buttons **/
.btn {
  background-color: transparent;
  border-radius: 2em;
  border: 0.2em solid #1ecd97;
  color: #1ecd97;
  cursor: pointer;
  font-size: 3vmin;
  padding: 0.7em 1.5em;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.btn:hover {
  background: #1ecd97;
  color: #333;
}

.btn--login {
  margin: 0 auto;
}

/** Now Playing **/
.now-playing__name {
  font-size: 1.5em;
  margin-bottom: 0.2em;
}

.now-playing__artist {
  margin-bottom: 1em;
}

.now-playing__status {
  margin-bottom: 1em;
}

.now-playing__img {
  float: left;
  margin-right: 10px;
  text-align: right;
  width: 45%;
}

.now-playing__img img {
  max-width: 80vmin;
  width: 100%;
}

.now-playing__side {
  margin-left: 5%;
  width: 45%;
}

/** Progress **/
.progress {
  border: 0.15em solid #eee;
  height: 1em;
}

.progress__bar {
  background-color: #eee;
  border: 0.1em solid transparent;
  height: 0.75em;
}

/** Background **/
.background {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-size: cover;
  background-position: center center;
  filter: blur(8em) opacity(0.6);
  position: absolute;
}

.main-wrapper {
  align-items: center;
  display: flex;
  height: 100%;
  margin: 0 auto;
  justify-content: center;
  position: relative;
  width: 80%;
  z-index: 1;
}

.container {
  align-items: center;
  display: flex;
  justify-content: center;
  height: 100%;
}

.main-container {
  flex: 1;
}
JS
var mainContainer = document.getElementById('js-main-container'),
    loginContainer = document.getElementById('js-login-container'),
    loginButton = document.getElementById('js-btn-login'),
    background = document.getElementById('js-background');

var spotifyPlayer = new SpotifyPlayer();

var template = function (data) {
  return `
    
${data.item.name}
${data.item.artists[0].name}
${data.is_playing ? 'Playing' : 'Paused'}
`; }; spotifyPlayer.on('update', response => { mainContainer.innerHTML = template(response); }); spotifyPlayer.on('login', user => { if (user === null) { loginContainer.style.display = 'block'; mainContainer.style.display = 'none'; } else { loginContainer.style.display = 'none'; mainContainer.style.display = 'block'; } }); loginButton.addEventListener('click', () => { spotifyPlayer.login(); }); spotifyPlayer.init();
Host Instantly Drag and Drop Website Builder

 

Term
Wed, 11/29/2017 - 11:23

Related Codes

Pen ID
Pen ID
Pen ID