Skip to content

Commit 36eed90

Browse files
author
Tray2
committed
Add examples/showalertexample.html
1 parent 034d080 commit 36eed90

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
index.html
2-
showalert.html
1+
index.html

examples/showalert.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Document</title>
8+
<style>
9+
.is-hidden {
10+
display: none;
11+
}
12+
13+
.modal {
14+
background-color: rgba(0,0,0, 0.3);
15+
position: fixed;
16+
z-index: 5;
17+
left: 0;
18+
top: 0;
19+
min-width: 100%;
20+
min-height: 100%;
21+
overflow: auto;
22+
}
23+
24+
.modal-content {
25+
background-color: lightpink;
26+
margin: 15% auto;
27+
padding: 20px;
28+
border: 1px solid #888;
29+
width: 80%;
30+
border-radius: 5px;
31+
}
32+
33+
body {
34+
padding: 10px;
35+
background-color: azure;
36+
border: 1px solid #888;
37+
border-radius: 5px;
38+
font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
39+
}
40+
41+
</style>
42+
</head>
43+
<body>
44+
<h1>Alert modal example</h1>
45+
<button onclick="showAlert('This is an alert!')">Show Alert</button>
46+
<section id="alert-modal" class="is-hidden modal">
47+
<div class="modal-content">
48+
<p id="alert-message-text"></p>
49+
<button onclick="hide('#alert-modal')">Close</button>
50+
</div>
51+
</section>
52+
<script src="helper.js"></script>
53+
</body>
54+
</html>

0 commit comments

Comments
 (0)