├── readme.txt ├── README.md ├── img ├── icons │ ├── icon-128x128.png │ ├── icon-144x144.png │ ├── icon-152x152.png │ ├── icon-192x192.png │ ├── icon-256x256.png │ └── icon-512x512.png ├── screenshots │ ├── dark.JPG │ └── light.JPG ├── moon-line.svg └── sun-warm.svg ├── js ├── index.js └── app.js ├── serviceWorker.js ├── css └── style.css ├── maniest.json └── index.html /readme.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Reman Sunuwar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # i-Notes-Application 2 | Note Taking Application 3 | -------------------------------------------------------------------------------- /img/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remansunuwarofficial/i-Notes-Application/HEAD/img/icons/icon-128x128.png -------------------------------------------------------------------------------- /img/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remansunuwarofficial/i-Notes-Application/HEAD/img/icons/icon-144x144.png -------------------------------------------------------------------------------- /img/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remansunuwarofficial/i-Notes-Application/HEAD/img/icons/icon-152x152.png -------------------------------------------------------------------------------- /img/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remansunuwarofficial/i-Notes-Application/HEAD/img/icons/icon-192x192.png -------------------------------------------------------------------------------- /img/icons/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remansunuwarofficial/i-Notes-Application/HEAD/img/icons/icon-256x256.png -------------------------------------------------------------------------------- /img/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remansunuwarofficial/i-Notes-Application/HEAD/img/icons/icon-512x512.png -------------------------------------------------------------------------------- /img/screenshots/dark.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remansunuwarofficial/i-Notes-Application/HEAD/img/screenshots/dark.JPG -------------------------------------------------------------------------------- /img/screenshots/light.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remansunuwarofficial/i-Notes-Application/HEAD/img/screenshots/light.JPG -------------------------------------------------------------------------------- /js/index.js: -------------------------------------------------------------------------------- 1 | window.onload = () => { 2 | 'use strict'; 3 | 4 | if ('serviceWorker' in navigator) { 5 | navigator.serviceWorker 6 | .register('./serviceWorker.js'); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /serviceWorker.js: -------------------------------------------------------------------------------- 1 | var cacheName = 'i-Notes { Offer By Reman Sunuwar }'; 2 | var filesToCache = [ 3 | '/', 4 | '/index.html', 5 | '/css/style.css', 6 | '/js/index.js', 7 | '/js/app.js', 8 | '/img/moon-line.svg', 9 | '/img/sun-warm.svg', 10 | '/manifest.json' 11 | ]; 12 | 13 | /* Start the service worker and cache all of the app's content */ 14 | self.addEventListener('install', function(e) { 15 | e.waitUntil( 16 | caches.open(cacheName).then(function(cache) { 17 | return cache.addAll(filesToCache); 18 | }) 19 | ); 20 | }); 21 | 22 | /* Serve cached content when offline */ 23 | self.addEventListener('fetch', function(e) { 24 | e.respondWith( 25 | caches.match(e.request).then(function(response) { 26 | return response || fetch(e.request); 27 | }) 28 | ); 29 | }); 30 | -------------------------------------------------------------------------------- /img/moon-line.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | /* // copright reman sunuwar github = https://www.github.com/remansunuwarofficial/ */ 2 | *{ 3 | padding: 0; 4 | margin: 0; 5 | } 6 | 7 | header .heading{ 8 | background-color: green; 9 | color: white; 10 | padding: 10px 30px; 11 | text-align: center; 12 | } 13 | 14 | .container{ 15 | width: 90vw; 16 | } 17 | 18 | 19 | .textarea{ 20 | width: 100%; 21 | height: 20vh; 22 | resize: none; 23 | } 24 | 25 | .input{ 26 | width: 100%; 27 | height: 4vh; 28 | } 29 | 30 | .itemsCenter{ 31 | display: flex; 32 | align-items: center; 33 | justify-content: center; 34 | } 35 | 36 | @media screen and (max-width: 1180px){ 37 | #time, #date{ 38 | font-size: 30px; 39 | } 40 | } 41 | 42 | @media screen and (max-width: 998px){ 43 | #time, #date{ 44 | font-size: 20px; 45 | } 46 | } 47 | 48 | 49 | @media screen and (max-width: 787px){ 50 | #time, #date{ 51 | font-size: 10px; 52 | /* color: ; */ 53 | } 54 | } -------------------------------------------------------------------------------- /img/sun-warm.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /maniest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "i-Notes Application", 3 | "short_name": "Reman Sunuwar", 4 | "icons": [ 5 | { 6 | "src": "/img/icons//icon-128x128.png", 7 | "sizes": "128x128", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/img/icons/icon-144x144.png", 12 | "sizes": "144x144", 13 | "type": "image/png" 14 | }, 15 | { 16 | "src": "/img/icons/icon-152x152.png", 17 | "sizes": "152x152", 18 | "type": "image/png" 19 | }, 20 | { 21 | "src": "/img/icons/icon-192x192.png", 22 | "sizes": "192x192", 23 | "type": "image/png" 24 | }, 25 | { 26 | "src": "/img/icons/icon-256x256.png", 27 | "sizes": "256x256", 28 | "type": "image/png" 29 | }, 30 | { 31 | "src": "/img/icons/icon-512x512.png", 32 | "sizes": "512x512", 33 | "type": "image/png" 34 | } 35 | ], 36 | "lang": "en-US", 37 | "start_url": "/index.html", 38 | "display": "standalone", 39 | "background_color": "#6dcdb1", 40 | "theme_color": "#009578" 41 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |${noteArray[i].notedescription}
66 |At ${noteArray[i].time} |&| On ${noteArray[i].date}
67 | 68 | 69 | 70 |Nothing to show! Use \"Add a Note\" section above to add notes.
"; 82 | } 83 | 84 | } 85 | 86 | 87 | 88 | function deleteNote(index) { 89 | // console.log(index); 90 | 91 | let notes = localStorage.getItem("notes") 92 | if (notes === null) { 93 | noteArray = []; 94 | } else { 95 | noteArray = JSON.parse(notes); 96 | } 97 | 98 | noteArray.splice(index, 1); 99 | 100 | localStorage.setItem("notes", JSON.stringify(noteArray)); 101 | showingnotes(); 102 | } 103 | /* 104 | 105 | const update = document.getElementsByClassName("update"); 106 | Array.from(update).forEach((element) => { 107 | element.addEventListener("click", () => { 108 | let getParentElement = element.parentElement; 109 | // console.log(getParentElement); 110 | let getTitle = getParentElement.getElementsByClassName("card-title")[0].innerText; 111 | let getDescription = getParentElement.getElementsByClassName("card-text")[0].innerText; 112 | console.log(getDescription); 113 | console.log(getTitle); 114 | 115 | let title = document.getElementById("notetitle"); 116 | let description = document.getElementById("notedescription"); 117 | title.value = getTitle; 118 | description.value = getDescription; 119 | 120 | }); 121 | 122 | }); 123 | 124 | 125 | function updateNote(index) { 126 | 127 | let updateButton = document.createElement("button"); 128 | updateButton.className = "btn btn-danger"; 129 | updateButton.id = "updateNoteButton"; 130 | let textNodeUpdate = document.createTextNode("Update"); 131 | updateButton.appendChild(textNodeUpdate); 132 | // console.log(updateButton); 133 | 134 | addBtn.replaceWith(updateButton); 135 | 136 | let updateNoteButton = document.getElementById("updateNoteButton"); 137 | 138 | updateNoteButton.addEventListener("click", () => { 139 | 140 | updateNoteButton.replaceWith(addBtn); 141 | let notetitle = document.getElementById("notetitle"); 142 | let notedescription = document.getElementById("notedescription"); 143 | let noteObj = { 144 | notetitle: notetitle.value, 145 | notedescription: notedescription.value 146 | } 147 | 148 | 149 | noteArray.splice(index, 1, noteObj); 150 | 151 | 152 | localStorage.setItem("notes", JSON.stringify(noteArray)); 153 | showingnotes(); 154 | 155 | // notetitle.value = ""; 156 | 157 | // notedescription.value = ""; 158 | 159 | // window.location.reload(); 160 | 161 | }); 162 | 163 | 164 | 165 | 166 | 167 | 168 | }*/ 169 | 170 | 171 | function updateNote(index) { 172 | let notes = localStorage.getItem("notes") 173 | if (notes === null) { 174 | noteArray = []; 175 | } else { 176 | noteArray = JSON.parse(notes); 177 | } 178 | 179 | let getTitle = document.getElementsByClassName("gettitle"); 180 | getTitle = getTitle[index].innerText; 181 | 182 | let getdescription = document.getElementsByClassName("getdescription"); 183 | getdescription = getdescription[index].innerText; 184 | // console.log(getTitle); 185 | // console.log(getdescription); 186 | let notetitle = document.getElementById("notetitle"); 187 | let notedescription = document.getElementById("notedescription"); 188 | 189 | notetitle.value = getTitle; 190 | notedescription.value = getdescription; 191 | 192 | 193 | let updateButton = document.createElement("button"); 194 | 195 | updateButton.className = "btn btn-danger"; 196 | 197 | updateButton.id = "updateButton"; 198 | 199 | let updateButtonText = document.createTextNode("update"); 200 | updateButton.appendChild((updateButtonText)); 201 | addBtn.replaceWith(updateButton); 202 | 203 | let update = document.getElementById("updateButton"); 204 | update.addEventListener("click", () => { 205 | 206 | let notetitle = document.getElementById("notetitle"); 207 | let notedescription = document.getElementById("notedescription"); 208 | 209 | let noteObj = { 210 | notetitle: notetitle.value, 211 | notedescription: notedescription.value, 212 | time: new Date().toLocaleTimeString().toString(), 213 | date: new Date().toLocaleDateString().toString(), 214 | impNote: false 215 | } 216 | 217 | update.replaceWith(addBtn); 218 | noteArray.splice(index, 1, noteObj); 219 | 220 | localStorage.setItem("notes", JSON.stringify(noteArray)); 221 | showingnotes(); 222 | notetitle.value = ""; 223 | notedescription.value = ""; 224 | }); 225 | 226 | } 227 | 228 | let searchbyTit = document.getElementById("searchbyTit"); 229 | 230 | searchbyTit.addEventListener("input", function () { 231 | let searchbyTitValue = searchbyTit.value.toUpperCase(); 232 | 233 | let noteCards = document.getElementsByClassName("noteCard"); 234 | 235 | Array.from(noteCards).forEach((element) => { 236 | let title = element.getElementsByClassName("searchTitle")[0].innerText.toUpperCase(); 237 | // console.log(title); 238 | // console.log(description) 239 | // console.log(title.includes("h")) 240 | 241 | if (title.includes(searchbyTitValue)) { 242 | element.style.display = "block"; 243 | } else { 244 | element.style.display = "none"; 245 | } 246 | }); 247 | 248 | }); 249 | 250 | 251 | 252 | let searchbyDesc = document.getElementById("searchbyDesc"); 253 | 254 | searchbyDesc.addEventListener("input", function () { 255 | let searchbyDescValue = searchbyDesc.value.toUpperCase(); 256 | 257 | let noteCards = document.getElementsByClassName("noteCard"); 258 | 259 | Array.from(noteCards).forEach((element) => { 260 | let description = element.getElementsByClassName("searchDescription")[0].innerText.toUpperCase(); 261 | // console.log(title); 262 | // console.log(description) 263 | // console.log(title.includes("h")) 264 | // console.log(description) 265 | 266 | if (description.includes(searchbyDescValue)) { 267 | element.style.display = "block"; 268 | } else { 269 | element.style.display = "none"; 270 | } 271 | }); 272 | 273 | }); 274 | 275 | 276 | 277 | 278 | 279 | const clearNote = document.getElementById("clearNote"); 280 | 281 | clearNote.addEventListener("click", () => { 282 | let askQA = confirm("Do you surely want to delete all notes"); 283 | 284 | if (askQA === true) { 285 | localStorage.removeItem("notes"); 286 | window.location.reload(); 287 | } else { 288 | return; 289 | } 290 | }); 291 | 292 | 293 | 294 | 295 | let themeIcon = document.getElementById("themeIcon"); 296 | 297 | themeIcon.addEventListener("click", () => { 298 | 299 | if (themeIcon.getAttribute("src").includes("img/moon-line.svg")) { 300 | 301 | 302 | themeIcon.src = "img/sun-warm.svg"; 303 | localStorage.setItem("theme", "light"); 304 | 305 | } 306 | 307 | else { 308 | 309 | themeIcon.src = "img/moon-line.svg"; 310 | 311 | localStorage.setItem("theme", "dark"); 312 | 313 | } 314 | 315 | if (localStorage.getItem("theme") === "light") { 316 | 317 | // let NothingNullNote = document.getElementById("NothingNullNote"); 318 | // NothingNullNote.style.color = "#fff"; 319 | document.body.style.backgroundColor = "#212529"; 320 | 321 | // document.body.style.color = "white"; 322 | let h1 = document.getElementsByTagName("h1"); 323 | Array.from(h1).forEach((e) => { 324 | e.style.color = "white" 325 | 326 | }); 327 | 328 | 329 | let label = document.getElementsByTagName("label"); 330 | 331 | Array.from(label).forEach((e) => { 332 | e.style.color = "white"; 333 | }); 334 | 335 | let themeIcon = document.getElementById("themeIcon"); 336 | themeIcon.src = "img/sun-warm.svg"; 337 | 338 | 339 | } else if (localStorage.getItem("theme") === "dark") { 340 | 341 | // let NothingNullNote = document.getElementById("NothingNullNote"); 342 | // NothingNullNote.style.color = "#000"; 343 | 344 | document.body.style.backgroundColor = "white"; 345 | let h1 = document.getElementsByTagName("h1"); 346 | Array.from(h1).forEach((e) => { 347 | e.style.color = "black"; 348 | 349 | }); 350 | 351 | 352 | let label = document.getElementsByTagName("label"); 353 | Array.from(label).forEach((e) => { 354 | e.style.color = "black"; 355 | }); 356 | 357 | 358 | let themeIcon = document.getElementById("themeIcon"); 359 | themeIcon.src = "img/moon-line.svg"; 360 | } 361 | 362 | }); 363 | 364 | 365 | 366 | 367 | if (localStorage.getItem("theme") === "light") { 368 | // let NothingNullNote = document.getElementById("NothingNullNote"); 369 | // NothingNullNote.style.color = "#fff"; 370 | document.body.style.backgroundColor = "#212529"; 371 | // document.body.style.color = "white"; 372 | let h1 = document.getElementsByTagName("h1"); 373 | 374 | Array.from(h1).forEach((e) => { 375 | e.style.color = "white" 376 | 377 | }); 378 | 379 | let label = document.getElementsByTagName("label"); 380 | 381 | Array.from(label).forEach((e) => { 382 | e.style.color = "white"; 383 | }); 384 | 385 | let themeIcon = document.getElementById("themeIcon"); 386 | themeIcon.src = "img/sun-warm.svg"; 387 | 388 | 389 | } else if (localStorage.getItem("theme") === "dark") { 390 | 391 | // let NothingNullNote = document.getElementById("NothingNullNote"); 392 | // NothingNullNote.style.color = "#000"; 393 | 394 | 395 | document.body.style.backgroundColor = "white"; 396 | let h1 = document.getElementsByTagName("h1"); 397 | Array.from(h1).forEach((e) => { 398 | e.style.color = "black"; 399 | 400 | }); 401 | let label = document.getElementsByTagName("label"); 402 | Array.from(label).forEach((e) => { 403 | e.style.color = "black"; 404 | }); 405 | 406 | 407 | let themeIcon = document.getElementById("themeIcon"); 408 | themeIcon.src = "img/moon-line.svg"; 409 | 410 | } 411 | 412 | // copright reman sunuwar github = https://www.github.com/remansunuwarofficial/ --------------------------------------------------------------------------------