"use strict";!function(){var t=function(t,i){this.$element=t,this.defaultOptions={height:this.$element.height(),width:this.$element.width(),css:{"-webkit-clip-path":"polygon(50% 0, 0 100%, 100% 100%, 50% 0)","-moz-clip-path":"polygon(50% 0, 0 100%, 100% 100%, 50% 0)","clip-path":"polygon(50% 0, 0 100%, 100% 100%, 50% 0)",background:"#ccc"}},this.options=$.extend({},this.defaultOptions,i)};t.prototype={init:function(){this.$element.css(this.options.css),this.createFloor(this.getEachFloorHeight(this.options.height,this.options.proportion))},getEachFloorHeight:function(t,i){var o=i.reduce(function(t,i){return t+i});return i.map(function(e,n){for(var h=0,s=0,r=0;r<=n;r++)r>0&&(h+=i[r-1]),s+=i[r];return Math.sqrt(s/o*Math.pow(t,2))-Math.sqrt(h/o*Math.pow(t,2))})},createFloor:function(t){for(var i=0;i")),this.$element.find(".pyramid-floor:eq("+i+")").css({height:t[i]+"px","border-bottom":"1px solid #fff"})}},$.fn.pyramid=function(i){return new t(this,i).init()}}($);