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.

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="container">
  	<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 1</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 2</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 3</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 4</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 5</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 6</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 7</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 8</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 9</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 10</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 11</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 12</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 13</a></div></div>
		<div class="trapezoid-container"><div class="trapezoid"><a href="">Item 14</a></div></div>
	</div>
              
            
!

CSS

              
                @import "compass/css3";

@import "compass";
$items: 15;

/* Degree variation is the number of trapezoids / 360deg*/
$deg_variation: 25.7142deg;
$deg_start: 144.25857deg;

@mixin trapezoid_style($border, $color, $z){
  border-bottom-color: $border;
	color: $color;
	z-index: $z;
}

//* I didn't find anything about using arrays on SASS */
//* Only using @foreach, but it wasn't my case, if anyone */
//* Has a better solution, I will apreciate to know! */
//* Also, I didn't find a better calculation to absolute */
//* Position of the trapezoids, it was more like try and miss*/
@mixin trapezoid_position($number) {
	@if $number == 1 {
		left:260px;
		top: 20px;
	}@else if $number == 2 {
		left:385px;
		top: 27px;
	}@else if $number == 3 {
		left: 495px;
		top: 87px;
	}@else if $number == 4 {
		left:568px;
		top: 189px;
	}@else if $number == 5 {
		left:589px;
		top: 312px;
	}@else if $number == 6 {
		left:555px;
		top: 433px;
	}@else if $number == 7 {
		left:472px;
		top: 527px;
	}@else if $number == 8 {
		left:356px;
		top: 576px;
	}@else if $number == 9 {
		left:231px;
		top: 569px;
	}@else if $number == 10 {
		left:121px;
		top: 509px;
	}@else if $number == 11 {
		left:48px;
		top: 407px;
	}@else if $number == 12 {
		left:29px;
		top: 283px;
	}@else if $number == 13 {
		left:63px;
		top: 162px;
	}@else if $number == 14 {
		left:145px;
		top: 69px;
	}
}
.container {
	width: 760px; height: 760px;
	margin: 0 auto;
	overflow: hidden;
	position: relative;
	background: #3F4037;
}
.trapezoid-container {
	width: 200px; height: 225px;
	// background: rgba(140,0,0,.3);
	position: absolute;
	text-align: center;

	&:nth-child(odd){		
		z-index:2;

		.trapezoid { @include trapezoid_style(#F0A006, #000, 2) }
		a { color: #000; }
	}

	&:nth-child(even){
		z-index:1;

		.trapezoid { @include trapezoid_style(#1C1C1C, #fff, 1) }
		a { color: #fff; }
	}
	&:hover {
		z-index: 4!important;
	}
	a {
		text-decoration: none;
		font-size: 1.2em;
		display: block;
		padding-top: 35px;
		padding-bottom: 35px;
		text-shadow: 1px 0px 1px #333;
	}

}
.trapezoid {
	width: 91px; height: 0px;
	
	//* I just put that because in my project I was using */
	//* box-sizing: border-box */
	@include box-sizing(content-box);
	@include transition(.4s);

	//*Verticaly center the trapezoid on trapezoid-container */
	margin: 15px auto 0 auto;

	border-bottom: 141px solid black;
	border-left: 28px solid transparent;
	border-right: 28px solid transparent;

	&:hover {
		width: 120px;

		//*Verticaly center the trapezoid on trapezoid-container */
		margin-top: 0; 

		z-index: 100;

		border-bottom-width: 160px;
		border-right-width: 25px;
		border-left-width: 25px;
	}
}
@for $i from 1 to $items {
	.trapezoid-container:nth-child(#{$i}) {
		$deg: $deg_start + ( $deg_variation * $i);
		@include trapezoid_position($i);
		@include rotate($deg);

		a {
			//* Does a negative rotation to the [a] with the same degree */
			//* Make them horizontaly correct */
			@include rotate($deg * -1);
		}
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console