A fully responsive and interactive comments system built with vanilla JavaScript, featuring real-time CRUD operations, voting functionality, and persistent data storage
This project is a solution to the Interactive Comments Section challenge on Frontend Mentor. The challenge focuses on building a dynamic comment system that allows users to create, read, update, and delete comments and replies with a modern, responsive interface.
Users should be able to:
- ✅ View the optimal layout for the app on any device screen size
- ✅ See hover states for all interactive elements
- ✅ Create, read, update, and delete comments and replies
- ✅ Upvote and downvote comments with real-time score updates
- ✅ Reply to comments with nested threading
- ✅ Edit their own comments with inline editing
- ✅ Delete comments with confirmation modal
- ✅ Persist data using localStorage (bonus feature)
- ✅ Responsive design for mobile and desktop
- Full CRUD Operations: Create, read, update, and delete comments and replies
- Real-time Voting System: Upvote and downvote with instant score updates
- Nested Comment Threading: Reply to comments with proper nesting
- User Authentication Simulation: Distinguish between current user and others
- Confirmation Modals: Safe deletion with user confirmation
- Responsive Design: Mobile-first approach with seamless desktop scaling
- Data Persistence: localStorage integration for data retention
- Accessibility: Keyboard navigation and focus management
- Performance Optimized: Efficient DOM manipulation and event handling
- Clean Architecture: Modular JavaScript with separation of concerns
- Smooth Animations: Hover effects and transitions
- Interactive Elements: Visual feedback for all user actions
- Modern Design: Clean, professional interface following design specifications
- Cross-browser Compatibility: Works across all modern browsers
- HTML5: Semantic markup and accessibility features
- CSS3:
- Custom properties (CSS variables)
- Flexbox and CSS Grid
- Mobile-first responsive design
- Smooth transitions and animations
- Vanilla JavaScript (ES6+):
- DOM manipulation
- Event delegation
- localStorage API
- Modular functions
- Arrow functions and template literals
-
Clone the repository
git clone https://github.com/Ayokanmi-Adejola/interactive-comments-section.git cd interactive-comments-section -
Open the project
# Option 1: Open directly in browser open index.html # Option 2: Use a local server (recommended) npx http-server # or python -m http.server 8000
-
View in browser
- Navigate to
http://localhost:8000(if using local server) - Or open
index.htmldirectly in your browser
- Navigate to
- Type your comment in the textarea at the bottom
- Click the "SEND" button
- Your comment appears at the top of the list
- Click the + button to upvote
- Click the - button to downvote
- Scores update in real-time
- Click the "Reply" button on any comment
- Type your reply in the form that appears
- Click "REPLY" to submit
- Click "Edit" on your own comments (marked with "you" badge)
- Modify the text in the inline editor
- Click "UPDATE" to save changes
- Click "Delete" on your own comments
- Confirm deletion in the modal that appears
- Comment is permanently removed
interactive-comments-section/
├── index.html # Main HTML file
├── style.css # Complete CSS styling
├── script-clean.js # Main JavaScript functionality
├── data.json # Initial comment data
├── images/ # Assets and avatars
│ ├── avatars/ # User avatar images
│ └── *.svg # Icon files
├── design/ # Design reference files
└── README.md # Project documentation
- DOM Manipulation: Efficient element creation and management
- Event Handling: Delegation and dynamic event binding
- Data Management: localStorage integration and state management
- Modular Programming: Clean, reusable function architecture
- CSS Custom Properties: Maintainable design system
- Responsive Design: Mobile-first methodology
- Flexbox & Grid: Modern layout techniques
- Accessibility: Focus states and keyboard navigation
- Implemented nested comment threading with proper data structure
- Created smooth user experience with real-time updates
- Solved data persistence challenges with localStorage
- Optimized performance with efficient rendering strategies
- Backend Integration: Connect to a real database
- User Authentication: Implement proper user login system
- Real-time Updates: WebSocket integration for live comments
- Rich Text Editor: Markdown support and formatting options
- Image Uploads: Allow users to attach images to comments
- Notification System: Alert users of replies and mentions
- Comment Search: Search and filter functionality
- Moderation Tools: Admin controls for content management
- Frontend Mentor: @Ayokanmi-Adejola
- Frontend Mentor for providing the design challenge
- The Frontend Mentor community for inspiration and feedback
- Google Fonts for the Rubik font family# Interactive-Comments-Section
