@@ -15,7 +15,6 @@ updateThemeIcon();
1515
1616form . addEventListener ( 'submit' , e => {
1717 e . preventDefault ( ) ;
18-
1918 const newNote = {
2019 id : crypto . randomUUID ( ) ,
2120 title : title . value . trim ( ) ,
@@ -24,7 +23,6 @@ form.addEventListener('submit', e => {
2423 created : Date . now ( ) ,
2524 pinned : false
2625 } ;
27-
2826 notes . unshift ( newNote ) ;
2927 saveNotes ( ) ;
3028 title . value = '' ;
@@ -40,19 +38,18 @@ function saveNotes() {
4038
4139function render ( filterText = '' , tagFilterValue = '' ) {
4240 grid . innerHTML = '' ;
43-
4441 let filteredNotes = notes . filter ( n =>
4542 ( n . title . toLowerCase ( ) . includes ( filterText . toLowerCase ( ) ) ||
46- ( n . tag && n . tag . toLowerCase ( ) . includes ( filterText . toLowerCase ( ) ) ) ||
47- n . content . toLowerCase ( ) . includes ( filterText . toLowerCase ( ) ) )
43+ ( n . tag && n . tag . toLowerCase ( ) . includes ( filterText . toLowerCase ( ) ) ) ||
44+ n . content . toLowerCase ( ) . includes ( filterText . toLowerCase ( ) ) )
4845 ) ;
4946
5047 if ( tagFilterValue ) {
5148 filteredNotes = filteredNotes . filter ( n => n . tag && n . tag . toLowerCase ( ) === tagFilterValue . toLowerCase ( ) ) ;
5249 }
5350
5451 if ( filteredNotes . length === 0 ) {
55- grid . innerHTML = `<p style="text-align:center; color:#a6adbb ;">No notes found.</p>` ;
52+ grid . innerHTML = `<p style="text-align: center; opacity: 0.6 ;">No notes found.</p>` ;
5653 return ;
5754 }
5855
@@ -62,14 +59,13 @@ function render(filterText = '', tagFilterValue = '') {
6259 const card = document . createElement ( 'article' ) ;
6360 card . className = 'card' ;
6461 const date = new Date ( n . created ) . toLocaleString ( ) ;
65-
6662 card . innerHTML = `
6763 <div class="card-header">
6864 <h3>${ n . title } </h3>
6965 <button class="pin">${ n . pinned ? '📌' : '📍' } </button>
7066 </div>
7167 ${ n . tag ? `<span class="tag">${ n . tag } </span>` : '' }
72- <p class="content" >${ n . content } </p>
68+ <p>${ n . content } </p>
7369 <div class="note-footer">
7470 <small>${ date } </small>
7571 <button class="del">Delete</button>
@@ -95,7 +91,7 @@ function render(filterText = '', tagFilterValue = '') {
9591
9692function populateTags ( ) {
9793 const tags = [ ...new Set ( notes . filter ( n => n . tag ) . map ( n => n . tag ) ) ] ;
98- tagFilter . innerHTML = `<option value="">All</option>` ;
94+ tagFilter . innerHTML = `<option value="">All Tags </option>` ;
9995 tags . forEach ( t => {
10096 const opt = document . createElement ( 'option' ) ;
10197 opt . value = t ;
@@ -120,5 +116,3 @@ function updateThemeIcon() {
120116
121117render ( ) ;
122118populateTags ( ) ;
123-
124- // TODOs: persist to localStorage; full-text search; list by tag; theme toggle
0 commit comments