Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <h1 class='title'>Swarming Fungi</h1>
<p class='instructions'>Hover in the petri dish to have the fungi swarm after your delicious cursor.</p>
<div class='grid'>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='grid__square'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
  <div class='flocker'></div>
</div>
              
            
!

CSS

              
                @import bourbon
@import url(https://fonts.googleapis.com/css?family=Montserrat)
	
=block($w, $h)
	display: block
	width: $w
	height: $h

$grid-size: 70vh

$background: #87cdd4
$dish: #fffede
$mold: #fb7aa3
$accent: #f8a967
$text: white
$accent2: gold

body
	background-color: $background
	font-family: 'Montserrat', sans-serif

.title
	color: $dish
	text-align: center
	padding: 4vh 0 2vh
	font-size: 5vh
	
.instructions
	color: $text
	opacity: .75
	text-align: center
	width: 60vw
	margin-left: 20vw
	font-size: 1em
	line-height: 1.5

.grid
	+block($grid-size, $grid-size)
	background: $dish
	margin: 0 auto
	position: relative
	border-radius: 50%
	margin-top: 4.5vh
	overflow: hidden
	transform-style: preserve-3d
	border: 1vh solid $accent2
	
.grid__square
	box-sizing: border-box
	+block($grid-size/10, $grid-size/10)
	float: left
	cursor: pointer
	position: relative
	z-index: 2

.flocker
	+block($grid-size/10, $grid-size/10)
	background: $mold
	border-radius: 50%
	position: absolute
	z-index: 1
	will-change: transform

@for $i from 1 through 20
	.flocker:nth-child(#{$i + 100})
		+transform(rotate((360/20) * $i + 0deg) translateY(20vh))
		+transform-origin($grid-size/2 $grid-size/2)
		transition: all 1.7s linear

@for $y from 0 through 9
	@for $x from 1 through 5
		.grid__square:nth-child(#{($y*10 + $x)}):hover
			&~.flocker
				+transform(translateX(($x - 1) * $grid-size/10) translateY($y * $grid-size/10))
			@for $j from 1 through 20
				&~.flocker:nth-child(#{$j + 100})
					transition-duration: (random(200)/100 + .5s)
		$x2: $x + 5
		.grid__square:nth-child(#{($y*10 + $x2)}):hover
			&~.flocker
				+transform(translateX(($x2 - 1) * $grid-size/10) translateY($y * $grid-size/10))
			@for $j from 1 through 20
				&~.flocker:nth-child(#{$j + 100})
					transition-duration: (random(200)/100 + .5s)
              
            
!

JS

              
                
              
            
!
999px

Console