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

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.

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

              
                .flex-container
	.unit
		.heart
			- for (var i = 0; i < 9; i++)
				div(class='heart-piece-'+[i])
		p| love is love

              
            
!

CSS

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

size(w=100%,h=100%)
	width w
	height h

html
body
	size()

.flex-container
	size()
	position relative
	display flex
	flex-wrap wrap 
	justify-content center
	align-items center

// -------- Variables --------//

$background = #262e6f

$red = #ec2d73
$orange = #eb5324
$yellow = #fdc800
$green = #47b264
$blue = #1470bd
$purple = #76469a

// -------- Style --------//

body
	background-color $background

.unit
	text-align center
	p
		margin-top 100px
		font-family 'Lato', sans-serif
		font-weight 100
		text-transform uppercase
		letter-spacing 2px
		color white

.heart
	position relative
	font-size 0
	width 138px
	
[class*="heart-piece-"]
	position absolute
	top -5px
	size(10px,10px)
	border-radius 5px
	
$Colors = $red, $orange, $yellow, $green, $blue, $purple, $red, $orange, $yellow 
		
.heart-piece-4
	animation piece-4 3.2s infinite

.heart-piece-3
.heart-piece-5
	animation piece-3 3.2s infinite

.heart-piece-2
.heart-piece-6
	animation piece-2 3.2s infinite

.heart-piece-1
.heart-piece-7
	animation piece-1 3.2s infinite

.heart-piece-0
.heart-piece-8
	animation piece-0 3.2s infinite
		
for num in (0 .. 8)
	.heart-piece-{num}
		left 16px * num
		animation-delay 0.15s * num
		background-color $Colors[num]

@keyframes piece-4 {
  0%, 10%, 90%, 100%{
	height 10px
	top -5px
 }
 45%, 55%{
	height 94px
	top -23px
 }
}

@keyframes piece-3 {
 0%, 10%, 90%, 100%{
	height 10px
	top -5px
 }
 45%, 55%{
	height 90px
	top -31px
 }
}

@keyframes piece-2 {
 0%, 10%, 90%, 100%{
	height 10px
	top -5px
 }
 45%, 55%{
	height 80px
	top -37px
 }
}

@keyframes piece-1 {
 0%, 10%, 90%, 100%{
	height 10px
	top -5px
 }
 45%, 55%{
	height 60px
	top -31px
 }
}

@keyframes piece-0 {
 0%, 10%, 90%, 100%{
	height 10px
	top -5px
 }
 45%, 55%{
	height 30px
	top -15px
 }
}
              
            
!

JS

              
                
              
            
!
999px

Console