Skip to content

This project is a fully functional cookie consent modal built with vanilla JavaScript. It was created as part of the "Essential JavaScript" course, focusing on core JavaScript concepts to build a practical and common web feature.

Notifications You must be signed in to change notification settings

Ayoubxpy/Cookie-Consent-Modal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cookie Consent Modal

This project is a fully functional cookie consent modal built with vanilla JavaScript. It was created as part of the "Essential JavaScript" course, focusing on core JavaScript concepts to build a practical and common web feature.

🌟 Features

  • Dynamic Modal: A pop-up modal that appears on the screen to request user consent for cookies.
  • Timed Display: The modal is set to appear after a specific delay using setTimeout.
  • Interactive Form: Includes a form for users to submit their preferences.
  • Form Data Handling: Utilizes the FormData API to manage and process form submissions.
  • User Feedback: Dynamically adds messages to the modal based on user interaction.
  • State Management: Elements like buttons can be enabled or disabled based on the state of the form.
  • Accessibility: Built with accessibility in mind to ensure it's usable by everyone.

πŸ“š Concepts & Skills Covered

This project demonstrates a solid understanding of fundamental JavaScript concepts, including:

  • DOM Manipulation: Creating, positioning, and modifying HTML elements with JavaScript.
  • Asynchronous JavaScript: Using setTimeout to control when the modal appears.
  • Event Handling: Managing user interactions like clicks and form submissions, and using preventDefault() to control default browser behavior.
  • Forms in JavaScript:
    • Handling form submission.
    • Using validation attributes.
    • Working with the FormData API.
  • Styling with JavaScript: Applying styles directly to elements via the element.style property.
  • CSS Classes: Using classList.toggle() for dynamic styling and state changes.

πŸš€ How to Use

  1. Clone the repository.
  2. Open index.html in your web browser.
  3. The cookie consent modal will appear after a few seconds.

This project was inspired by and completed as part of the "Build a Cookie Consent" module in the "Essential JavaScript" course. A huge shoutout to Scrimba for their amazing interactive learning platform!

About

This project is a fully functional cookie consent modal built with vanilla JavaScript. It was created as part of the "Essential JavaScript" course, focusing on core JavaScript concepts to build a practical and common web feature.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published