-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
113 lines (91 loc) · 2.5 KB
/
index.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple Modal</title>
<link rel="stylesheet" href="src/css/simple-modal.css">
<style>
.container {
max-width: 1020px;
margin: 0 auto;
}
.show-modal {
padding: 10px 15px;
border: none;
background: #eee;
cursor: pointer;
font-size: 15px;
}
.show-modal:hover {
box-shadow: 2px 2px 2px #ddd;
}
.show-outher-modal {
padding: 10px 15px;
border: none;
background: #ddd;
cursor: pointer;
font-size: 15px;
}
.show-outher-modal:hover {
box-shadow: 2px 2px 2px #ddd;
}
pre {
background: #eee;
}
</style>
</head>
<body>
<div class="container">
<!-- button show modal -->
<h1>Example Show Modal</h1>
<button class="show-modal">Show Modal</button>
<button class="show-outher-modal">Show Outher Modal</button>
<pre>
<code>
// Show Modal (Default Width 400px)
new SimpleModal({
modal: '.my-modal',
content: '.my-content',
trigger: '.show-modal',
})
// Show Outher Modal (With 800px)
new SimpleModal({
modal: '.my-outher-modal',
content: '.my-outher-content',
trigger: '.show-outher-modal',
width: 800 // 800px
})
</code>
</pre>
</div>
<!-- modal element -->
<div class="my-modal">
<div class="my-content">
<h1>Hello World</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Porro totam tempora expedita ipsa. Quas dolorem, dolor tenetur inventore, cum excepturi ea ratione unde id, numquam natus blanditiis provident suscipit dolorum.</p>
</div>
</div>
<div class="my-outher-modal">
<div class="my-outher-content">
<h1>Halo Dunia</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Porro totam tempora expedita ipsa. Quas dolorem, dolor tenetur inventore, cum excepturi ea ratione unde id, numquam natus blanditiis provident suscipit dolorum.</p>
</div>
</div>
<script src="src/js/simple-modal.js"></script>
<script>
// My Modal
new SimpleModal({
modal: '.my-modal',
content: '.my-content',
trigger: '.show-modal',
})
// My Outher Modal
new SimpleModal({
modal: '.my-outher-modal',
content: '.my-outher-content',
trigger: '.show-outher-modal',
width: 800 // width 800px
})
</script>
</body>
</html>