diff --git a/assets/addition.png b/assets/addition.png new file mode 100644 index 0000000..6f45d3c Binary files /dev/null and b/assets/addition.png differ diff --git a/assets/list.png b/assets/list.png new file mode 100644 index 0000000..ab076e4 Binary files /dev/null and b/assets/list.png differ diff --git a/assets/writing.png b/assets/writing.png new file mode 100644 index 0000000..59ef13c Binary files /dev/null and b/assets/writing.png differ diff --git a/index.html b/index.html index 8c5ff97..30e44b7 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,7 @@ About Reviews Contact Us + Keep Notes GitHub @@ -135,6 +136,28 @@

No projects found

+
+
+

Keep Notes

+ +
+ +
+

My Notes

+
+
+
+

Add Notes

+
+

+
+

+
+
+
+
+
+

Developer Reviews

diff --git a/script.js b/script.js index ec8d677..220cd7b 100644 --- a/script.js +++ b/script.js @@ -643,14 +643,6 @@ document.addEventListener("DOMContentLoaded", () => { faders.forEach(fade => observer.observe(fade)); }); -entries.forEach((entry, index) => { - if (entry.isIntersecting) { - setTimeout(() => { - entry.target.classList.add('animate'); - }, index * 100); // 100ms delay between cards - observer.unobserve(entry.target); - } -}); const reviewSwiper = new Swiper(".review-swiper", { @@ -665,3 +657,150 @@ entries.forEach((entry, index) => { }, speed: 700, // smooth transition }); + +/* ========================================= + NOTEPAD INTEGRATION + ========================================= */ + +// Notepad State +let editIndex = -1; + +// Notepad Functions +function saveNote() { + const titleInput = document.getElementById("title"); + const contentInput = document.getElementById("content"); + const saveBtn = document.querySelector(".add_notes button"); + + const title = titleInput.value.trim(); + const content = contentInput.value.trim(); + + if (!title || !content) { + alert("Please fill both Title and Content!"); + return; + } + + const note = { title, content }; + let notes = JSON.parse(localStorage.getItem("notes")) || []; + + if (editIndex === -1) { + // Add new note + notes.push(note); + } else { + // Update existing note + notes[editIndex] = note; + editIndex = -1; + saveBtn.innerText = "Save Note"; + } + + localStorage.setItem("notes", JSON.stringify(notes)); + displayNotes(); + + // Clear inputs + titleInput.value = ""; + contentInput.value = ""; + + // Clear drafts + localStorage.removeItem("draft_title"); + localStorage.removeItem("draft_content"); +} + +function editNote(index) { + let notes = JSON.parse(localStorage.getItem("notes")) || []; + const note = notes[index]; + const saveBtn = document.querySelector(".add_notes button"); + + document.getElementById("title").value = note.title; + document.getElementById("content").value = note.content; + + editIndex = index; + saveBtn.innerText = "Update Note"; + + document.getElementById("addnotes").scrollIntoView({ behavior: "smooth" }); +} + +function displayNotes() { + const notes = JSON.parse(localStorage.getItem("notes")) || []; + const container = document.getElementById("notesContainer"); + + if (!container) return; + + container.innerHTML = ""; + + notes.forEach((note, index) => { + const card = document.createElement("div"); + card.classList.add("note-card"); + + // Updated with Font Awesome icons + card.innerHTML = ` +
+

${note.title}

+
+ + +
+
+

${note.content}

+ `; + + container.appendChild(card); + }); +} + +function deleteNote(index) { + let notes = JSON.parse(localStorage.getItem("notes")) || []; + const saveBtn = document.querySelector(".add_notes button"); + + if (index === editIndex) { + editIndex = -1; + if(saveBtn) saveBtn.innerText = "Save Note"; + document.getElementById("title").value = ""; + document.getElementById("content").value = ""; + } else if (index < editIndex) { + editIndex--; + } + + notes.splice(index, 1); + localStorage.setItem("notes", JSON.stringify(notes)); + displayNotes(); +} + +/* ========================================= + NOTEPAD INITIALIZATION & EVENTS + ========================================= */ + +document.addEventListener("DOMContentLoaded", () => { + // 1. Load Drafts + const draftTitle = localStorage.getItem("draft_title") || ""; + const draftContent = localStorage.getItem("draft_content") || ""; + const titleInput = document.getElementById("title"); + const contentInput = document.getElementById("content"); + + if (editIndex === -1 && titleInput && contentInput) { + titleInput.value = draftTitle; + contentInput.value = draftContent; + } + + // 2. Display Notes + displayNotes(); + + // 3. Attach Input Listeners for Auto-Saving Drafts + if (titleInput) { + titleInput.addEventListener("input", () => { + if (editIndex === -1) { + localStorage.setItem("draft_title", titleInput.value); + } + }); + } + + if (contentInput) { + contentInput.addEventListener("input", () => { + if (editIndex === -1) { + localStorage.setItem("draft_content", contentInput.value); + } + }); + } +}); \ No newline at end of file diff --git a/style.css b/style.css index d313e13..c17ad47 100644 --- a/style.css +++ b/style.css @@ -1584,4 +1584,167 @@ body.dark-theme button:hover { flex-wrap: wrap; font-size: 14px; gap: 50px; +} + +/* Main Containers */ +.add_notes, .mynotes { + background: inherit; + backdrop-filter: blur(14px); + border-radius: 16px; + padding: 25px; + margin-top: 60px; + border: 2px solid rgba(255, 255, 255, 0.7); + box-shadow: 0 0 14px rgba(255, 255, 255, 0.6); +} + +.dark-theme .add_notes { + background: inherit; + backdrop-filter: blur(14px); + border-radius: 16px; + padding: 25px; + margin-top: 60px; + border: 2px solid rgba(255, 255, 255, 0.8); + box-shadow: 0 0 18px rgba(255, 255, 255, 0.75); +} + +/* Headings and Icons */ +.add_notes h2 .add, .mynotes h2 .add{ + width: 25px; + height: 25px; + filter: brightness(80%); +} + +.mynotes h2 img{ + margin-right: 5px; + transform: translateY(2px); +} + +.dark-theme .add_notes h2 .add, .dark-theme .mynotes h2 .add{ + filter: invert(100%) brightness(100%); +} + +.dark-theme .add_notes input, +.dark-theme .add_notes textarea { + color: white !important; + background: rgba(255, 255, 255, 0.1); + border: 1px solid rgba(255, 255, 255, 0.3); +} + +.dark-theme .add_notes input::placeholder, +.dark-theme .add_notes textarea::placeholder { + color: rgba(255, 255, 255, 0.7); +} + +.add_notes h2{ + font-size: 1.5rem; + font-weight: 700; + margin-bottom: 20px; + display: flex; + align-items: center; + gap: 10px; + color: var(--text-color); +} + +.mynotes h2{ + margin-bottom: 15px; +} + +/* Form Inputs */ +.add_notes label{ + font-size: 20px; + letter-spacing: 0.5px; +} + +.add_notes input:focus, .add_notes textarea:focus{ + border-color: var(--primary-color); + box-shadow: 0 0 6px rgba(30, 144, 255, 0.5); + outline: none; +} + +.add_notes #title{ + width: 100%; + padding: 10px; + border: none; + border-radius: 8px; + font-size: 1rem; + margin-top: 10px; +} + +.add_notes textarea{ + width: 100%; + height: 150px; + padding: 10px; + border: none; + border-radius: 8px; + font-size: 1rem; + font-family:'Inter', sans-serif; + resize: vertical; + margin-top: 10px; +} + +/* Note Cards */ +.notes-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 20px; + + max-height: 350px; /* Limits the height (adjust this number as you like) */ + overflow-y: auto; /* Shows scrollbar when content exceeds max-height */ + padding-right: 10px; /* Prevents text from hitting the scrollbar */ + padding-bottom: 10px; +} + +.note-card { + background: var(--card-bg); + padding: 18px; + border-radius: 12px; + box-shadow: var(--card-shadow); + border: 1px solid var(--card-border); + display: flex; + flex-direction: column; + gap: 10px; +} + +.note-card h3 { + margin-bottom: 10px; + color: var(--text-color); +} + +.note-card p { + color: var(--text-color); + white-space: pre-wrap; +} + +.note-header { + display: flex; + justify-content: space-between; + align-items: center; +} + +/* Edit and Delete Buttons */ +.delete-btn { + background: transparent; + border: none; + font-size: 1.2rem; + cursor: pointer; + transition: 0.2s; +} + +.delete-btn:hover { + transform: scale(1.2); + color: red; +} + +.edit-btn { + background: transparent; + border: none; + font-size: 1.2rem; + cursor: pointer; + transition: 0.2s; + margin-right: 10px; +} + +.edit-btn:hover { + transform: scale(1.2); + color: #4facfe; } \ No newline at end of file