cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

	- (1..8) .each do |i|
			- (1..36).each do |j|
%span.notice Inspired by "Mazes for Programmers"
              @import bourbon

$raw-diameter: 400
$diameter: $raw-diameter * 1px
$cells: 36
$circles: 8
$cell-depth: ($raw-diameter/2)/$circles
$cell-depth-px: $cell-depth * 1px
$subdivide-at: 4

$color-bg: linear-gradient(#990073, #80dfff)
$color-ground: radial-gradient(#99bbff 30%, #990098 80%, #000 100%)
$color-wall: gold
$color-title: red

$pi: 3.1415926535

=block($w, $h)
	display: block
	width: $w
	height: $h

	background: $color-bg
	min-height: 100vh
	font-family: 'Ubuntu', sans-serif
	color: white

	color: $color-title
	text-align: center

	+block($diameter, $diameter)
	position: absolute
	border: 5px solid $color-wall
	background: $color-ground
	border-radius: 50%
	top: 50vh
	left: 50vw
	+transform(translateX(-50%) translateY(-50%))

	+block($diameter, $diameter)
	//border: 2px solid yellow
	border-radius: 50%
	position: absolute
	top: 0

@for $i from 1 through $circles
	$local-cells: $cells/ceil($i/$subdivide-at)
	$rot: 360deg/$local-cells
		$scale: ($diameter - ($i - 1)*($cell-depth*2))/$diameter
		$inv-scale: $diameter/($diameter - ($i - 1)*($cell-depth*2))
		+transform(scale($scale) translateX($i * -1px))
			+block((($diameter - ($cell-depth-px*$inv-scale)*2)*$pi)/$local-cells, $cell-depth-px*$inv-scale)
			border-width: $i * 1.1px !important
				height: $i * 1px !important

		$group-count: 0
		@for $j from 1 through $local-cells
				+transform(rotate($rot * ($j - 1) ))
				+transform-origin(0 $diameter/2)
		@for $j from 0 through $local-cells
			$toss: random(2)
			@if $toss == 1
				$group-count: $group-count + 1
				.circle__cell:nth-child(#{$local-cells - $j}) .circle__cell-walls
					border-left: 0
						+transform(rotate(4.5deg + ceil($i/$subdivide-at)))
				$break: random($group-count + 1)
				$group-count: 0
				.circle__cell:nth-child(#{$local-cells - $j + $break - 1}) .circle__cell-walls
						display: none

		.circle__cell:nth-child(#{$local-cells}) + .circle__cell
			display: none
	// hides the inner-most circle
	.circle:nth-child(#{$circles - 1}),
		display: none

	+block(($diameter*$pi)/$cells, $cell-depth-px)
	position: absolute
	left: 50%

	+block(100%, 100%)
	box-sizing: border-box
	border-left: 1px solid $color-wall
	position: relative
		content: ''
		+block(100%, 2px)
		background: $color-wall
		position: absolute
		bottom: 0
		left: 0

🕑 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.
Loading ..................