Note Taking App

Developer
Size
3,424 Kb
Views
44,528

How do I make an note taking app?

Note Taking App - uses localStorage to save your notes. What is a note taking app? How do you make a note taking app? This script and codes were developed by Event Horizon on 30 July 2022, Saturday.

Note Taking App Previews

Note Taking App - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Note Taking App</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>Notes</h1>
<div id="noteEntry"> <div id="topNE"> <input id="noteTitle" type="text" placeholder="Type title here. Example: Linux"/><input id="noteSubTitle" type="text" placeholder="Type subtitle here. Example: WiFi"/> </div> <div id="middleNE"> <textarea id="noteText" placeholder="Type note here. Example: Explanation of connecting to WiFi."></textarea> </div> <div id="bottomNE"><a id="saveBut" href="#" title="Click to save your note.">Save</a></div>
</div>
<div id="noteList"></div> <script src="js/index.js"></script>
</body>
</html>

Note Taking App - Script Codes CSS Codes

*{ box-sizing:border-box;
}
html,body{ height:100%; padding:16px;
}
h1{ padding:16px 0px; font-size:1.5em; font-weight:bold; font-family:sans-serif;
}
#noteEntry{ padding-bottom:16px;
}
#topNE input{ position:relative; margin:0px; border:1px solid #999; width:50%; font:12px sans-serif; padding:4px; color:#0066ff; font-weight:bold;
}
#middleNE textarea{ width:100%; height:128px; resize:none; border:1px solid #999; border-top:0px; font:12px sans-serif; padding:4px; color:#666; overflow:hidden;
}
#bottomNE{ height:32px;
}
#bottomNE a{ display:block; width:100%; height:100%; border:1px solid #999; border-top:0px; text-align:center; line-height:32px; text-decoration:none; color:#333; margin-top:-4px;/*overcorrection for other elements/whitespace?*/
}
#bottomNE a:hover{ color:#000;
}
#bottomNE a:active{ color:#666;
}
#bottomNE a:visited{ color:#00f;
}
#noteList{ min-height:512px;
}
.note{ border:1px solid #999; min-height:64px; margin-bottom:16px;
}
.noteTop{
}
.noteTitle{ display:inline-block; font:12px sans-serif; width:128px; padding:4px; color:#0066ff; font-weight:bold;
}
.noteSubTitle{ display:inline-block; font:12px sans-serif; width:calc(100% - 132px); padding:4px; color:#0066ff; font-weight:bold;
}
.noteBottom{
}
.noteText{ width:100%; height:100%; padding:4px; font:12px sans-serif; color:#666;
}

Note Taking App - Script Codes JS Codes

document.addEventListener("DOMContentLoaded",function(){
var ntIn=document.getElementById("noteTitle"), ntsIn=document.getElementById("noteSubTitle"), ntxtIn=document.getElementById("noteText"), notesOut=document.getElementById("noteList"), saveBut=document.getElementById("saveBut");
//fields object {noteTitle:element,noteSubTitle:element,noteText:element,out:element}
function noteManager(fields){ fields=fields||{}; var out=fields.out||undefined, notes=[]; var sendOut=function(html){ var output=document.createElement("div"); output.innerHTML=html; out.appendChild(output); }; var loadNotes=function() { if (localStorage.getItem('notes')) { var load = JSON.parse(localStorage.getItem('notes')); notes = load; console.log('Loaded notes object:'+JSON.stringify(load)); } resetHTML(); }; var saveNotes=function() { var save = JSON.stringify(notes); localStorage.setItem('notes', save); console.log('Saved shortcut object:'+notes); }; this.clearSavedNotes=function(){ localStorage.setItem('notes', ""); }; this.deleteNote=function(noteID){ for(var count=0;count<notes.length;count+=1){ console.log(notes[count].id); if(notes[count].id===noteID){ if (count > -1) { notes=notes.splice(count,1); } } } }; var resetHTML=function(){ out.innerHTML=""; for(var count=0;count<notes.length;count+=1){ if(notes[count].html){ sendOut(notes[count].html); } } }; var createNote=function(){//could be better var newNote={}, result=''; loadNotes(); if(notes.length>0){ newNote.id=notes.length; } else{ newNote.id=0; } newNote.noteTitle=fields.noteTitle.value; newNote.noteSubTitle=fields.noteSubTitle.value; newNote.noteText=fields.noteText.value; result+='<div class="note" data-noteid="'+newNote.id+'">'; result+='<div class="noteTop">'; result+='<div class="noteTitle">'+newNote.noteTitle+'</div>'; result+='<div class="noteSubTitle">'+newNote.noteSubTitle+'</div>'; result+='</div>'; result+='<div class="noteBottom">'; result+='<div class="noteText">'+newNote.noteText+'</div>'; result+='</div></div>'; sendOut(result); newNote.html=result; notes.push(newNote); console.log(notes); saveNotes(); }; this.setButton=function(butEl){ butEl.addEventListener("click",createNote); }; var init=function(){ loadNotes(); }();
}
var myNotes=new noteManager({noteTitle:ntIn,noteSubTitle:ntsIn,noteText:ntxtIn,out:notesOut});
myNotes.setButton(saveBut);
});
Note Taking App - Script Codes
Note Taking App - Script Codes
Home Page Home
Developer Event Horizon
Username Event_Horizon
Uploaded July 30, 2022
Rating 3
Size 3,424 Kb
Views 44,528
Do you need developer help for Note Taking App?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Event Horizon (Event_Horizon) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!