Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a h1 tag in 06-modal #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions 06-modal/final/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
// when user clicks modal-btn add .open-modal to modal-overlay
// when user clicks close-btn remove .open-modal from modal-overlay




const modalBtn = document.querySelector(".modal-btn");
const modal = document.querySelector(".modal-overlay");
const closeBtn = document.querySelector(".close-btn");

modalBtn.addEventListener("click", function () {
modal.classList.add("open-modal");
});
closeBtn.addEventListener("click", function () {
modal.classList.remove("open-modal");
modalBtn.addEventListener("click", function() {
modal.classList.add("open-modal");
});
closeBtn.addEventListener("click", function() {
modal.classList.remove("open-modal");
});
35 changes: 18 additions & 17 deletions 06-modal/final/index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Modal</title>
<!-- font-awesome -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" />
<!-- styles -->
<link rel="stylesheet" href="styles.css" />
</head>
<body>
</head>

<body>
<!-- hero -->
<header class="hero">
<div class="banner">
<h1>modal project</h1>
<button class="btn modal-btn">
<div class="banner">
<h1>modal project</h1>
<h1>THIS PROJECT WAS EDITED BY KARTIK</h1>
<button class="btn modal-btn">
open modal
</button>
</div>
</div>
</header>
<!-- modal -->
<div class="modal-overlay">
<div class="modal-container">
<h3>modal content</h3>
<button class="close-btn"><i class="fas fa-times"></i></button>
</div>
<div class="modal-container">
<h3>modal content</h3>
<button class="close-btn"><i class="fas fa-times"></i></button>
</div>
</div>
<!-- javascript -->
<script src="app.js"></script>
</body>
</html>
</body>

</html>