cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="wrap">
 <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 360 360" style="enable-background:new 0 0 360 360;" xml:space="preserve">
<style type="text/css">
	.st0{fill:none;stroke:#000000;stroke-miterlimit:10;}
 .st1{fill:transparent;stroke:#e74c3c;stroke-miterlimit:10;}
</style>

<g id="outline">
 <path class="st0 square" d="M144,143.7h71.8v71.8H144V143.7z"/>
 <path class="st0 circle circle-1" d="M179.9,215.8c-20,0-36.2-16.2-36.2-36.2s16.2-36.2,36.2-36.2s36.2,16.2,36.2,36.2S199.9,215.8,179.9,215.8z"
  />
 <path class="st0 circle circle-2" d="M179.9,215.8c-20,0-36.2-16.2-36.2-36.2s16.2-36.2,36.2-36.2s36.2,16.2,36.2,36.2S199.9,215.8,179.9,215.8z"
  />
</g>
<g id="heart">
	<path class="st1" d="M179.9,128.4c-14.1-13.9-36.9-13.9-51,0.2c-14.1,14.1-14.1,37,0,51.2c1,1,2.1,2,3.2,2.9l47.8,47.8l47.8-47.8
		c1.1-0.9,2.2-1.8,3.2-2.9c14.1-14.1,14.1-37,0-51.2C216.8,114.5,194.1,114.5,179.9,128.4z"/>
</g>
</svg>

</div>
            
          
!
            
              body, html {
 height: 100%;
}

.wrap {
 align-items: center;
 display: flex;
 height: 100vh;
}

svg {
 width: 100%;
}

.circle-1,
.circle-2,
#heart path {
 opacity: 0;
}


            
          
!
            
              let svg = document.querySelector('svg');
let square = document.querySelector('.square');
let bothCircles = document.querySelectorAll('.circle');
let circle1 = document.querySelector('.circle-1');
let circle2 = document.querySelector('.circle-2');
let heart = document.querySelector('#heart path');
let tl = new TimelineMax({repeat: -1});

tl
 .fromTo(square, 1, {drawSVG: "0", ease: Expo.easeOut}, {drawSVG: "100%" })
 .fromTo(bothCircles, 1, {drawSVG: "0"}, {drawSVG: "100%", opacity: 1})
 .to(circle1, 1, {y: "-50%" }, 2)
 .to(circle2, 1, {x: "50%" }, 2)
 .to(square, 1, { rotation: '-45deg', transformOrigin: "center", opacity: .15}, 3)
 .to(circle1, 1, {x: '-35%', y: "-35%", opacity: .15 }, 3)
 .to(circle2, 1, {x: '35%', y: "-35%", opacity: .15 }, 3)
 .fromTo(heart, 1, {drawSVG: "0"}, {drawSVG: "100%", opacity: 1})
 .to(heart, .75, {fill: "#e74c3c"})
 .to(svg, 1, {opacity: 0})

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console