Skip to content

Commit 832cca7

Browse files
authored
Css Javascript Modal Box App
1 parent fcf496d commit 832cca7

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

PopupModalApp/app.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const modal = document.querySelector('.myModal');
2+
const btn = document.querySelector('.btn');
3+
const close = document.querySelector('span');
4+
5+
btn.addEventListener('click', function() {
6+
modal.style.display = "block";
7+
});
8+
9+
close.addEventListener('click', function() {
10+
modal.style.display = "none";
11+
});

PopupModalApp/index.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet">
7+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
8+
<script src="https://use.fontawesome.com/01826e8fb5.js"></script>
9+
<link rel="stylesheet" type="text/css" href="style.css">
10+
<title>Popup Modal App</title>
11+
</head>
12+
<body>
13+
<div class="myModal">
14+
<div class="popup-content">
15+
<span>X</span>
16+
<h1>BMW 640d xDrive 313 HP</h1>
17+
<p>Yukarıdaki arabanın siyahı bizim güneyde var</p>
18+
</div>
19+
</div>
20+
21+
<div class="container">
22+
<h1 class="display-1 text-center">Güney Fucking Ural</h1>
23+
<button class="btn" id="getModal">Open Modal Box!</button>
24+
</div>
25+
26+
<script src="app.js"></script>
27+
</body>
28+
</html>

PopupModalApp/style.css

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
body {margin: 0;padding:0;font-family: 'Montserrat', Arial, Helvetica, sans-serif}
2+
3+
.myModal {
4+
display: none;
5+
position: fixed;
6+
z-index: 1;
7+
top: 0;
8+
left: 0;
9+
width: 100%;
10+
height: 100%;
11+
overflow: auto;
12+
background-color: rgb(0,0,0);
13+
background-color: rgba(0,0,0,0.4);
14+
padding-top: 250px;
15+
transition: 0.4s;
16+
}
17+
18+
.popup-content {
19+
margin: auto;
20+
background-color: white;
21+
width: 40%;
22+
}
23+
24+
span {
25+
float: right;
26+
font-size: 28px;
27+
padding-right: 10px;
28+
}
29+
30+
span:hover {
31+
cursor: pointer;
32+
color: black;
33+
}
34+
35+
.btn {
36+
display:block;
37+
border:1px solid #1b68e3;
38+
background: #1b68e3;
39+
border-radius: 8px;
40+
padding: 20px;
41+
font-size: 30px;
42+
font-weight: bold;
43+
color: white;
44+
letter-spacing: 3px;
45+
text-align: center;
46+
margin: auto;
47+
margin-top: 130px;
48+
cursor: pointer;
49+
outline: 0;
50+
}

0 commit comments

Comments
 (0)