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="cd-player">
  <div class="cd-player-inner">
    <div class="play-cover">

    </div>
    <div class="cd">
      <div class="album-cover spin">
        <img src="https://d3rt1990lpmkn.cloudfront.net/unbranded/d83a086148afe6539dae524607cbe4b6ccdd0360" alt="">

      </div>
      <div class="song-info">
        <h2 class="song-title"></h2>
        <h3 class="song-singer"> </h3>
        <h4 class="song-hits"></h4>
      </div>
    </div>
  </div>
</div>
<div class="remoter">
  <div class="btn btn-prev">
    <div class="icon"></div>
  </div>
  <div class="btn btn-next">
    <div class="icon"></div>
  </div>
  <div class="btn btn-repeat">
    <div class="icon">REPEAT</div>
  </div>
  <div class="btn btn-pause">
    <div class="icon"></div>
  </div>
  <div class="btn btn-vol-up">
    <div class="icon"></div>
  </div>

  <div class="btn btn-vol-down">
    <div class="icon"></div>
  </div>
  <label class="vol-label">VOLUME</label>
</div>
              
            
!

CSS

              
                @mixin centerer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@mixin has-child {
    &:before, &:after {
        content: "";
        display: block;
        position: absolute;
    }
}

@mixin text-overflow {
    white-space: nowrap;       /* No line breaks */
    overflow: hidden;          /* Hide text which does not fit the block */
    text-overflow: ellipsis;   /* Cut off with ellipsis */
    display: block;            /* Works only for block elements */
}

* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    &:before, &:after {
        box-sizing: border-box;
    }
}

html {
    background: linear-gradient(45deg, #43cea2 10%, #185a9d 90%);
}

body {
    position: relative;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

h1 {
    color: #fff;
    text-indent: 3em;
    font-size: 2em;
    text-shadow: 3px 3px rgba(0, 0, 0, 0.2);
    font-family: 'Oswald', sans-serif;
}

.cd-player {
    width: 300px;
    height: 300px;
    border-radius: 15%;
    background: #eee;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.4);
    position: absolute;
    right: 50%;
    top: 15%;
    @include has-child;
    &:before {
        width: 6px;
        height: 1000px;
        position: absolute;
        left: 50%;
        transform: translate(-50%, 0);
        top: 300px;
        background: white;
        box-shadow: inset -3px 0 3px 0 rgba(0, 0, 0, 0.4), 1px 1px 3px 0 rgba(0, 0, 0, 0.4);
        z-index: -2;
    }
}

.cd-player-inner {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.5), 0 0 5px 0 rgba(0, 0, 0, 0.5);
    overflow: hidden;
    @include centerer;
    @include has-child;
    &:before {
        width: 100px;
        height: 100px;
        left: 0;
        top: 75px;
        background: #414141;
        box-shadow: inset 0 0 10px 5px rgba(0, 0, 0, 0.5);
        z-index: -2;
    }
    &:after {
        width: 20px;
        height: 20px;
        background: #242424;
        left: 3px;
        top: 115px;
        border-radius: 50%;
        box-shadow: inset 1px 1px 3px 0 rgba(0, 0, 0, 0.5), 1px 1px 3px 0 rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}


.spin {
    animation-play-state: running !important;
}

.cd {
    width: 220px;
    height: 220px;
    border: 10px solid #fff;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    @include centerer;
    &:hover {
        //     .album-cover {
        //     animation-play-state: paused;
        // }
        .song-info {
            opacity: 1;
        }
    }
    .album-cover {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        overflow: hidden;
        @include centerer;
        animation: spin 20s linear infinite;
        animation-play-state: paused;
    }
    img {
        display: block;
        width: 100%;
        @include centerer;
    }
}

.song-info {
    position: absolute;
    top: 0;
    left: 0;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
    width: 100%;
    height: 100%;
    text-align: center;
    opacity: 0;
    transition: all 1s;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
}

.song-title {
    font-size: 1em;
    margin-top: 5em;
    @include text-overflow;
}

.song-singer {
    font-size: .75em;
    @include text-overflow;
}

.song-hits {
    font-size: .75em;
}

.remoter {
    width: 150px;
    height: 300px;
    background: #a3a3a3;
    border: 1px solid #817e75;
    box-shadow: 0 0 0 3px #cacbc5, 5px 3px 10px 6px rgba(0, 0, 0, 0.4);
    border-radius: 10px 10px 30px 30px;
    position: absolute;
    bottom: 10%;
    left: 60%;
    $btn-color: #2d2f2e;
    @include has-child;
    &:before {
        width: 6px;
        height: 2px;
        border-radius: 1px;
        z-index: -1;
        position: absolute;
        left: 30px;
        top: 0;
        transition: top .2s;
        box-shadow: 0 0 10px 7px rgba(255, 0, 0, 0.7);
    }
    .btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 3px solid $btn-color;
        position: absolute;
        &:hover {
            cursor: pointer;
            border-color: lighten($btn-color, 10%);
        }
    }
    .btn-prev {
        top: 15px;
        left: 20px;
        .icon {
            width: 2px;
            height: 10px;
            background: $btn-color;
            @include centerer;
            left: 8px;
            @include has-child;
            &:before, &:after {
                width: 0;
                height: 0;
                border-style: solid;
                border-width: 5px 10px;
                border-color: transparent $btn-color transparent transparent;
                @include centerer;
            }
            &:after {
                left: 10px;
            }
        }
    }
    .btn-next {
        top: 15px;
        right: 20px;
        .icon {
            width: 2px;
            height: 10px;
            background: $btn-color;
            @include centerer;
            left: 26px;
            @include has-child;
            &:before, &:after {
                width: 0;
                height: 0;
                border-style: solid;
                border-width: 5px 10px;
                border-color: transparent transparent transparent $btn-color;
                @include centerer;
            }
            &:after {
                left: -8px;
            }
        }
    }
    .btn-repeat {
        top: 70px;
        left: 20px;
        &.active {
            border-color: lighten($btn-color, 20%);
        }
        .icon {
            font-size: 12px;
            font-weight: bold;
            @include centerer;
            transform: translate(-50%, -50%) scale(0.6);
        }
    }
    .btn-pause {
        top: 70px;
        right: 20px;
        &.active .icon {
            &:before, &:after {
                width: 0;
                height: 0;
                background: transparent;
            }
            &:before {
                border-style: solid;
                border-width: 5px 10px;
                border-color: transparent transparent transparent $btn-color;
                @include centerer;
                transform: translate(-20%, -50%);
            }
        }
        .icon {
            width: 0;
            height: 0;
            @include centerer;
            @include has-child;
            &:before, &:after {
                width: 4px;
                height: 10px;
                background: $btn-color;
                position: absolute;
                top: -5px;
            }
            &:before {
                right: 2px;
            }
            &:after {
                left: 2px;
            }
        }
    }
    .btn-vol-up {
        top: 125px;
        right: 20px;
        background: $btn-color;
        .icon {
            width: 0;
            height: 0;
            @include centerer;
            @include has-child;
            &:before {
                width: 2px;
                height: 16px;
                background: #a3a3a3;
                @include centerer;
            }
            &:after {
                width: 16px;
                height: 2px;
                background: #a3a3a3;
                @include centerer;
            }
        }
    }
    .btn-vol-down {
        top: 180px;
        right: 20px;
        background: $btn-color;
        .icon {
            width: 0;
            height: 0;
            @include centerer;
            @include has-child;
            &:after {
                width: 16px;
                height: 2px;
                background: #a3a3a3;
                @include centerer;
            }
        }
    }
    .vol-label{
        font-size:12px;
        font-weight: bold;

        position:absolute;
       top: 230px;
        right: 15px;
        transform:scale(.7);
    }
}







.play-cover {
    display: none;
}

@media screen and (max-width: 414px) {
    h1 {
        text-indent: 0;
        text-align: center;
    }
    .remoter{
        display:none;
    }
    .play-cover {
        display: block;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 100;
        @include has-child;
        &:before {
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 30px 60px;
            border-color: transparent transparent transparent #fff;
            left: 50%;
            top: 50%;
            transform: translate(-20%, -50%);
        }
        &:after {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 3px solid #fff;
            background: transparent;
            box-shadow: 3px 3px 3px 0 rgba(0, 0, 0, 0.2);
            @include centerer;
        }
    }
    .cd-player {
        top: 50%;
        left:50%;
        transform: translate(-50%, -50%);
    }
  
}
              
            
!

JS

              
                
              
            
!
999px

Console