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>
<a href="#"><i class="social-btn facebook paper-fold fa fa-facebook"></i></a>
<a href="#"><i class="social-btn square twitter fa fa-twitter"></i></a>
<a href="#"><i class="social-btn rounded paper-fold long-shadow rss fa fa-rss"></i></a>
<a href="#">
  <span class="social-btn rounded flickr textToHalfStyle" data-halfstyle="hs-horizontal">fa fa-flickr</span>
</a>
<a href="#">
  <span class="social-btn circle paper-fold youtube textToHalfStyle" data-halfstyle="hs-vertical">fa fa-youtube</span>
</a>
  <a href="#"><i class="social-btn circle"></i></a>
</div>
              
            
!

CSS

              
                body {
  padding: 30px;
  text-align: center;
}
$size: 120px;
$fade: 0.05s ease;

$color-primary: #e74c3c;
$color-secondary: #fff;
$color-navy:#2980b9;
$color-blue:#c5eff7;
$color-orange:#e67e22;
$color-white:#f9fafe;
$color-pink: #ffb0f2;
$color-grey: #7f8c8d;

@function strip-units($number) { 
	@return $number / ($number * 0 + 1); 
}

/*@include btn-shadow(color, side ('top'/'bottom'/'topleft'/'topright'/'bottomleft'/'bottomright'/'left'/'right'), percent (%), highlight ('full'/'shadow'/'highlight'/'none'), height);*/

@mixin btn-shadow($color: $color-primary, $side: "bottomright", $highlight: "full", $percent:15%, $height: ($size/10)) {
	$shadow: null;
	$dark: call(darken, $color, unquote($percent));
	$light: call(lighten, $color, unquote($percent));
   @if $side == "none"{
     $shadow: none;
   }
	@elseif $side == "top"{
        // @if $highlight == "full"{
        //     $shadow: inset #{0} $height $dark, 
        //     inset ($height/2) (-$height/2) $light;
        //     } @else {
        	$shadow: inset #{0} $height $dark;
            // }   
        } 
        @elseif $side == "left"{
        	$shadow: inset $height #{0} $dark;
        }
        @elseif $side == "right"{
        	$shadow: inset (-$height/2) #{0} $dark;
        }
        @elseif $side == "topright"{
        	$shadow: inset (-$height/2) $height $dark;
        }
        @elseif $side == "topleft"{
        	@if $highlight == "full"{
        		$shadow: inset ($height/2) $height $dark,
        		inset (-$height/4) ($height/4) $light;
        		} @else{
        			$shadow: inset ($height/2) $height $dark;
        		}
        	}
        	@elseif $side == "bottomright"{
        		@if $highlight == "full"{
        			$shadow: inset (-$height/4) #{-$height} $dark, 
        			inset ($height/2) ($height/4) $light;
        		} 
        		@elseif $highlight == "shadow" {
        			$shadow: inset (-$height/2) #{-$height} $dark;
        		}
        	}
        	@elseif $side == "bottomleft"{
        		$shadow: inset ($height/2) #{-$height} $dark;
        	}
        	@else {
        		@if $highlight == "full"{
        			$shadow: inset #{0} -$height $dark, 
        			inset ($height/2) ($height/2) $light;;
        		}
        		@else {
        			$shadow: inset #{0} -$height $dark;
        		}
        	}
        	-webkit-box-shadow: $shadow;
        	-moz-box-shadow: $shadow;
        	box-shadow: $shadow;
        	-o-transition: #{$fade};
        	-moz-transition: #{$fade};
        	-webkit-transition: #{$fade};
        	transition:$fade;
        }
        @mixin long-shadow($color: $color-primary, $percent: 15%, $direction: 'right') { 
        	$all: (); 
        	@for $i from 1 through strip-units($size) { 
        		$all: append($all, if($direction == 'left', $i * -.5px, $i * .5px) $i * .5px darken($color, $percent), comma); 
        	} 
        	text-shadow: $all; 
        } 
        @mixin paper-fold($side: 'right', $percent: 15%) { 
        	&::after {
        		content: '';
        		position: absolute;
        		width: $size/2;
        		height: $size;
        		background-color: rgba(0,0,0,$percent/100%);
        		@if $side == "left"{
        			left: #{0};
        			} @else {
        				right:#{0};
        			}
        		}
        	}  
        	// @mixin hex ($color: $color-primary, $direction: vertical) {
        	// 	$height: 0;
        	// 	$width: 0;

        	// 	@if $direction == vertical {
        	// 		$width: $size;
        	// 		$height: round($size * (30 / 52));
        	// 	}

        	// 	@else {
        	// 		$height: $size;
        	// 		$width: round($size * (30 / 52));
        	// 	}

        	// 	$half-width: round($width / 2);
        	// 	$half-height: round($height / 2);

        	// 	width: $width;
        	// 	height: $height;
        	// 	position: relative;
        	// 	background-color: $color;


        	// 	&:before,
        	// 	&:after {
        	// 		content: "";
        	// 		width: 0;
        	// 		height: 0;
        	// 		position: absolute;

        	// 		@if $direction == vertical {
        	// 			left: 0;

        	// 			border-left: $half-width solid transparent;
        	// 			border-right: $half-width solid transparent;
        	// 		}

        	// 		@else {
        	// 			top: 0;

        	// 			border-top: $half-height solid transparent;
        	// 			border-bottom: $half-height solid transparent;
        	// 		}
        	// 	}

        	// 	@if $direction == vertical {
        	// 		&:before {
        	// 			border-bottom: $half-height solid $color;
        	// 			top: -$half-height;
        	// 		}

        	// 		&:after {
        	// 			bottom: -$half-height;
        	// 			border-top: $half-height solid $color;
        	// 		}
        	// 	}

        	// 	@else {
        	// 		&:before {
        	// 			border-right: $half-width solid $color;
        	// 			left: -$half-width;
        	// 		}

        	// 		&:after {
        	// 			right: -$half-width;
        	// 			border-left: $half-width solid $color;
        	// 		}
        	// 	}
        	// }
        	// .hexagon {
        	// 	@include hex();
        	// }
        	/*Combine Mixins*/
        	@mixin mixins($color: $color-primary, $side: 'bottomright', $long-shadow: true, $button-shadow: true, $paper-fold: true, $direction: 'right', $highlight: 'full', $percent: 15%, $height: ($size/10)) {
        		background-color: $color;
        		@if $long-shadow != false{
        			@include long-shadow($color, $percent, $direction);
        		}
        		@if $button-shadow != false{
        			@include btn-shadow($color, $side, $highlight, $percent, $height);
        		}
            // @if $paper-fold != false{
            //     @include paper-fold($direction, $percent*.66);
            // }
        }


        .circle {
        	border-radius: 50%;
        }
        .rounded {
        	border-radius: 25%;
        }
        .square {
        	border-radius: 2%;
        }
        /* .hexagon {
        	clip-path: url('data:image/svg+xml; base64, PHN2ZyBmaWxsLW9wYWNpdHk9IjEiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb2xvci1yZW5kZXJpbmc9ImF1dG8iIGNvbG9yLWludGVycG9sYXRpb249ImF1dG8iIHN0cm9rZT0iYmxhY2siIHRleHQtcmVuZGVyaW5nPSJhdXRvIiBzdHJva2UtbGluZWNhcD0ic3F1YXJlIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1vcGFjaXR5PSIxIiBzaGFwZS1yZW5kZXJpbmc9ImF1dG8iIGZpbGw9ImJsYWNrIiBzdHJva2UtZGFzaGFycmF5PSJub25lIiBmb250LXdlaWdodD0ibm9ybWFsIiBzdHJva2Utd2lkdGg9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZm9udC1mYW1pbHk9IiZhcG9zO0RpYWxvZyZhcG9zOyIgZm9udC1zdHlsZT0ibm9ybWFsIiBzdHJva2UtbGluZWpvaW49Im1pdGVyIiBmb250LXNpemU9IjEyIiBzdHJva2UtZGFzaG9mZnNldD0iMCIgaW1hZ2UtcmVuZGVyaW5nPSJhdXRvIj4NCiAgPCEtLVVuaWNvZGUgQ2hhcmFjdGVyICdCTEFDSyBIRVhBR09OJyAoVSsyQjIyKS0tPg0KICA8ZGVmcyBpZD0iZ2VuZXJpY0RlZnMiIC8+DQogIDxnPg0KICAgIDxnPg0KICAgICAgPHBhdGggZD0iTTEyNi41NjI1IDM4MC44MTI1IEwyOC4xMjUgMzI0IEwyOC4xMjUgMjEwLjM3NSBMMTI2LjU2MjUgMTUzLjU2MjUgTDIyNSAyMTAuMzc1IEwyMjUgMzI0IEwxMjYuNTYyNSAzODAuODEyNSBaIiBzdHJva2U9Im5vbmUiIC8+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4=');
        } */
        .paper-fold{
        	@include paper-fold();
        }

        /*Default Button Behavior*/
        .social-btn {
        	position: relative;
        	opacity: .75;
        	text-align: center;
        	text-decoration: none;
        	color: $color-secondary;
        	display: inline-block;
        	font-size: ($size/1.5);
        	vertical-align:middle;
        	width: $size;
        	height: $size;
        	line-height: ($size + $size/10) !important;
        	overflow: hidden;
        	margin: 0 3px;
        	@include mixins();
        	&:hover{
        		opacity: 1;
        	}
        	&:active{
        		@include mixins($color-primary, topleft);
        	}
        }

        /*Specific button style*/   
        
        .facebook{   
        	$color: $color-navy;
          @include mixins($color);
        	&:hover{
        		@include mixins($color);
        	}
        	&:active {
        		@include mixins($color, topleft);
        	}
        }
        .twitter{
          $color: $color-blue;
          @include mixins($color, none);
        	&:hover {
        		@include mixins($color, none);
        	}
        	&:active{
        		@include mixins($color, topleft);
        	}
        }    
        .rss{
          $color: $color-orange;
          @include mixins($color);
        	&:hover {
        		@include mixins($color);
        	}
        	&:active{
        		@include mixins($color, topleft);
        	}
        }
        .flickr{
          $color: $color-white;
          @include mixins($color);
          .hs-horizontal {
        			color: $color-pink;
        			&:before {
        				color: $color-navy;
        			}
          }
        	&:hover {
        		@include mixins($color);
        		.hs-horizontal {
        			color: $color-pink;
        			&:before {
        				color: $color-navy;
        			}
        		}
        		&:active{
        			@include mixins($color, topleft);
        		}
        	}
        }
        .youtube{
          $color: $color-grey;
          @include mixins($color);
        	&:hover {
        		@include mixins($color);
        		.hs-vertical {
        			color: $color-primary;
        			&:before {
        				color: $color-secondary;
        			}
        		}
        		&:active{
        			@include mixins($color, topleft);
        		}
        	}
        }


/*override*/
        .fa-flickr:before{
        	content:"●●" !important;
        }
        /* start half-icon-style */
        /* start half-icon-style */
        .halfStyle{
        	position:relative;
        	display:inline-block;
        	white-space: pre; 
        	&.hs-horizontal {
        		&:before {
        			display:block;
        			z-index:1;
        			position:absolute;
        			top:0;
        			width: 50%;
    //content: attr(data-content); /* dynamic content for the pseudo element */
    pointer-events: none; /* so the base char is selectable by mouse */
    overflow:hidden;
}
}
&.hs-vertical {
	height: 55%;
	&:before {
		display:block;
		z-index:1;
		position:absolute;
		top:0;
		height: 45%;
    //content: attr(data-content); /* dynamic content for the pseudo element */
    pointer-events: none; /* so the base char is selectable by mouse */
    overflow:hidden;
}
}
}


/* end half-style */
              
            
!

JS

              
                /*!
 * HalfStyle
 * Copyright 2014 Arbel Hakopian
 * Licensed under MIT (https://github.com/arbelh/HalfStyle/blob/master/license.md)
 */
jQuery(function($) {
    var halfstyle_text, halfstyle_chars, $halfstyle_el, halfstyle_i, halfstyle_output, halfstyle_style;

    // Iterate over all class occurrences
    $('.textToHalfStyle').each(function(idx, halfstyle_el) {
        $halfstyle_el = $(halfstyle_el);
        halfstyle_style = $halfstyle_el.data('halfstyle');
        halfstyle_text = $halfstyle_el.text();
        halfstyle_chars = halfstyle_text.split('');

        // Set the screen-reader text
        $halfstyle_el.html('<span style="position: absolute !important;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);">' + halfstyle_text + '</span>');

        // Reset output for appending
        halfstyle_output = '';

        // Iterate over all chars in the text
        //for (halfstyle_i = 0; halfstyle_i < halfstyle_chars.length; halfstyle_i++) {
            // Create a styled element for each character and append to container
            halfstyle_output += '<span aria-hidden="true" class="' + halfstyle_text + ' halfStyle ' + halfstyle_style + '"><i class="' + halfstyle_text + '"></i></span>';
        //}

        // Write to DOM only once
        $halfstyle_el.append(halfstyle_output);
    });
});
              
            
!
999px

Console