@@ -116,7 +116,7 @@ function add_note(title_el,data_el)
116116 main_container = document . getElementById ( 'nt' ) ;
117117 main_container . appendChild ( note_card ) ;
118118 html = `
119- <div class="card text-white bg-dark mx-1 mb-3" id="${ notes_count + 1 } " style=" max-width: 18rem; min-width: 18rem;">
119+ <div class="card text-white bg-dark mx-1 mb-3" id="${ notes_count + 1 } " style=" max-width: 18rem; min-width: 18rem;">
120120 <div class="card-header row container-fluid justify-content-between" style="margin: 0px !important">
121121 Note: ${ notes_count + 1 } <i" onclick="notedelete(${ notes_count + 1 } ,'${ title_el } ')"style="padding: 3px 0 0 0; cursor:pointer;" class="fa fa-trash" aria-hidden="true"></i>
122122
@@ -186,17 +186,19 @@ function saved_notes_display()
186186 for ( var title in note )
187187 {
188188 if ( all_dom_notes_title . length )
189- all_dom_notes_title . forEach ( function note_exist_in_dom_checker ( domtitle , ind )
190- {
191-
192-
193- if ( title != domtitle )
189+ { all_dom_notes_title . forEach ( function note_exist_in_dom_checker ( domtitle , ind )
194190 {
195- data = note [ title ] ;
196- add_note ( title , data ) ;
197- }
191+
198192
199- } ) ;
193+ if ( title != domtitle )
194+ {
195+ data = note [ title ] ;
196+ add_note ( title , data ) ;
197+
198+ }
199+
200+ } ) ;
201+ }
200202 else {
201203
202204 data = note [ title ] ;
@@ -229,6 +231,28 @@ function alert_shower(type,msg)
229231 </button>
230232 </div>
231233 `
234+ }
235+ ////////////////////////////////search function///////////////////////////////
236+
237+ function note_search ( e )
238+ {
239+ input = document . getElementsByClassName ( 'note-search' ) [ 0 ] . value . toLowerCase ( ) ;
240+ cards = document . getElementsByClassName ( 'card-title' ) ;
241+
242+ for ( i = 0 ; i < cards . length ; i ++ )
243+ {
244+ if ( cards [ i ] . innerHTML . toLowerCase ( ) . indexOf ( input ) > - 1 )
245+ {
246+ cards [ i ] . parentNode . parentNode . style . display = "" ;
247+ }
248+ else
249+ {
250+ cards [ i ] . parentNode . parentNode . style . display = "none" ;
251+ }
252+
253+ }
254+
255+
232256}
233257//////////////////////////////////////text transition using anime.js/////////////////////////////////////////
234258
0 commit comments