DEV Community

Cover image for My React Journey: Day 7
Ayoola Damilare
Ayoola Damilare

Posted on

My React Journey: Day 7

I decided to build a To-Do App using plain JavaScript, and I’m excited to share what I’ve achieved so far!

Features Implemented:

  1. Task Management:

Users can add new tasks, edit existing ones, mark tasks as complete, or delete them.
Completed tasks are visually differentiated with a strikethrough and styled text.

  1. Progress Tracking:

A progress bar dynamically updates to show how many tasks are completed out of the total.
Progress stats (e.g., 2/5 tasks completed) are also displayed.

  1. Data Persistence:

Tasks are stored in LocalStorage, so your list is saved even when the page is refreshed.

  1. Celebration Effect:

When all tasks are marked as complete, the app celebrates with a confetti animation for extra motivation!

Design:

  • I used CSS variables to maintain a consistent theme across the app, with a clean and modern interface.
  • Each task has icons for edit and delete, making the app more user-friendly.

Key Challenges & Solutions:

  • Challenge: Making the progress bar dynamic.
    Solution: Calculated the percentage of completed tasks and updated the width of the progress bar in real time.

  • Challenge: Ensuring persistence after a refresh.
    Solution: Integrated LocalStorage to store and retrieve tasks efficiently.

Code Highlights:
Used reusable JavaScript functions like addTask(), deleteTask(), and updateTasksList() for better structure.
Leveraged forEach() for seamless iteration and manipulation of tasks.
Added event listeners to manage user actions dynamically.

Day 8, here I come

Top comments (0)