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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div class="counter">0</div>

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 452 369" xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <path id="a" d="M232.35858 53.86336s9.875-27.03125 45.81054-42.6621C314.10467-4.4296 369.80975-5.5585 408.2453 19.7911c38.43554 25.3496 51.83007 88.42186 36.93554 140.7871-14.89453 52.36523-54.27344 106.26562-131.07617 155.60546-76.80273 49.33985-77.27148 52.6621-77.27148 52.6621s-60.4004-24.07225-105.084-52.75975C87.0656 287.3986 6.3742 229.1154.4054 142.5333-5.5633 55.95125 55.95037 14.62118 80.78432 6.00398c24.834-8.61718 82.6836-8.14062 114.7676 11.1133 32.084 19.2539 36.80666 36.74608 36.80666 36.74608zm-.82227 25.89258s-8.0481-27.34375-56.5175-40.5957c-48.4694-13.25196-107.48044.6953-126.0879 76.02343-18.6074 75.32813 46.0684 134.20118 86.1387 161.0664 40.07034 26.86524 96.39065 49.334 96.39065 49.334s68.1074-34.29883 103.31445-65.8125c35.20702-31.51368 71.38476-73.41993 71.0703-133.63868-.31445-60.2188-43.33203-94.0293-101.02148-89.2969-57.68944 4.7324-73.2871 42.9199-73.2871 42.9199z"/>
    <filter id="b" width="102.9%" height="103.5%" x="-1.4%" y="-1.8%" filterUnits="objectBoundingBox">
      <feGaussianBlur stdDeviation="4" in="SourceAlpha" result="shadowBlurInner1"/>
      <feOffset dy="5" in="shadowBlurInner1" result="shadowOffsetInner1"/>
      <feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"/>
      <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.272475091 0" in="shadowInnerInner1"/>
    </filter>
  </defs>
  <g fill="none" fill-rule="evenodd">
    <mask id="c" fill="#fff">
      <use xlink:href="#a"/>
    </mask>
    <g fill="#000">
      <use fill-opacity=".06" xlink:href="#a"/>
      <use filter="url(#b)" xlink:href="#a"/>
    </g>
    <path id="HeartAnimation" stroke="#EC30DD" stroke-width="55" d="M259.75195 80.6621s-3.54193-23.58902 7.35547-31.52538c27.67383-20.1543 52.74748-44.96046 103.0254-21.53835 71.21093 33.17383 74.96613 100.5371 31.53254 179.7129-43.4336 79.17578-155.71224 139.4114-168.32747 139.4114-12.6153 0-124.028-49.48758-175.1296-113.45437C7.1067 169.3015 3.3841 55.14916 90.9153 27.59837c57.9939-18.2538 88.6011-4.97684 113.8952 10.26686 11.31053 6.8164 54.9414 42.79688 54.9414 42.79688z" opacity=".69" style="mix-blend-mode:multiply" mask="url(#c)"/>
  </g>
</svg>

<div id="slider"></div>
              
            
!

CSS

              
                body{
  background:url(https://s-media-cache-ak0.pinimg.com/originals/a1/0a/d1/a10ad15447ce8c13e7c4203b8f01f91d.jpg) center;
  text-align:center;
}
.counter{
  font-family:sans-serif;
  position:absolute;
  width:100%;
  top:155px;
  font-size:111px;
  text-shadow: 
    0px 1px 0 lighten(#EC30DD, 0%),
    // 0px 2px 0 lighten(#EC30DD, 0%),
    0px 2px 4px rgba(black, .55);
  font-weight:bold;
  color:lighten(#EC30DD, 10%);
  -webkit-text-stroke-width: 1px;
   -webkit-text-stroke-color: darken(#EC30DD, 10%);
  opacity:.9;
  
}
svg {
  width: 452px;
  margin-top:55px;
}
#slider {
  width:200px;
  margin:30px auto;
  background-color: rgba(black,0.14);
  box-shadow:inset 0px 2px 4px rgba(black, .27);
  border:none;
  display: block;
}

#slider, #slider a {
  background-image: none;
}
#slider a {
  background-color: #444;
}
.ui-slider-handle{
  border-radius:100%;
  border:1px solid darken(#EC30DD, 10%)!important;
  background: linear-gradient(lighten(#EC30DD, 20%), #EC30DD)!important;
  box-shadow:0px 2px 4px rgba(black, .27);
}
              
            
!

JS

              
                const foo = { bar: 0 };
let currentBar = foo.bar;

const tl = gsap.timeline({onUpdate:updateSlider});

const $slider = $("#slider");

$slider.slider({
  range: false,
  min: 0,
  max: 100,
  step: 0.02,
  value:0,
  slide: function ( event, ui ) {
    tl.progress( ui.value / 100 ).pause();
  }
});


function updateSlider() {
	$slider.slider("value", tl.progress() * 100);
}


tl
  .add('sync')
  .from('#HeartAnimation', 1.2, {drawSVG:"0%", ease:Power0.easeNone}, 'sync')
  .to(foo, 1.16, { bar: 100, roundProps: "bar", onUpdate: function() {
        if(currentBar != this.targets()[0]) {
          $('.counter').text(this.targets()[0].bar + "%");
          currentBar = this.targets()[0].bar
        }
    }, ease:'none'}, 'sync');

              
            
!
999px

Console