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

              
                <body>
  
  <h2 class="petme">
  Click and Drag to Pet Me!
  </h2>
  
  <div id="cat">
    
      <div class="head">
        <div class="stripe">
        </div>
        <div class="stripe stripe2">
        </div>
        <div class="stripe stripe3">
        </div>
        <div class="ear1">
        </div>
        <div class="ear2">
        </div>
        <div class="eye1 eye">
        </div>
        <div class="eye2 eye">
        </div>
        <div class="nose">
        </div>
        <div class="mouth">
          (
          <span></span>
          (
        </div>
      </div>
    <div class="catbody">
      <div class="stripe">
      </div>
      <div class="stripe mid">
      </div>
     <div class="stripe front">
      </div>
    </div>
    <div class="paw paw1">
    </div>
    <div class="paw paw2">
    </div>
    <div class="paw paw3">
    </div>
    <div class="tail">
    </div>
    <div class="pillow">
    </div>
  </div>
  
</body>
              
            
!

CSS

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

body{
  background:#d4bc7c;
  cursor: url(https://puu.sh/pD2Ti/1501ac33bd.cur), none;
}

.petme{
  color:#32262c;
  text-align:center;
  padding-top:1em;
  font-family:'Fredoka One', sans-serif;
}

body #cat .purr{
animation-name: purring !important;
	-webkit-animation-name: purring !important;	
	animation-duration: .1s !important;	
	-webkit-animation-duration: .1s;
	animation-iteration-count: infinite;
	-webkit-animation-iteration-count: infinite;
}

@keyframes purring {
	0% {
		transform: rotate(80deg) scaleX(0.991);
	}
	50% {
		transform: rotate(80deg) scaleX(1);
	}	
	100% {
		transform: rotate(80deg) scaleX(0.991);
	}			
}

@-webkit-keyframes purring {
	0% {
		-webkit-transform: rotate(80deg) scaleX(0.99);
	}
	50% {
		-webkit-transform: rotate(80deg) scaleX(1);
	}	
	100% {
		-webkit-transform: rotate(80deg) scaleX(0.99);
	}			
}

#cat{
  user-drag: none; 
  user-select: none;
  -moz-user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  max-width:600px;
  position:absolute;
  width:100%;
  height:500px;
  display:block;
  margin:0px auto;
  left:50%;
  top:50%;
  transform:translateX(-50%) translateY(-50%);
  -webkit-transform:translateX(-50%) translateY(-50%);
  -moz-transform:translateX(-50%) translateY(-50%);
  opacity:1;
  z-index:999;
  }

.head{
  display:block;
  height:130px;
  width:210px;
  background:#b29782;
  border:10px solid #000;
  position:absolute;
  z-index:5;
  opacity:1;
  border-radius:50%;
  -webkit-border-radius:50%;
  -moz-border-radius:50%;
  transform:rotate(-10deg) translateZ(15px);
  -webkit-transform:rotate(-10deg) translateZ(15px);
  -moz-transform:rotate(-10deg) translateZ(15px);
  top:43%;
  left:18.5%; 
  transition:0.15s ease-in-out;
  -webkit-transition:0.15s ease-in-out;
  -moz-transition:0.15s ease-in-out;
}

.ear1, .ear2{
  width:40px;
  height:40px;
  display:block;
  background:#b29782;
  border:10px solid #000;
  position:absolute;
}

.ear1{
  transform:rotate(12deg);
  -webkit-transform:rotate(12deg);
  -moz-transform:rotate(12deg);
  top:-5.5%;
  margin-left:3px;
  border-bottom:0px solid;
  border-right:0px solid
}

.ear2{
  transform:rotate(-16deg);
  -webkit-transform:rotate(-16deg);
  -moz-transform:rotate(-16deg);
  right:5%;
  top:-10%;
  border-bottom:0px solid;
  border-left:0px solid;
}

.eye1, .eye2, .nose{
  display:block;
  width:33px;
  height:10px;
  background:#000;
  position:absolute;
  transform:rotate(-4deg);
  -webkit-transform:rotate(-4deg);
  -moz-transform:rotate(-4deg);
  border-radius:35%;
  -webkit-border-radius:35%;
  -moz-border-radius:35%;
  transition:0.1s ease-in-out;
  -webkit-transition:0.1s ease-in-out;
  -moz-transition:0.1s ease-in-out;
}

.purreye{
   transform:rotate(-4deg) !important;
  -webkit-transform:rotate(-4deg) !important;
  -moz-transform:rotate(-4deg) !important;
    border-radius:35% !important;
  -webkit-border-radius:35% !important;
  -moz-border-radius:35% !important;
    width:33px;
    height:8px;
}

.stripe{
  display:block;
  height:30%;
  width:8%;
  position:absolute;
  background:#32262c;
  z-index:2;
  border-radius:0 0% 40% 40%;
  -webkit-border-radius:0 0% 40% 40%;
  -moz-border-radius:0 0% 40% 40%;
  transform:rotate(-5deg);
  -webkit-transform:rotate(-5deg);
  -moz-transform:rotate(-5deg);
  left:30%;
  top:2%;
}

.catbody .stripe{
  width:30%;
  height:8%;
  left:5%;
  top:20%;
  transform:rotate(0deg);
  -webkit-transform:rotate(0deg);
  -moz-transform:rotate(0deg);
  border-radius:30px 20px 20px 0px;
  -webkit-border-radius:30px 20px 20px 0px;
  -moz-border-radius:30px 20px 20px 0px;
}

.catbody .mid{
  top:55%;
  left:0%;
  border-radius:0px 20px 20px 10px;
  -webkit-border-radius:0px 20px 20px 10px;
  -moz-border-radius:0px 20px 20px 10px;
  width:40%;
  height:8%;
  transform:rotate(-3deg);
  -webkit-transform:rotate(-3deg);
  -moz-transform:rotate(-3deg);
}

.catbody .front{
  top:34%;
  left:0%;
  border-radius:4px 20px 20px 0px;
  -webkit-border-radius:4px 20px 20px 0px;
  -moz-border-radius:4px 20px 20px 0px;
  width:40%;
  height:15%;
  transform:rotate(2deg);
  -webkit-transform:rotate(2deg);
  -moz-transform:rotate(2deg);
  
}

.stripe2{
  left:43%;
  width:10%;
  height:37%;
  top:-0.5%;
  transform:rotate(0deg);
  -webkit-transform:rotate(0deg);
  -moz-transform:rotate(0deg);
}

.stripe3{
  left:58%;
  top:-0%;
  transform:rotate(5deg);
  -webkit-transform:rotate(5deg);
  -moz-transform:rotate(5deg);
}

.eye1{
  top:56%;
  right:18%;
}

.eye2{
  top:60%;
  right:63%;
}

#cat:hover .eye1, #cat:hover .eye2{
  transform:scaleY(1.8) scaleX(0.5);
  -webkit-transform:scaleY(1.8) scaleX(0.5);
  -moz-transform:scaleY(1.8) scaleX(0.5);
  border-radius:50%;
  -webkit-border-radius:50%;
  -moz-border-radius:50%;
  
}

#cat:hover .head{
  transform:translateY(-5px)  translateZ(15px);
  -webkit-transform:translateY(-5px)  translateZ(15px);
  -moz-transform:translateY(-5px)  translateZ(15px);
}

.nose{
  top:68%;
  right:40%;
  z-index:0;
}

.mouth{
  font-family: 'Ubuntu Condensed', sans-serif;
  user-select: none;
  -webkit-user-select: none; /* Chrome/Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */
  user-drag: none; 
-webkit-user-drag: none;
  display:block;
  position:absolute;
  font-size:40px;
  transform:rotate(-95deg);
  -webkit-transform:rotate(-95deg);
  -moz-transform:rotate(-95deg);
  border-radius:20%;
  -webkit-border-radius:20%;
  -moz-border-radius:20%;
  font-weight:bold;
  text-shadow:1px 1px #000, -1px 1px #000;
  line-height:0.8;
  top:53%;
  right:45%;
}

.mouth span{
  line-height:0px;
  font-size:0px;
  display:block;
}


.paw{
  height:90px;
  width:60px;
  display:block;
  background:#b29782;
  border:10px solid #000;
  position:absolute;
  z-index:0;
  opacity:1;
  border-radius:50%;
  -webkit-border-radius:50%;
  -moz-border-radius:50%;
  transform:rotate(-50deg)  translateZ(2px);
  -webkit-transform:rotate(-50deg)  translateZ(2px);
  -moz-transform:rotate(-50deg)  translateZ(2px);
  top:61%;
  left:28.5%; 
  transition:0.2s ease-in-out;
  
}

.paw1{
  width:50px;
}

#cat:hover .paw1{
  transform:rotate(-20deg) translateY(-10px) translateZ(2px);
  -webkit-transform:rotate(-20deg) translateY(-10px) translateZ(2px);
  -moz-transform:rotate(-20deg) translateY(-10px) translateZ(2px);
}

.paw2{
  left:43%;
  top:56%;
  transform:rotate(-20deg) translateZ(2px);
  -webkit-transform:rotate(-20deg) translateZ(2px);
  -moz-transform:rotate(-20deg) translateZ(2px);
}

#cat:hover .paw2{
  transform:rotate(-40deg) translateZ(2px);
  -webkit-transform:rotate(-40deg) translateZ(2px);
  -moz-transform:rotate(-40deg) translateZ(2px);
}

.catbody{
  display:block;
  height:230px;
  width:160px;
  background:#b29782;
  border:10px solid #000;
  position:absolute;
  z-index:-2;
  border-radius:50%;
  -webkit-border-radius:50%;
  -moz-border-radius:50%;
  transform:rotate(80deg) translateZ(5px);
  -webkit-transform:rotate(80deg) translateZ(5px);
  -moz-transform:rotate(80deg) translateZ(5px);
  top:25%;
  left:34.5%; 
	animation-name: pulse;
	-webkit-animation-name: pulse;	
	animation-duration: 4.5s;	
	-webkit-animation-duration: 4.5s;
	animation-iteration-count: infinite;
	-webkit-animation-iteration-count: infinite;
}

@keyframes pulse {
	0% {
		transform: rotate(80deg) scaleX(0.95) translateZ(5px);
	}
	50% {
		transform: rotate(80deg) scaleX(1) translateZ(5px);
	}	
	100% {
		transform: rotate(80deg) scaleX(0.95) translateZ(5px);
	}			
}

@-webkit-keyframes pulse {
	0% {
		-webkit-transform: rotate(80deg) scaleX(0.95) translateZ(5px);
	}
	50% {
		-webkit-transform: rotate(80deg) scaleX(1) translateZ(5px);
	}	
	100% {
		-webkit-transform: rotate(80deg) scaleX(0.95) translateZ(5px);
	}			
}

.catbody:after{
  content:'';
  height:10%;
  width:80%;
  display:block;
  position:absolute;
  background:#e6d4c9;
  transform:rotate(75deg);
  -webkit-transform:rotate(75deg);
  -moz-transform:rotate(75deg);
  left:49.5%;
  top:30%;
  border-radius:40%;
  -webkit-border-radius:40%;
  -moz-border-radius:40%;
  }



.paw3{
  left:63%;
  top:46%;
  transform:rotate(20deg)   translateZ(8px);
  -webkit-transform:rotate(20deg)   translateZ(8px);
  -moz-transform:rotate(20deg)   translateZ(8px);
  opacity:1;
  width:50px;
  height:110px;
  z-index:2;
}

#cat:hover .paw3{
  transform:rotate(16deg)   translateZ(8px);
  -webkit-transform:rotate(16deg)   translateZ(8px);
  -moz-transform:rotate(16deg)   translateZ(8px);
}

.paw3:after{
  content:'';
  position:absolute;
  width:60%;
  height:47%;
  top:1px;
  left:-10px;
  background:#b29782;
  z-index:1;
}

.tail{
  display:block;
  position:absolute;
  z-index:-3;
  width:25px;
  border-radius:60% 30% 40% 36%;
  -webkit-border-radius:60% 30% 40% 36%;
  -moz-border-radius:60% 30% 40% 36%;
  height:130px;
  background:#b29782;
  border:10px solid #000;
  top:38%;
  left:67%;
  transform:skewX(25deg) rotateX(29deg) translateZ(-31px);
  -webkit-transform:skewX(25deg) rotateX(29deg) translateZ(-31px);
  -moz-transform:skewX(25deg) rotateX(29deg) translateZ(-31px);
  transition:0.2s ease-in-out;
  -webkit-transition:0.2s ease-in-out;
  -moz-transition:0.2s ease-in-out;
  transition-delay:0.1s;
  -webkit-transition-delay:0.1s;
  -moz-transition-delay:0.1s;
}



#cat:hover .tail{
  transform:skewX(38deg) rotateX(34deg) translateY(-20px) translateX(20px) translateZ(-31px);
  -webkit-transform:skewX(38deg) rotateX(34deg) translateY(-20px) translateX(20px) translateZ(-31px);
  -moz-transform:skewX(38deg) rotateX(34deg) translateY(-20px) translateX(20px) translateZ(-31px);
}


.pillow{
  display:block;
  position:absolute;
  width:420px;
  height:260px;
  background:#c8c988;
  z-index:-6;
  transform:skew(-20deg) rotateX(20deg) translateZ(-51px);
  -webkit-transform:skew(-20deg) rotateX(20deg) translateZ(-51px);
  -moz-transform:skew(-20deg) rotateX(20deg) translateZ(-51px);
  top:28%;
  left:15%;
  border:10px solid #000;
  border-radius:10px;
  -webkit-border-radius:10px;
  -moz-border-radius:10px;
  box-shadow: inset 10px 0px 0px 0px rgba(137,166,111,1), inset 0px 10px 0px 0px rgba(137,166,111,1), inset -10px 0px 0px 0px rgba(137,166,111,1), inset 0px -10px 0px 0px rgba(137,166,111,1);
  -webkit-box-shadow: inset 10px 0px 0px 0px rgba(137,166,111,1), inset 0px 10px 0px 0px rgba(137,166,111,1), inset -10px 0px 0px 0px rgba(137,166,111,1), inset 0px -10px 0px 0px rgba(137,166,111,1);
  -moz-box-shadow: inset 10px 0px 0px 0px rgba(137,166,111,1), inset 0px 10px 0px 0px rgba(137,166,111,1), inset -10px 0px 0px 0px rgba(137,166,111,1), inset 0px -10px 0px 0px rgba(137,166,111,1);
}


.head:after{
  content:'';
  display:block;
  width:48%;
  height:38%;
  position:relative;
  left:29%;
  top:63%;
  background:#e6d4c9;
  z-index:-1;
  border-radius:50%;
  -webkit-border-radius:50%;
  -moz-border-radius:50%;
}


@media (max-width:1000px){
  #cat{
    transform:translateX(-50%) translateY(-50%) scale(0.7);
    -webkit-transform:translateX(-50%) translateY(-50%) scale(0.7);
    -moz-transform:translateX(-50%) translateY(-50%) scale(0.7);
  }
}

@media (max-width:500px){
  #cat{
    transform:translateX(-50%) translateY(-50%) scale(0.6);
    -webkit-transform:translateX(-50%) translateY(-50%) scale(0.6);
    -moz-transform:translateX(-50%) translateY(-50%) scale(0.6);
  }
  .catbody{
    z-index:-5;
  }
  .pillow{
    z-index:-8;
  }
}

body #cat .purr2{
animation-name: purr2ing !important;
	-webkit-animation-name: purr2ing !important;	
	animation-duration: .1s !important;	
	-webkit-animation-duration: .1s;
	animation-iteration-count: infinite;
	-webkit-animation-iteration-count: infinite;
}

@keyframes purr2ing {
	0% {
		transform: translateY(-5px) scaleX(1) translateZ(15px);
	}
	50% {
		transform: translateY(-5px) scaleX(0.99) translateZ(15px);
	}	
	100% {
		transform: translateY(-5px) scaleX(1) translateZ(15px);
	}			
}

@-webkit-keyframes purr2ing {
	0% {
		-webkit-transform: translateY(-5px) scaleY(1) translateZ(15px);
	}
	50% {
		-webkit-transform: translateY(-5px) scaleY(0.997) translateZ(15px);
	}	
	100% {
		-webkit-transform: translateY(-5px) scaleY(1) translateZ(15px);
	}			
}

              
            
!

JS

              
                document.getElementsByTagName("body")[0].style.cursor = "url('https://puu.sh/pD2Ti/1501ac33bd.cur'), auto";



$('#cat').mousedown(function(){
	$('.catbody').addClass('purr');
  $('.head').addClass('purr2');
  $('.eye').addClass('purreye');
  $('.petme').hide();
});

$('#cat').mouseup(function(){
	$('.catbody').removeClass('purr');
  $('.head').removeClass('purr2');
  $('.eye').removeClass('purreye');
});

$('#cat').touchstart(function(){
	$('.catbody').addClass('purr');
  $('.head').addClass('purr2');
  $('.eye').addClass('purreye');
});

$('#cat').touchend(function(){
	$('.catbody').removeClass('purr');
  $('.head').removeClass('purr2');
  $('.eye').removeClass('purreye');
});
                                      

node = document.body;
node.insertAdjacentHTML('afterend', '<p style="position:fixed; right:10px; bottom:80px; font-size:10px; color:#fff; text-transform:uppercase; max-width:100px; text-align:center; letter-spacing:3px;">From your friends at</p><a href="http://bigseadesign.com" style="position:fixed; bottom:0; right:10px; width:100px; height:80px; background-image:url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/383755/bigsealogo_bluegrey.png); background-size:contain; background-repeat:no-repeat;"></a>');
              
            
!
999px

Console