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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <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>
            
          
!
            
              @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)
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console