css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

    <!--meta charset="utf-8"-->
    <title>HTML5 Note App</title>
    <!--link rel="stylesheet" href="styles.css" /-->
    <!--script scr="main.js"></script-->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/localStorage/2.0.1/localStorage.js" />
      <input type="text" id="note_content" />
      <input type="button" id="add_sticky" value="New Note" />
      <input type="button" id="clear_button" value="Delete Notes" />
    <ul id="stickies">
              body {
	background-color: #D4AAAA;
	font-size: 100%;

form input#note_content {
	width: 350px;

/* sticky note */

ul#stickies li {
	display: block;
	list-style: none;
	z-index: 1;
	float: left; 
	margin: 30px;
	padding: 15px 15px 50px 15px;
	width: 200px;
	height: 200px;
	border: 3px solid #80000;
    background-color: #fafad2;
	color: #80000;
	text-decoration: none;
	-webkit-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
	-moz-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
	-o-box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
	box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
	-webkit-transition: all 0.5s ease-in;
	-moz-transition: all 0.5s ease-in;
	-o-transition: all 0.5s ease-in;
	-ms-transition: all 0.5s ease-in;
	transition: all 0.5s ease-in;
	overflow: hidden;

ul#stickies li span.sticky {
	font-family: Verdana, Helvetica, sans-serif;
	font-size: 200%;

 * rotation
ul#stickies li:nth-child(even) {
	-webkit-transform: rotate(2deg);
	-moz-transform: rotate(2deg);
	-o-transform: rotate(2deg);
	-ms-transform: rotate(2deg);
	transform: rotate(2deg);

ul#stickies li:nth-child(odd) {
	-webkit-transform: rotate(-1deg);
	-moz-transform: rotate(-1deg);
	-o-transform: rotate(-1deg);
	-ms-transform: rotate(-1deg);
	transform: rotate(-1deg);

ul#stickies li:nth-child(3n) {
	-webkit-transform: rotate(1deg);
	-moz-transform: rotate(1deg);
	-o-transform: rotate(1deg);
	-ms-transform: rotate(1deg);
	transform: rotate(1deg);

   Transform demo 
   Uses the transition (defined above) to ease in.
ul#stickies li:hover {
	-webkit-box-shadow: 5px 5px 6px rgba(0, 0, 0, 0.4);
	-moz-box-shadow: 5px 5px 6px rgba(0, 0, 0, 0.4);
	-o-box-shadow: 5px 5px 6px rgba(0, 0, 0, 0.4);
	-webkit-transform: rotate(0deg) scale(1.25);
	-moz-transform: rotate(0deg) scale(1.25);
	-o-transform: rotate(0deg) scale(1.25);
	-ms-transform: rotate(0deg) scale(1.25);
	transform: rotate(0deg) scale(1.25);
	z-index: 10;
              window.onload= function() {
  var clearButton= document.getElementById("clear_button");
  clearButton.onclick = clearStorage;

function clearStorage() {

window.onload = init;
function init(){
    var button = document.getElementById("add_sticky");
    button.onclick = makeSticky; //defined below
    var stickiesArray = getStickiesArray(); 
    for (var i=0; i < stickiesArray.length; i++){
        //no longer iterating through localStorage ---good idea
        var key = stickiesArray[i];
        var value = stickiesArray[key];
//define getStickiesArray function
function getStickiesArray(){
     var stickiesArray = localStorage.getItem["stickiesArray"];
     //check if it exists
     if (!stickiesArray){
        //create one below if not
        stickiesArray = []
        //now store the array
        localStorage.setItem("stickiesArray", JSON.stringify(stickiesArray));
        stickiesArray = JSON.parse(stickiesArray);
     return stickiesArray;
//define makeSticky function
function makeSticky(){
     var stickiesArray = getStickiesArray();
     var currentDate = new Date();
     var key = "sticky_" + currentDate.getTime();
     var value = document.getElementById("note_content").value;
     localStorage.setItem(key, value);
     localStorage.setItem("stickiesArray", JSON.stringify(stickiesArray));
//define addStickyToPage function
function addStickyToPage(value){
    var stickies = document.getElementById("stickies");
    var sticky = document.createElement("li");
    var span = document.createElement("span");
    span.setAttribute("class", "sticky");
    span.innerHTML = value;

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