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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                .lildude-home
  h1 Li'l Singing Dudes
  p &#40;Prod them to watch them sing! For real this time!&#41;
.lildude
    .lildude-eye-l
    .lildude-eye-r
    .lildude-mouth
.lildude2
    .lildude-eye-l
    .lildude-eye-r
    .lildude-mouth
.lildude3
    .lildude-eye-l
    .lildude-eye-r
    .lildude-mouth

audio#dude3song(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/193804/ooo.mp3" preload="auto" loop)
  p Your browser does not support the audio element.
audio#dude1song(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/193804/aaa.mp3" preload="auto" loop)
  p Your browser does not support the audio element.
audio#dude2song(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/193804/ahh.mp3" preload="auto" loop)
  p Your browser does not support the audio element.
              
            
!

CSS

              
                @import bourbon

@import url(https://fonts.googleapis.com/css?family=Fredoka+One)

*
  user-select: none
  
// Thanks to Ryan (@ryanmcnz) for the fair point on avoiding blue boxes over the li'l dudes.
  
h1
  font-family: "Fredoka One"
  text-align: center
  font-size: 80px
  color: #444
  margin-bottom: 0px
  
p
  font-family: "Fredoka One"
  text-align: center
  font-size: 30px
  color: #777
  margin-top: 15px
  
  
body
  background: linear-gradient(135deg, #fff 25%, transparent 25%) -50px 0, linear-gradient(225deg, #fff 25%, transparent 25%) -50px 0, linear-gradient(315deg, #fff 25%, transparent 25%), linear-gradient(45deg, #fff 25%, transparent 25%)
  background-size: 100px 100px
  background-color: #EEE

// Background hailing from Lea Verou's CSS3 Patterns page (http://lea.verou.me/css3patterns/)

.lildude-home
  height: 100%
  width: 100%
  overflow: hidden

.lildude, .lildude2, .lildude3
  position: absolute
  left: calc(50% - 100px)
  bottom: 0%
  height: 60%
  width: 200px
  background-color: #FF9624
  margin: 0 auto
  border-radius-topleft: 100px
  border-radius-topright: 100px
  border-radius-bottomright: 0
  border-radius-bottomleft: 0
  border-top-left-radius: 100px
  border-top-right-radius: 100px
  border-bottom-right-radius: 0
  border-bottom-left-radius: 0
  transition: height ease 0.5s
  
  &:hover
    height: 55%
    transition: height ease 0.5s
  
  .lildude-eye-l
    height: 20px
    width: 20px
    float: left
    position: relative
    top: 70px
    left: 60px
    background-color: #fff
    border-radius: 10px
    
  .lildude-eye-r
    height: 20px
    width: 20px
    float: left
    position: relative
    top: 70px
    left: 100px
    background-color: #fff
    border-radius: 10px
    
  .lildude-mouth
    width: 80px
    height: 20px
    border-radius: 10px
    position: relative
    top: 115px
    left: 60px
    background-color: #fff
    transition: height ease 0.25s
      
  &:active
    height: 75%
    transition: height ease 0.5s
    .lildude-mouth
      height: 70px
      transition: height ease 0.25s
      
.lildude2
  left: calc(50% + 150px)
  background-color: #A8D30D
  
  .lildude-mouth
    width: 80px
    height: 20px
    border-radius: 10px
    position: relative
    top: 115px
    left: 60px
    background-color: #fff
    transition: tremolo ease 0.1s 
      
  &:active
    height: 75%
    transition: height ease 0.5s
    .lildude-eye-l
      width: 30px
      height: 10px
      left: 55px
      top: 75px
      transition: width ease 0.1s, left ease 0.1s, height ease 0.1s, top ease 0.1s
    .lildude-eye-r
      width: 30px
      height: 10px
      left: 85px
      top: 75px
      transition: width ease 0.1s, left ease 0.1s, height ease 0.1s, top ease 0.1s
    .lildude-mouth
      transition: height ease 0.1s
      height: 150px
      animation: tremolo ease 0.1s infinite
    
    @keyframes tremolo
      0%
        transform: rotate(-3deg)
      50%
        transform: rotate(3deg)
      100%
        transform: rotate(-3deg)

.lildude3
  left: calc(50% - 350px)
  background-color: #C416B8
  
  .lildude-mouth
    width: 80px
    height: 20px
    border-radius: 10px
    position: relative
    top: 115px
    left: 60px
    background-color: #fff
    transition: width ease 0.25s, left ease 0.25s
      
      
  &:active
    height: 75%
    transition: height ease 0.5s
    .lildude-mouth
      height: 20px
      width: 20px
      left: 90px
      transition: width ease 0.25s, left ease 0.25s

              
            
!

JS

              
                var audio = $("#dude1song")[0];

$(".lildude").mousedown(function() {
  audio.play();})

$(".lildude").mouseup(function() {
  audio.pause();})

var audio2 = $("#dude2song")[0];

$(".lildude2").mousedown(function() {
  audio2.play();
});

$(".lildude2").mouseup(function() {
  audio2.pause();})

var audio3 = $("#dude3song")[0];

$(".lildude3").mousedown(function() {
  audio3.play();
});

$(".lildude3").mouseup(function() {
  audio3.pause();})
              
            
!
999px

Console