Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div id="app">
  <music-player 
    cover="http://ecx.images-amazon.com/images/I/51XSHShbPiL.jpg" 
    album="The Hunting Party"
    song="Final Masquerade"
    artist="Linkin Park"
    ></music-player>
</div>

<!-- En dessous de cette ligne, ce n'est que la template -->
<script type="text/x-template" id="music-player">
  <div class="wrapper">
    <div class="player__container">
      <div class="player__body">
        <div class="body__cover">
          <ul class="list list--cover">
            <li>
              <a class="list__link" href=""><i class="fa fa-navicon"></i></a>
            </li>

            <li>
              <a class="list__link" href=""></a>
            </li>

            <li>
              <a class="list__link" href=""><i class="fa fa-search"></i></a>
            </li>
          </ul>

          <img :src="cover" alt="Album cover" />

          <div class="range"></div>
        </div>

        <div class="body__info">
          <div class="info__album">{{ album }}</div>

          <div class="info__song">{{ song }}</div>

          <div class="info__artist">{{ artist }}</div>
        </div>

        <div class="body__buttons">
          <ul class="list list--buttons">
            <li><a href="#" class="list__link"><i class="fa fa-step-backward"></i></a></li>

            <li><a href="#" class="list__link"><i class="fa fa-play"></i></a></li>

            <li><a href="#" class="list__link"><i class="fa fa-step-forward"></i></a></li>
          </ul>
        </div>
      </div>

      <div class="player__footer">
        <ul class="list list--footer">
          <li><a href="#" class="list__link"><i class="fa fa-heart-o"></i></a></li>

          <li><a href="#" class="list__link"><i class="fa fa-random"></i></a></li>

          <li><a href="#" class="list__link"><i class="fa fa-undo"></i></a></li>

          <li><a href="#" class="list__link"><i class="fa fa-ellipsis-h"></i></a></li>
        </ul>
      </div>
    </div>
  </div>
</script>

              
            
!

CSS

              
                // Functions
@function remy($value, $base: 16px) {
  @return ($value / $base) * 1rem;
}

// Mixins
@mixin transition($prop: all, $duration: .25s, $timing: cubic-bezier(.4, 0, 1, 1)) {
  transition: $prop $duration $timing;
}

// Colors
$color-black: #212121;
$color-blue: #03a9f4;
$color-red: #d30320;

// Variables
$boxshadow-0: 0 1px 3px -5px rgba(0, 0, 0, .13),
0 1px 3px -10px rgba(0, 0, 0, .23);
$boxshadow-1: 0 3px 6px -5px rgba(0, 0, 0, .16),
0 3px 6px -10px rgba(0, 0, 0, .23);
$boxshadow-2: 0 10px 20px -5px rgba(0, 0, 0, .19),
0 6px 6px -10px rgba(0, 0, 0, .23);
$boxshadow-3: 0 14px 28px -5px rgba(0, 0, 0, .25),
0 10px 10px -10px rgba(0, 0, 0, .22);
$radius: remy(4px);

// Base
html {
  font-size: 16px;
}

body {
  font-family: 'Roboto', Arial, Verdana, sans-serif;
  background: #e4f2fb;
}

a {
  text-decoration: none;
}

.player__container {
  margin-top: 2rem;
  margin-right: auto;
  margin-left: auto;
  max-width: remy(320px);
  background: #fff;
  border-radius: $radius;
  box-shadow: $boxshadow-2;
}

.body__cover {
  position: relative;
}

.body__cover img {
  max-width: 100%;
  border-radius: $radius;
}

.list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.body__buttons,
.body__info,
.player__footer {
  padding-right: 2rem;
  padding-left: 2rem;
}

.list--cover,
.list--footer {
  justify-content: space-between;
}

.list--header .list__link,
.list--footer .list__link {
  color: #888;
}

.list--cover {
  position: absolute;
  top: .5rem;
  width: 100%;

  li:first-of-type {
    margin-left: .75rem;
  }

  li:last-of-type {
    margin-right: .75rem;
  }

  a {
    font-size: 1.15rem;
    color: #fff;
  }
}

.range {
  position: relative;
  top: -1.5rem;
  right: 0;
  left: 0;
  margin: auto;
  background: rgba(#fff, .95);
  width: 80%;
  height: remy(2px);
  border-radius: $radius;
  cursor: pointer;

  &:before,
  &:after {
    content: "";
    position: absolute;
    cursor: pointer;
  }

  &:before {
    width: 3rem;
    height: 100%;
    background: linear-gradient(to right, rgba($color-red, .5), rgba($color-red, .85));
    border-radius: $radius;
    overflow: hidden;
  }

  &:after {
    top: remy(-6px);
    left: 3rem;
    z-index: 3;
    width: remy(14px);
    height: remy(14px);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0, 0, 0, .15), 0 2px 4px rgba(0, 0, 0, .15);
    
    @include transition;
  }
  
  &:focus,
  &:hover {
    &:after {
      background: rgba($color-red, .95);
    }
  }
}

.body__info {
  padding-top: 1.5rem;
  padding-bottom: 1.25rem;
  text-align: center;
}

.info__album,
.info__song {
  margin-bottom: .5rem;
}

.info__artist,
.info__album {
  font-size: .75rem;
  font-weight: 300;
  color: #666;
}

.info__song {
  font-size: 1.15rem;
  font-weight: 400;
  color: $color-red;
}

.body__buttons {
  padding-bottom: 2rem;
}

.body__buttons {
  padding-top: 1rem;
}

.list--buttons {
  align-items: center;
  justify-content: center;
}

.list--buttons li:nth-of-type(n+2) {
  margin-left: 1.25rem;
}

.list--buttons a {
  padding-top: .45rem;
  padding-right: .75rem;
  padding-bottom: .45rem;
  padding-left: .75rem;
  font-size: 1rem;
  border-radius: 50%;
  box-shadow: 0 3px 6px rgba(33,33,33,.1), 0 3px 12px rgba(33,33,33,.15);

  &:focus,
  &:hover {
    color: darken(rgba($color-red, .95), 8%);
    opacity: 1;
    box-shadow: 0 6px 9px rgba(33,33,33,.1), 0 6px 16px rgba(33,33,33,.15);
  }
}

.list--buttons li:nth-of-type(2) a {
  padding-top: .82rem;
  padding-right: 1rem;
  padding-bottom: .82rem;
  padding-left: 1.19rem;
  margin-left: .5rem;
  font-size: 1.25rem;
  color: rgba($color-red, .95);
}

.list--buttons li:first-of-type a,
.list--buttons li:last-of-type a {
  font-size: .95rem;
  color: #212121;
  opacity: .5;

  &:focus,
  &:hover {
    color: $color-red;
    opacity: .75;
  }
}

.list__link {
  @include transition;

  &:focus,
  &:hover {
    color: $color-red;
  }
}

.player__footer {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.list--footer a {
  opacity: .5;

  &:focus,
  &:hover {
    opacity: .9;
  }
}

              
            
!

JS

              
                Vue.component('music-player', {
  template: "#music-player",
  props: ["artist", "album", "song", "cover"]
})

new Vue({
  el: '#app'
})
              
            
!
999px

Console