123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

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.

            
              <div class="rozhlas">
  <div class="antena"></div>
  <div class="budkaA"></div>
  <div class="budkaB"></div>
  <div class="budkaC">Slovenský Rozhlas</div>
  <div class="strecha"></div>
  <div class="pyramida1"></div>
  <div class="pyramida1a"></div>
  <div class="pyramida2"></div>
  <div class="pyramida2a"></div>
  <div class="pyramida3"></div>
  <div class="pyramida3a"></div>
  <div class="pyramida4"></div>
  <div class="pyramida4a"></div>
  <div class="pyramida5"></div>
  <div class="pyramida5a"></div>
  <div class="pyramida6"></div>
  <div class="pyramida6a"></div>
  <div class="pyramida7"></div>
  <div class="pyramida7a"></div>
</div>
            
          
!
            
              @import compass

@import url(https://fonts.googleapis.com/css?family=Orbitron)

$w: 520px
$h: 3/4 * $w
$pi: 3.14159265359
$_precision: 10
 
@function pow($base, $exp)
	$value: $base
	@if $exp > 1
		@for $i from 2 through $exp
			$value: $value * $base
	@if $exp < 1
		@for $i from 0 through -$exp
			$value: $value / $base
	@return $value

@function fact($num)
	$fact: 1
	@if $num > 0
		@for $i from 1 through $num
			$fact: $fact * $i
	@return $fact

@function _to_unitless_rad($angle)
	@if unit($angle) == "deg"
		$angle: $angle / 180deg * $pi
	@if unit($angle) == "rad"
		$angle: $angle / 1rad
	@return $angle
 
@function sin($angle)
	$a: _to_unitless_rad($angle)
	$sin: $a
	@for $n from 1 through $_precision
		$sin: $sin + (pow(-1, $n) / fact(2 * $n + 1) ) * pow($a, (2 * $n + 1))
	@return $sin
 
@function cos($angle)
	$a: _to_unitless_rad($angle)
	$cos: 1
	@for $n from 1 through $_precision
		$cos: $cos + ( pow(-1,$n) / fact(2*$n) ) * pow($a,2*$n)
	@return $cos

@function tan($angle)
	@return sin($angle) / cos($angle)

$obkladColor: #54403C
$obvodColor: #dedede
$pyramidaColor: #54403C

$wAntena: 0.005*$w
$hAntena: 0.14*$h
$wBudkaA: 0.18*$w
$hBudkaA: 0.16*$h
$wBudkaB: 0.48*$w
$hBudkaB: 0.07*$h
$wBudkaC: 0.62*$w
$hBudkaC: 0.07*$h
$hStrecha: 0.02*$h
$anglePyramide: 52deg

$hPyramida: ($w/2) * tan($anglePyramide)
$wPyramida: $w
$pyramidFloors: 7

.basic
	width: 0px
	height: 0px
	overflow: hidden
	position: absolute

.rozhlas
	width: $w
	height: $h
	overflow: hidden
	display: block
	position: absolute
	.antena
		@extend .basic
		width: $wAntena
		height: $hAntena
		top: 0
		left: ( $w / 2 ) - ($wAntena / 2)
		background: darken($obkladColor,2%)
	.budkaA
		@extend .basic
		width: $wBudkaA
		height: $hBudkaA
		top: $hAntena
		left: ( $w / 2 ) - ($wBudkaA / 2)
		background: darken($obkladColor, 4%)
	.budkaB
		@extend .basic
		width: $wBudkaB
		height: $hBudkaB
		top: $hAntena + $hBudkaA
		left: ( $w / 2 ) - ($wBudkaB / 2)
		background: darken($obkladColor,5%)
	.budkaC
		@extend .basic
		width: $wBudkaC
		height: $hBudkaC
		top: $hAntena + $hBudkaA + $hBudkaB
		left: ($w/2) - ($wBudkaC/2)
		background: darken( $obkladColor, 6%)
		font-family: 'Orbitron', sans-serif
		color: orange
		font-size: 0.035 * $h
		text-transform: uppercase
		letter-spacing: 0.003 * $w
		text-align: center
		padding-top: 0.03 * $h
	.strecha
		@extend .basic
		width: $wPyramida
		height: $hStrecha
		left: ($w/2) - ($wPyramida/2)
		top: $hAntena + $hBudkaA + $hBudkaB + $hBudkaC
		background: $obvodColor
	
	$b : ( ($h - ($hAntena + $hBudkaA + $hBudkaB + $hBudkaC + $hStrecha) ) / tan($anglePyramide) )
	$bDiff : $b / ($pyramidFloors)
	$hFloor : ($h - ( $hAntena + $hBudkaA + $hBudkaB + $hBudkaC + $hStrecha ) ) / $pyramidFloors
	$hDiffA: 0.02*$h
	$bA : ( ($h - ($hAntena + $hBudkaA + $hBudkaB + $hBudkaC + $hStrecha + $hDiffA) ) / tan($anglePyramide) )
	$bDiffA : $bA / ($pyramidFloors)
	$hFloorA : ($h - ( $hAntena + $hBudkaA + $hBudkaB + $hBudkaC + $hStrecha + $hDiffA) ) / $pyramidFloors

	@for $i from 1 through $pyramidFloors
		.pyramida#{$i}
			@extend .basic
			width: 0
			height: 0
			border-left: (($wPyramida/2) - ((($i - 1)*$bDiff) ) ) solid transparent
			border-right: (($wPyramida/2) - ((($i - 1)*$bDiff) ) ) solid transparent
			border-top: ( $hPyramida - ( ($i - 1) * $hFloor)) solid darken( $pyramidaColor, $i*1%)
			top: $hAntena + $hBudkaA + $hBudkaB + $hBudkaC + $hStrecha + ($i - 1) * $hFloor
			left: ($w/2) - (($wPyramida/ 2) - (($i - 1)*$bDiff) )

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console