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 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

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

              
                <link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>


<h1 class="title">Alva </h1>

<div class="stage">
  <div class="faceleft btn">Turn left</div>
  <div class="faceright btn">Turn right</div>
  <div class="floor">
  </div>
  <div class="alva-container">
    <div class="alva bob"></div>
    <span class="shadow"></span>
    <span class="label">Alva</span>
  </div>
  <div class="hater-container">
    <div class="hater">
      <div class="mask">
        <img style="opacity:.8box" src="https://rawgit.com/alexmwalker/ResponsiveSVG/master/haters-eyes.svg?y=142" />
      </div>
       
    </div>
    <span class="shadow"></span>
    <span class="label">Hayta</span>

  </div>
  
</div>
              
            
!

CSS

              
                $yellowR: 256;
$yellowG: 220;
$alva-width: 10rem;

.stage{
  height: 400px;
  position: relative;
}

.floor{
  background: url(https://cdn.rawgit.com/alexmwalker/ResponsiveSVG/master/floor.svg) repeat;
  height: 128px;
  position: absolute;
  width: 100%;
  bottom: 0;
  background-size: 70%
}
.alva-container{
  position: absolute;
  left: 20%;
  
}
.alva  {
  width: $alva-width;
  height: $alva-width * 1.7;
  
  background:   
 url(https://rawgit.com/alexmwalker/ResponsiveSVG/master/alva-face-arms.svg)  50% 90% no-repeat,
url(https://cdn.rawgit.com/alexmwalker/ResponsiveSVG/master/filament.svg?3-4) 50% 18% no-repeat, 
 url(https://cdn.rawgit.com/gist/alexmwalker/61f1b535d829f50f9cee1f42986ec2a6/raw/0444b0e072d61502ac5645af6ad1569913af7343/alva-body.svg) 0px 0px no-repeat;
  background-size: 250%, 285%, 100%;
  animation: bob 5s infinite;
  
  
}
 
.faceleft, 
.faceright{
 width: 5em; 
  top: 5em
}
.faceleft {
  left:0;
  &:hover ~ .hater-container .hater .mask img{ margin: 35% 0 0 35%;}
  
  &:hover ~ .floor{
    animation: floorleft .5s infinite linear;
  } 
  
   &:hover ~ .alva-container .alva{
   background:    url(https://rawgit.com/alexmwalker/ResponsiveSVG/master/alva-face-arms.svg)  -20% 90% no-repeat,
url(https://cdn.rawgit.com/alexmwalker/ResponsiveSVG/master/filament.svg?3-2) -3% 28% no-repeat, 
 url(https://cdn.rawgit.com/gist/alexmwalker/61f1b535d829f50f9cee1f42986ec2a6/raw/0444b0e072d61502ac5645af6ad1569913af7343/alva-body.svg) 0px 0px no-repeat;
    background-size: 250%, 265%, 100%;
    
     animation-duration: 3s;
  }
}

.faceright {
 right: 0;
  
    &:hover ~ .floor{
    animation: floorleft .5s infinite linear reverse;
  }
  
   &:hover ~ .hater-container .hater .mask img{ margin: 35% 0 0 -110%;}
  
   &:hover ~ .alva-container .alva{
   
   background:      url(https://rawgit.com/alexmwalker/ResponsiveSVG/master/alva-face-arms.svg)  118% 90% no-repeat,
 url(https://cdn.rawgit.com/alexmwalker/ResponsiveSVG/master/filament.svg?r=13) 103% 28% no-repeat, 
 url(https://cdn.rawgit.com/gist/alexmwalker/61f1b535d829f50f9cee1f42986ec2a6/raw/0444b0e072d61502ac5645af6ad1569913af7343/alva-body.svg) 0px 0px no-repeat;
    background-size: 250%, 265%, 100%;
   
    animation-duration: 3s;

  }
}



.shadow {
  width: 50%;
  height: 1rem;
  background: rgba(0, 0, 0, .3);
  border-radius: 50%;
  display: block;
  position: absolute;
  bottom: -4rem;
  left: 30%;
}


.stage{
  position: relative;
}

.label{
  font-family: sans-serif;
  color: #ddd;
  display: block;
  position: absolute;
  width: 100%;
  text-align: center;
  bottom: -7em;
}

/* #########  Hater ######## */

$number-of-frames: 3;
$speed: .6s;
$frame-width : 260px;
$frame-height: $frame-width * 1;  // set as a ratio
$sprite-width: $frame-width * $number-of-frames; /* <-- totalwidth of spritesheet*/  
$sprite1: 'https://rawgit.com/alexmwalker/ResponsiveSVG/master/hater-base2.svg?3';
$sprite2: '';


.mask{
  overflow: hidden;
}
.hater-container{
  position: absolute;
  left: 50%;  
  top: 1.5em;
}
.hater {
  width: $frame-width; 
  height: $frame-height; 
  background: url($sprite1); 
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: 5px;
  margin: 0 auto;    
  img{ 
    width: 185%;
    margin: 37% 0 0 -42%;
    
  }
}





/* ####### title ####### */
.title {
  color: #fff;
  text-align: center;
  font: 5em/1em 'Pacifico', cursive;
  transform: skew(-5deg, -10deg);
  text-shadow:
    10px 20px 6px rgba(0, 0, 0, .15),
    0px 0px 2px rgba(0, 0, 0, .5), 
    0px 0px 3px rgba($yellowR, $yellowG, 0, 1),
    0px 0px 4px rgba($yellowR, $yellowG, 0,  .8),
    0px 0px 6px rgba($yellowR, $yellowG, 0,  .7),
    0px 0px 8px rgba($yellowR, $yellowG, 0,  6),
    0px 0px 10px rgba($yellowR, $yellowG, 0,  .5),
    0px 0px 13px rgba($yellowR, $yellowG, 0, .4),
    0px 0px 16px rgba($yellowR, $yellowG, 0,  .3),
    0px 0px 20px rgba($yellowR, $yellowG, 0,  .3),
    0px 0px 26px rgba($yellowR, $yellowG, 0,  .3),
    0px 0px 34px rgba($yellowR, $yellowG, 0,  .3);
}




/* ####### background ####### */

body{
  background: #476678  url(https://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2016/05/1464334245bg.svg);
  background-size: 100%;
  background-repeat: no-repeat
}

/* ####### ANIMATION ####### */

.bob {
  animation: bob 4s infinite ease-in-out;
  transform-origin: 0 0;
}



@keyframes bob {
  5%,
  95%,
  100% {
    transform: translate(0px, 0px)
  }
  50% {
    transform: translate(0px, 24px) 
  }
}

@keyframes floorleft {
  0%  {background-position: 0, 0}
  100%{background-position: 150%, 0}
}

/* ####### BUTTONS ####### */
.btn {
  background: #3498db;
  position: absolute;
  background-image: linear-gradient(to bottom, #3498db, #2980b9);
  -webkit-border-radius: 28;
  -moz-border-radius: 28;
  border-radius: 28px;
  font-family: Arial;
  color: #ffffff;
  font-size: 20px;
  padding: 10px 20px 10px 20px;
  text-decoration: none;
}

.btn:hover {
  background: #3cb0fd;
  background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
  text-decoration: none;
}
              
            
!

JS

              
                
              
            
!
999px

Console