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

              
                

<div class="wrapRight">
  <p class="color green">I´m the GREEN</p>
  <p class="color black">I´m the BLACK</p>
  <p class="color real">I´m the REAL</p>
  <p class="color blue">I´m the BLUE</p>
  <p class="joe">JO</p>
</div>



<svg xmlns="http://www.w3.org/2000/svg" id="svg" viewbox="0 0 476 480">
  
  <text class="lines" x="300" y="35">The GREEN Jo.</text>
  <text class="lines" x="300" y="35">The BLACK Jo.</text>
  <text class="lines" x="300" y="35">The REAL Jo.</text>
  <text class="lines" x="300" y="35">The BLUE Jo.</text>
  

  
  <g id="circle">
    <path id="path2985" fill="none" stroke="#000" stroke-width="2.39" stroke-miterlimit="3.1" d="M437.88 239.9c0 109.8-89 198.8-198.8 198.8-109.8 0-198.8-89-198.8-198.8 0-109.8 89-198.82 198.8-198.82 109.8 0 198.8 89 198.8 198.8z" stroke-dasharray="4.77 4.77"/>
    <path id="rect3757-7" fill="grey" d="M439.07 179.9v120h-400v-120z"/>
    <path id="rect3757-7-3" fill="grey" d="M179.07 39.9h120v400h-120z"/>
</g>
  <g id="allJoes">
    
    <g id=".blue" class="jo">
     
      <path id="path3858" fill="#0979d0" d="M279.57 50c0 27.6-18.02 50-40.23 50-22.22 0-40.24-22.4-40.24-50s18.02-50 40.24-50c22.2 0 40.23 22.4 40.23 50z"/>
      <path id="path3860" d="M258.34 59.88c-21.62-15.9-22.36 16.03-8.03 19.52 43.8 9.68 48.9-44.6 24.7-30.92 17.4 1.25 6.9 27.78-16.6 11.4z"/>
      <path id="path3860-9" d="M220.35 59.88c21.62-15.9 22.36 16.03 8.03 19.52-43.8 9.68-48.82-44.6-24.6-30.92-17.4 1.25-6.84 27.78 16.57 11.4z"/>
      <path id="path3882" fill="#f1f2f3" d="M233.6 29.85c0 5.83-4.64 10.56-10.36 10.56-5.7 0-10.35-4.7-10.35-10.5s4.6-10.5 10.3-10.5c5.7 0 10.3 4.8 10.3 10.6z"/>
      <path id="path3884" fill="none" stroke="#000" stroke-width="2.22" d="M339.75 303.56c3.7 1 7.4 1.17 11.1 0 4.02.94 8.26 1.23 13 0" transform="matrix(.93136 0 0 1.3236 -87.347 -317.107)"/>
      <path id="path3886" fill="#2c2d2d" d="M226.47 32.25c0 2.5-1.74 4.55-3.88 4.55-2.2 0-3.9-2.04-3.9-4.55 0-2.52 1.7-4.55 3.8-4.55s3.8 2.03 3.8 4.55z"/>
      <path id="path3882-4" fill="#f1f2f3" d="M266.12 29.85c0 5.83-4.64 10.56-10.36 10.56-5.7 0-10.35-4.7-10.35-10.5s4.7-10.5 10.4-10.5 10.4 4.8 10.4 10.6z"/>
      <path id="path3886-8" fill="#2c2d2d" d="M259 32.25c0 2.5-1.75 4.55-3.9 4.55-2.13 0-3.86-2.04-3.86-4.55 0-2.52 1.73-4.55 3.87-4.55 2.2 0 3.9 2.03 3.9 4.55z"/>
<ellipse class="mouth" cx="241" cy="85" rx="22" ry="5" style="fill:black;stroke:none;"></ellipse>
        
    </g>
    <g id=".black" class="jo">
      <path id="path3858-2" fill="#525252" d="M280.66 429.3c0 27.62-18 50-40.23 50-22.22 0-40.23-22.38-40.23-50 0-27.6 18-50 40.23-50 22.22 0 40.23 22.4 40.23 50z"/>
      <path id="path3860-3" d="M259.43 439.2c-21.6-15.92-22.35 16.02-8.02 19.5 43.8 9.7 48.9-44.6 24.7-30.9 17.4 1.24 6.9 27.77-16.6 11.4z"/>
      <path id="path3860-9-3" d="M221.45 439.2c21.62-15.92 22.35 16.02 8.03 19.5-43.8 9.7-48.83-44.6-24.6-30.9-17.4 1.24-6.85 27.77 16.57 11.4z"/>
      <path id="path3882-41" fill="#f1f2f3" d="M234.7 409.16c0 5.83-4.64 10.56-10.36 10.56S214 415 214 409.16s4.62-10.55 10.34-10.55 10.35 4.8 10.35 10.6z"/>
      <path id="path3884-1" fill="none" stroke="#000" stroke-width="2.22" d="M339.75 303.56c3.7 1 7.4 1.17 11.1 0 4.02.94 8.26 1.23 13 0" transform="matrix(.93136 0 0 1.3236 -86.248 62.202)"/>
      <path id="path3886-3" fill="#2c2d2d" d="M227.56 411.56c0 2.5-1.73 4.55-3.87 4.55-2.2 0-3.9-2-3.9-4.5s1.7-4.5 3.9-4.5c2.1 0 3.8 2.1 3.8 4.6z"/>
      <path id="path3882-4-8" fill="#f1f2f3" d="M267.22 409.16c0 5.83-4.64 10.56-10.36 10.56-5.7 0-10.35-4.73-10.35-10.56s4.7-10.55 10.4-10.55 10.4 4.8 10.4 10.6z"/>
      <path id="path3886-8-7" fill="#2c2d2d" d="M260.1 411.56c0 2.5-1.75 4.55-3.9 4.55-2.13 0-3.86-2-3.86-4.5s1.73-4.5 3.87-4.5c2.2 0 3.9 2.1 3.9 4.6z"/>
<ellipse class="mouth" cx="240" cy="465" rx="22" ry="5" style="fill:black;stroke:none;"></ellipse>
    </g>
    <g id=".real" class="jo">
      <path id="path3858-27" fill="#ffc67f" d="M90.22 239.9c0 27.63-18 50-40.23 50-22.3 0-40.3-22.37-40.3-50 0-27.6 18-50 40.2-50 22.2 0 40.2 22.4 40.2 50z"/>
      <path id="path3860-7" d="M69 249.8c-21.62-15.92-22.36 16.02-8.03 19.5 43.8 9.7 48.82-44.6 24.6-30.9 17.4 1.25 6.84 27.77-16.58 11.4z"/>
      <path id="path3860-9-9" d="M31 249.8c21.62-15.92 22.36 16.02 8.03 19.5-43.8 9.7-48.82-44.6-24.6-30.9-17.4 1.25-6.84 27.77 16.58 11.4z"/>
      <path id="path3882-3" fill="#f1f2f3" d="M44.25 219.77c0 5.82-4.64 10.55-10.35 10.55-5.72 0-10.35-4.73-10.35-10.55 0-5.83 4.63-10.56 10.35-10.56 5.7 0 10.35 4.8 10.35 10.6z"/>
      <path id="path3884-19" fill="none" stroke="#000" stroke-width="2.22" d="M339.75 303.56c3.7 1 7.4 1.17 11.1 0 4.02.94 8.26 1.23 13 0" transform="matrix(.93136 0 0 1.3236 -276.692 -127.195)"/>
      <path id="path3886-86" fill="#2c2d2d" d="M37.12 222.16c0 2.52-1.73 4.55-3.87 4.55s-3.88-2-3.88-4.5 1.74-4.5 3.88-4.5c2.14 0 3.87 2.1 3.87 4.6z"/>
      <path id="path3882-4-5" fill="#f1f2f3" d="M76.77 219.77c0 5.82-4.63 10.55-10.35 10.55s-10.35-4.73-10.35-10.55c0-5.83 4.63-10.56 10.35-10.56s10.35 4.8 10.35 10.6z"/>
      <path id="path3886-8-0" fill="#2c2d2d" d="M69.64 222.16c0 2.52-1.73 4.55-3.87 4.55s-3.88-2-3.88-4.5 1.7-4.5 3.8-4.5 3.8 2.1 3.8 4.6z"/>
<ellipse class="mouth" cx="50" cy="275" rx="22" ry="5" style="fill:black;stroke:none;"></ellipse>
    </g>
    <g id=".green" class="jo">
      <path id="path3858-8" fill="green" d="M465.88 240.96c0 27.6-18.02 50-40.23 50-22.22 0-40.24-22.4-40.24-50 0-27.62 18.1-50 40.3-50 22.2 0 40.3 22.38 40.3 50z"/>
      <path id="path3860-6" d="M444.65 250.84c-21.62-15.9-22.36 16.03-8.03 19.52 43.8 9.68 48.82-44.6 24.6-30.92 17.4 1.25 6.84 27.77-16.57 11.4z"/>
      <path id="path3860-9-0" d="M406.66 250.84c21.62-15.9 22.36 16.03 8.03 19.52-43.8 9.68-48.9-44.6-24.7-30.92-17.4 1.25-6.9 27.77 16.6 11.4z"/>
      <path id="auge" fill="#f1f2f3" d="M419.9 220.8c0 5.84-4.63 10.57-10.35 10.57-5.7 0-10.35-4.73-10.35-10.56 0-5.8 4.64-10.5 10.35-10.5 5.72 0 10.35 4.7 10.35 10.6z"/>
      <path id="xxx" fill="none" stroke="#000" stroke-width="2.22" d="M339.75 303.56c3.7 1 7.4 1.17 11.1 0 4.02.94 8.26 1.23 13 0" transform="matrix(.93136 0 0 1.3236 98.963 -126.148)"/>
      <path id="pupille" fill="#2c2d2d" d="M412.78 223.2c0 2.52-1.74 4.56-3.88 4.56-2.14 0-3.87-2.04-3.87-4.55 0-2.5 1.73-4.5 3.87-4.5s3.88 2.1 3.88 4.6z"/>
      <path id="xxxcc" fill="#f1f2f3" d="M452.43 220.8c0 5.84-4.64 10.57-10.35 10.57-5.72 0-10.36-4.73-10.36-10.56 0-5.8 4.64-10.5 10.36-10.5 5.7 0 10.35 4.7 10.35 10.6z"/>
      <path id="path3886-8-9" fill="#2c2d2d" d="M445.3 223.2c0 2.52-1.74 4.56-3.88 4.56-2.14 0-3.87-2.04-3.87-4.55 0-2.5 1.73-4.5 3.87-4.5s3.88 2.1 3.88 4.6z"/>
<ellipse class="mouth" cx="425" cy="276" rx="22" ry="5" style="fill:black;stroke:none;"></ellipse>
    </g>

  </g>
</svg>


              
            
!

CSS

              
                body{
  width:100%;
  background-color:grey;
}

#svg{
  position:absolute;
  top:5vh;
  height:90vh;
  overflow:visible;
}
.lines, .sub{
  fill:black;
  font-family:sans-serif;
  font-size:24px;
  font-weight:600;
  visibility:hidden;
}
.sub{
  font-size:16px;
}
.jo{
  cursor:pointer;
}

.wrapRight{
  position: absolute;
  height: 50px;
  width: 250px;
  background-color: #696767;
  top: 50%;
  font-family: sans-serif;
  font-weight: 800;
  visibility:hidden;
}
.color{
  position:absolute;
  margin:5px;
  font-size: 28px;
  line-height: 0.8;
  visibility:hidden;
}
.joe{
  position:absolute;
  top:30px;
  margin: 0;
  font-size: 59px;
  line-height: 0.9;
}
              
            
!

JS

              
                // These events and people are fictional and any resemblance to person living or dead is purely coincidental.

console.clear();

var $circle = $('#circle');
var $allJoes = $('#allJoes');
var $oneJo = $('.jo');
var $eye = $('#auge');
var $red = $('#pupille');


gsap.set('.mouth',{scale:0, transformOrigin:'center'});

var rotation = gsap.timeline({repeat:-1, repeatDelay:0}) 
.addLabel("greenJo")
.to([$circle, $allJoes],{rotation:-90,transformOrigin:"center center", duration:1},0)
.to($oneJo,{rotation:+90,transformOrigin:"center center", duration:1},0)

.addLabel("yellowJo")
.to([$circle, $allJoes],{rotation:-180,transformOrigin:"center center", duration:1},2)
.to($oneJo,{rotation:+180,transformOrigin:"center center", duration:1},2)
.addLabel("blackJo")
.to([$circle, $allJoes],{rotation:-270,transformOrigin:"center center", duration:1},4)
.to($oneJo,{rotation:+270,transformOrigin:"center center", duration:1},4)
.addLabel("whiteJo")
.to([$circle, $allJoes],{rotation:-360,transformOrigin:"center center", duration:1},6)
.to($oneJo,{rotation:+360,transformOrigin:"center center", duration:1},6)

.to('.lines',{autoAlpha:1, stagger: 2},1)
.to('.lines',{autoAlpha:0, stagger: 2},1.5)


//.to([$eye, $red], {scaleY:0.05, transformOrigin:"center 60%", duration:0.3, repeat:1, yoyo:true},1)


var master = gsap.timeline()
//.add(rotation)

$oneJo.mouseenter(function(){
  var thisMouth = $(this).find(".mouth");
  gsap.to(thisMouth, {scale:1, transformOrigin:'center', duration:0.2})
  var thisJo = $(this).attr('id');
  gsap.to(thisJo, {autoAlpha:1})
  gsap.to('.wrapRight', {autoAlpha:1})
  gsap.to(this,.5,{scale:1.5, transformOrigin:'center', duration:0.5})

  rotation.pause();
});
$oneJo.mouseleave(function(){
  var thisMouth = $(this).find(".mouth");
  gsap.to(thisMouth, {scale:0, transformOrigin:'center', duration:0.2})
  gsap.to('.color', {autoAlpha:0})
  gsap.to('.wrapRight', {autoAlpha:0})
  gsap.to(this, {scale:1, transformOrigin:'center', duration:0.5})
  rotation.resume();
});


window.addEventListener("resize", resize);

function resize(){
  var $svgWidth = $('svg').width();
  gsap.set('.wrapRight',{x:$svgWidth + 50 ,yPercent:-50});
}
resize();
              
            
!
999px

Console