A lightweight, client-side web app to save, view, edit, and manage your code snippets directly in the browser — built using HTML, CSS, and JavaScript.
Your snippets live safely in your browser’slocalStorage, no backend required 🚀
🔗 Live Project: https://code-yaadein.vercel.app
- 🗂️ View all saved code snippets in a responsive card layout
- 🔍 View full snippet details in a modal (title, language, code, description)
- ✏️ Edit and update snippets directly inside the modal
- 🗑️ Delete snippets with confirmation prompts
- 💾 Automatic persistence in browser
localStorage - 🔔 Smooth toast notifications for save/delete actions
- 💡 Syntax highlighting (for Java snippets)
- 📱 Fully responsive and mobile-friendly design
CodeYaadein/
├── assets/
│ ├── css/
│ │ ├── snippets.css # Styles for the snippets page
│ │ └── styles.css # Global site styles
│ └── js/
│ ├── snippets.js # Main logic for managing snippets
│ └── script.js # Additional site scripts (if any)
│
├── index.html # Homepage (optional)
├── snippets.html # Main Snippets Management Page
└── README.md
All snippets are stored locally under the key codeSnippets in localStorage.
Example structure:
[
{
"title": "Example Snippet",
"language": "Java",
"description": "Simple hello world example",
"code": "public class Main { public static void main(String[] args) { System.out.println(\"Hello\"); } }"
}
]When no snippets exist, the app automatically displays a friendly
“No snippets saved yet 😅” message.
Each snippet appears as a card with:
- Title and language tag
- Short description
- “View Code” button to open a modal
- Open modal → Edit code → Save
- Updates reflect instantly in localStorage
- Click “Delete” → Confirm prompt
- Snippet is removed and UI re-renders
- Basic Java syntax highlighting using pure HTML, CSS, and JS
- Keywords, classes, methods, and comments are colorized dynamically
- Open the project in VS Code
- Right-click
snippets.html→ Open with Live Server
cd "C:\Users\Dell\Desktop\webBasics"
python -m http.server 8000Then visit: http://localhost:8000/snippets.html
⚠️ Some features may not work if opened directly viafile://.
Nothing displays?
-
Check if snippets exist:
console.log(JSON.parse(localStorage.getItem("codeSnippets")));
-
Ensure file paths are correct:
assets/js/snippets.jsassets/css/snippets.css
Modal not opening / buttons not working?
- Open browser DevTools (F12) → Console tab → Check for JS errors
- Make sure
snippets.jsis included once at the bottom ofsnippets.html
- 📤 Export/Import snippets as JSON
- 🧠 Multi-language syntax highlighting
- 🔍 Search and filter snippets
- 🌙 Dark/Light theme toggle
- ☁️ Cloud sync support (optional future update)
All data is stored locally in your browser. No data ever leaves your device. Be aware that clearing browser data or using incognito mode will remove snippets.
Harpuneet Singh Frontend & Full Stack Developer 📍 GitHub • LinkedIn
This project is open source and available under the MIT License.