### CSS Effects
**Tags:** Modal, Vanilla JS, Inter Font, Rounded Corners, Soft Shadows
**Summary:** A fully functional modal component implemented using vanilla JavaScript with a modern UI design.
---
### ✨ Overview
This example demonstrates how to create a modal popup using pure vanilla JavaScript. The modal features rounded corners, soft shadows, and a modern typography style.
### ๐งฑ Full Implementation
### ๐ก Explanation
1. **HTML Structure:**
- The modal is encapsulated within a `.modal-overlay` div, which acts as the backdrop for the modal.
- Inside the overlay, there's a `.modal` div that contains the content of the modal.
2. **CSS Styling:**
- The `@import` statement includes the Inter font from Google Fonts.
- Basic styling is applied to the body to center its contents.
- The `.modal-overlay` has a semi-transparent background and uses flexbox for centering.
- The `.modal` div has rounded corners, soft shadows, and padding.
3. **JavaScript Functionality:**
- Event listeners are added to the "Open Modal" button to toggle the `active` class on the modal overlay, which controls its visibility.
- Similarly, a click event listener is attached to the close button within the modal to hide it again.
LIVE PREVIEW
Interactive
โน️ Note: Code snippets are ready to copy-paste.
Comments
Post a Comment