-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
92 lines (79 loc) · 2.47 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<html>
<body>
<!-- Modal structure -->
<div class="modal" id="myModal">
<div class="modal-content">
<!-- Close button -->
<div id="closeBtn" class="closeBtnWrapper" onclick="closeModal()">
<div class="closeIconWrapper">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.6693 16.6673L3.33594 3.33398M16.6693 3.33398L3.33594 16.6673" stroke="black"
stroke-width="2" stroke-linecap="round"></path>
</svg>
</div>
</div>
<!-- Modal content -->
<div class="modal-body">
<p>Modal content goes here.</p>
</div>
</div>
</div>
<!-- Button to open the modal -->
<button onclick="openModal()">Open Modal</button>
<!-- JavaScript -->
<script>
// Function to open modal
function openModal() {
var modal = document.getElementById('myModal');
modal.style.display = 'block'; // Make the modal visible
}
// Function to close modal
function closeModal() {
var modal = document.getElementById('myModal');
modal.style.display = 'none'; // Hide the modal
}
</script>
<!-- CSS (example) -->
<style>
.modal {
display: none;
/* Hidden by default */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
/* Semi-transparent background */
z-index: 999;
/* Ensure it's on top */
}
.modal-content {
background-color: white;
margin: 15% auto;
/* Center the modal vertically and horizontally */
padding: 20px;
border: 1px solid #888;
width: 80%;
max-width: 600px;
position: relative;
}
.closeBtnWrapper {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
}
.closeIconWrapper {
width: 20px;
height: 20px;
}
.closeIconWrapper svg {
width: 100%;
height: 100%;
fill: black;
/* Customize the color of the close icon */
}
</style>
</body>
</html>