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

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.

            
              <p>Hover over the text or the pie wedge</p>
<div class="chart">
  <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="-150px" y="150px"
	 viewBox="0 0 300 300" enable-background="new 0 0 300 300" xml:space="preserve">
	
	<path class="wedge piece a11y" rel="a11y" fill="#00FFFF" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" d="M150,222.9
		c-40.1,0-72.6-32.5-72.6-72.6c0-3.4,0.3-6.8,0.7-10.1l-75-10.5c-3.1,22.1-1.5,42.7,5,64c24,78.4,106.9,122.5,185.3,98.5l-22.1-72.4
		C164.6,221.7,157.4,222.9,150,222.9z"/>
	
	<path class="wedge piece html" rel="html" fill="#0071BC" stroke="#FFFFFF" stroke-miterlimit="10" d="M221.9,138.9l74.8-11.9c0,0,0,0,0,0l0.3,0
		C285.3,53.4,223.5,1.8,149.5,1.8l1,75.8C186.5,77.7,216.4,104.2,221.9,138.9z"/>
    <path rel="design" class="wedge piece design" fill="#FF0000" stroke="#FFFFFF" stroke-miterlimit="10" d="M150.5,77.6l-1-75.8c-30,0-55,7.7-79.9,23.9
		l41.1,63.5c11.3-7.3,25-11.6,39.5-11.6C150.3,77.6,150.5,77.6,150.5,77.6z"/>
	<path class="wedge piece sass" rel="sass" fill="#FFFF00" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" d="M110.5,89.3L69.2,25.8
		C31.8,50.1,9.3,85.3,3.1,129.6l75,10.5C81.1,118.8,93.3,100.5,110.5,89.3z"/>
    <path rel="css" class="wedge piece css" fill="#39B54A" stroke="#FFFFFF" stroke-width="0.5" stroke-miterlimit="10" d="M296.6,127l-74.8,11.9
		c0.6,3.7,0.9,7.5,0.9,11.3c0,32.7-21.6,60.4-51.4,69.5l22.1,72.4C264.7,270.3,308.2,200.6,296.6,127z"/>
</svg>
</div>
<ul>
  <li class="wedge label html" rel="html">HTML</li>
  <li class="wedge label css" rel="css">CSS</li>
  <li class="wedge label a11y" rel="a11y">Accessibility</li>
  <li class="wedge label sass" rel="sass">Sass</li>
  <li class="wedge label design" rel="design">Design</li>
</ul>


            
          
!
            
              *
  box-sizing: border-box
.chart
  width: 300px
  float: left
  margin: 10px
svg
  overflow: visible
  width: 100%
  transition: all 500ms ease
  path
    transform-origin: center center
    &:hover
      -webkit-filter: drop-shadow( 15px 15px 5px rgba(0,0,0,.7) )
      -moz-filter: drop-shadow( 15px 15px 5px rgba(0,0,0,.7) )
      filter: drop-shadow( 15px 15px 5px rgba(0,0,0,.7) )
ul
  list-style-type: none
  padding: 0
  width: 300px
  float: left
  margin: 
    top: 10px
    left: 20px
  font:
    size: 2rem
.wedge
  &.label
    margin: .5rem 0
    padding: .5rem
    border-bottom: 1px solid #343434
    width: 250px
    transition: all 500ms ease-In-Out
    position: relative
    &:after
      content: " "
      width: 100%
      height: 0
      display: block
      position: absolute
      left: 0
      bottom: 0
      z-index: -1
      background: transparent
      transition: all 500ms ease-In-Out
  &.piece
    transform: scale(1)
    transition: all 750ms ease-In-Out
    stroke-width: 2px
  
    
  &:hover, &:focus
    cursor: pointer
    
      
  &.css
    &:hover, &:focus, &.hover
      &.label
        &:after
          height: 100%
          background: #39B54A
      &.piece
        transform: perspective(600px)
        stroke: #333
        
        
  &.html
    &:hover, &:focus, &.hover
      &.label
        &:after
          height: 100%
          background: #0071BC
      &.piece
        transform: perspective(600px)
        stroke: #333
        
  &.a11y
    &:hover, &:focus, &.hover
      &.label
        &:after
          height: 100%
          background: #00FFFF
      &.piece
        transform: perspective(600px) 
        stroke: #333
        
  &.design
    &:hover, &:focus, &.hover
      &.label
        &:after
          height: 100%
          background: #FF0000
      &.piece
        transform: perspective(600px)
        stroke: #333
        
  &.sass
    &:hover, &:focus, &.hover
      &.label
        &:after
          height: 100%
          background: #FFFF00
      &.piece
        transform: perspective(600px)
        stroke: #333
        
 
            
          
!
            
              (function($,win,doc){
  'use strict';
  var id,
   translate= {
   'css': '(30px, 30px)',
   'html': '(30px, -30px)',
   'a11y': '(-30px, 30px)',
   'design': '(-10px, -40px)',
   'sass': '(-30px, -30px)'
   };
  function init(){
    $('.wedge').hover(function(){
       id = $(this).attr('rel');
      //$('#output').html(id);
      $('.wedge.'+id).addClass('hover');
      $('.wedge.piece.'+id).css({
        'stroke':'#333'
        ,'transform': 'translate'+translate[id]
      });
     }, function(){
      id = $(this).attr('rel');
      $('.wedge.'+id).removeClass('hover');
      $('.wedge.piece.'+id).css({
        'stroke':'#fff'
        ,'transform':'translate(0px, 0px)'
      });
     }
  );
  }
  init();
})(jQuery, window, document);
            
          
!
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