@@ -116,7 +116,7 @@ function add_note(title_el,data_el)
116
116
main_container = document . getElementById ( 'nt' ) ;
117
117
main_container . appendChild ( note_card ) ;
118
118
html = `
119
- <div 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;">
120
120
<div class="card-header row container-fluid justify-content-between" style="margin: 0px !important">
121
121
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>
122
122
@@ -186,17 +186,19 @@ function saved_notes_display()
186
186
for ( var title in note )
187
187
{
188
188
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 )
194
190
{
195
- data = note [ title ] ;
196
- add_note ( title , data ) ;
197
- }
191
+
198
192
199
- } ) ;
193
+ if ( title != domtitle )
194
+ {
195
+ data = note [ title ] ;
196
+ add_note ( title , data ) ;
197
+
198
+ }
199
+
200
+ } ) ;
201
+ }
200
202
else {
201
203
202
204
data = note [ title ] ;
@@ -229,6 +231,28 @@ function alert_shower(type,msg)
229
231
</button>
230
232
</div>
231
233
`
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
+
232
256
}
233
257
//////////////////////////////////////text transition using anime.js/////////////////////////////////////////
234
258
0 commit comments