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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <div class="wrap">
  <div class="holder">
<p class="text">
<span id="count">0</span>of <span id="max"></span> items</p>

<div class="cover"></div>
<div class="circle right"></div>
<div class="circle bottom"></div>
<div class="circle left"></div>
<div class="circle full"></div>
</div>

<div class="plus">Plus</div>
<div class="minus disabled">Minus</div>

</div>




<!-- Fix Dial
Key frames
-->


              
            
!

CSS

              
                /* COLOR VARIABLES
============================================= */
$orange: #ffa600;
$grey: #e3e3e3;
$white: #fff;

/* MIXIN'S
============================================= */

@mixin fade {
	-moz-transition: all 1s ease-in;
	-moz-transition: all 0.3s ease-in-out;
	-webkit-transition: all 0.3s ease-in-out;
}

@mixin radius ($arc1, $arc2, $arc3, $arc4){ 
  border-radius: $arc1 $arc2 $arc3 $arc4;
  -webkit-border-radius: $arc1 $arc2 $arc3 $arc4;
  -moz-border-radius:$arc1 $arc2 $arc3 $arc4;
  -ms-border-radius: $arc1 $arc2 $arc3 $arc4;
  -o-border-radius: $arc1 $arc2 $arc3 $arc4;
}

@mixin origin ($origin1, $origin2) {
  transform-origin: $origin1 $origin2;
  -ms-transform-origin: $origin1 $origin2;
  -webkit-transform-origin: $origin1 $origin2;
  -moz-transform-origin: $origin1 $origin2;
  -o-transform-origin: $origin1 $origin2;
}

@mixin rotate ($rotate) {
  transform:rotate($rotate);
  -ms-transform: rotate($rotate);
  -webkit-transform: rotate($rotate);
  -moz-transform: rotate($rotate);
  -o-transform: rotate($rotate);
}

/* LAYOUT
============================================= */

.wrap {
  width: 300px;
  margin: 65px auto;
  position:relative;
}

.holder {
  height: 220px;
}

/* CIRCLES
============================================= */

.circle {
   @include origin (left, center);
	position:absolute;
	width:100px;
	height:200px;
	overflow:hidden;
	left:150px;
   top:10px;
}

.circle:before {
  @include origin (right, center);
  @include radius (100px, 0, 0, 100px);
	content:"";
	position:absolute;
	width:100px;
	height:200px;
	left:-100px;
}

.cover {
    @include radius (50%, 50%, 50%, 50%);
    position: absolute;
    top: 40px;
    left: 80px;
    width: 140px;
    height: 140px;
    background-color: #fff;
    z-index: 999;
}

.full {
  @include radius (50%, 50%, 50%, 50%);
  position: absolute;
  top: 9px;
  left: 50px;
  width: 199px;
  height: 200px;
  background: #e3e3e3;
}
	
.right {
	@include rotate (0deg);
   z-index: 99;
} 

.bottom {
  @include rotate (120deg);
  z-index: 99;
}

.left {
  @include rotate (240deg);
  z-index: 99;
}


.right:before {
  @include rotate (0deg);
  background: orange;
}

.bottom:before {
	@include rotate (120deg);
   background: white;
}

.left:before {
   @include rotate (0deg);
   background: orange;
}

.full:before {
	@include rotate (260deg);
   background: #e3e3e3;
}

/* TEXT
============================================= */

.text {
  position:absolute;
  top:49px;
  left:110px;
  z-index: 9999;
  color: orange;
  font-size: 18px;
  font-weight: bold;
  display: block;
  text-align: center;
}

#count {
   font-size: 38px;
 	display: block;
}

/* BUTTONS 
============================================= */

%btn {
	@include fade;
	padding: 15px 10px;
	color: $white;
	cursor: pointer;
	font-size: 24px;
	width: 111px;
	margin: 5px;
	text-align: center;
	display: inline-block;
}

  @mixin  btn-background($btn-background) {
	  @extend %btn;
	  background-color: $btn-background;
	
	&:hover {
	  background-color: lighten($btn-background,20% );
	  color:$grey;
	}
}

.plus,
.minus {
	@include btn-background($orange);
}

.plus.disabled, 
.minus.disabled {
	@include btn-background($grey);
}

/* ANIMATION
============================================= */

@for $i from 1 through 120 {
  
  [data-left="#{$i}"]:before {
    @include fade;
    @include rotate (#{$i}deg);
  }
  [data-right="#{$i}"]:before {
    @include fade;
    @include rotate (#{$i}deg);
  }

}




              
            
!

JS

              
                
$(document).ready(function () {
  
  var counter = document.getElementById('count');
  var max = document.getElementById('max');
  
  var count = 0;
  var maxCount = 60;
  var maxArc = 240;
  var halfArc = maxArc / 2;

  max.innerHTML = maxCount;

  // Circle function
  var circle =  function () {
  var arc = (maxArc / maxCount ) * count;
  var arc2 = ((maxArc / maxCount ) * count) - halfArc;
    
  arc = Math.floor(arc);
  arc2 = Math.floor(arc2);
    
   if (arc < halfArc) {    
      $(".left").attr('data-left', arc);
   } else if (arc == halfArc) {  
      $(".left").attr('data-left', arc);
      $(".right").attr('data-right', arc2);
   }
    else if (arc > halfArc) {  
      $(".right").attr('data-right', arc2);
   }   
}

  // Active Buttons functions
  var minus = function () {
    if ( count <= 0) {
    $(".minus").addClass( "disabled" );
 
     } else {
    $(".minus").removeClass( "disabled" );
   }
  }

  var plus = function () {
    if ( count >= maxCount) {
    $(".plus").addClass( "disabled" );

    } else {
    $(".plus").removeClass( "disabled" );
  }

 }

  $(".plus").click(function () { 
    if (count < maxCount) {
      count ++;
      counter.innerHTML = count;
      plus ();
      minus ();
      circle();
    }    
  })
  
  $(".minus").click(function () {
    if ( count > 0) {
      count --;
      counter.innerHTML = count;  
      minus ();
      plus ();
      circle();
    } 
  });  
});
 


              
            
!
999px

Console