Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <ul class="nav">
	<li class="nav_icon nav_main" data-icon="menu"></li>
	<li class="nav_title">Material Note App</li>
	<li class="nav_icon nav_down" data-nav="Settings" data-icon="settings"></li>
	<li class="nav_icon" data-nav="Dashboard View" data-icon="dashboard"></li>
	<li class="nav_icon" data-nav="Full View" data-icon="view_day"></li>
</ul>
<div class="notes">
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="blue">Yuna tickets on sale 24/6</div>
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="yellow">
		<img src="http://santoriniparty.com/wp-content/uploads/2015/03/PartyIdeas.jpg"></img>Buy:<br/>Balloons<br/>Streamers<br/>Candles<br/>Clown?</div>
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="green">Clean Desk</div>
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="blue">Finish birthday card</div>
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="yellow">
		<img src="http://www.wildcatconservation.org/wp-content/uploads/2013/03/2016-sand-cat-group.jpg"></img>Find home for new cats</div>
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="green">
		<img src="http://www.claytonhotelcardifflane.com/wp-content/uploads/2015/09/CLAYTON-FAMILY-ROOM-2048x1024.jpg"></img>Use as inspiration for new room</div>
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="blue">Order custom cake design</div>
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="yellow">Get phone repaired</div>
	<div class="note ripple_effect" data-ripple-effect="white" data-note-color="green">call caterers at 01-03947989</div>
</div>
              
            
!

CSS

              
                body,
html {
	margin: 0;
	padding: 0;
	background-color: rgb(240, 240, 240);
	width: 100%;
	height: 100%;
	font-family: 'Roboto', sans-serif
}

.notes {
	padding: 0 20px;
	box-sizing: border-box
}

.note {
	width: calc(25% - 25px);
	box-sizing: border-box;
	padding: 20px;
	box-shadow: 0 0 20px -1px grey;
	color: white;
	cursor: pointer
}

.note img {
	margin: -20px -20px 16px;
	width: calc(100% + 40px)
}

@media only screen and (max-width: 800px) {
	.note {
		width: calc(33% - 25px)
	}
}

@media only screen and (max-width: 600px) {
	.note {
		width: calc(50% - 29.5px)
	}
}

@media only screen and (max-width: 360px) {
	.note {
		width: calc(100% - 40px)
	}
}

.note.note_expanded {
	width: calc(100% - 40px)
}
              
            
!

JS

              
                var blue = "#2196F3";
var green = "#8BC34A";
var yellow = "#F9A825";

var x = document.getElementsByClassName("note");
var i;
for (i = 0; i < x.length; i++) {
	x[i].style.backgroundColor = eval(x[i].getAttribute('data-note-color'));
	var y = $(x[i]).text().length;
	if (y < 40) {
		x[i].style.fontSize = 280 / y + 9 + 'px'
	} else {
		x[i].style.fontSize = '17px'
	}
}

var url = "https://codepen.io/arianalynn/pen/gMYyoN.js";
$.getScript(url);

var $grid = $('.notes').packery({
	itemSelector: '.note',
	gutter: 20
});

document.querySelectorAll('.nav_icon[data-icon=dashboard]')[0].onclick = function() {
	$('.note').removeClass('note_expanded');
	$grid.packery('destroy');
	$('.notes').packery({
		itemSelector: '.note',
		gutter: 20
	});
};

document.querySelectorAll('.nav_icon[data-icon=view_day]')[0].onclick = function() {
	$('.note').addClass('note_expanded');
	$grid.packery('destroy');
	$('.notes').packery({
		itemSelector: '.note',
		gutter: 20
	});
}
              
            
!
999px

Console