-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
73 lines (66 loc) · 2.13 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Modal Demo</title>
<link rel="stylesheet" href="build/modal-default.css" />
<style>
body {
-webkit-animation: jazzItUpABit 3s infinite linear;
}
@-webkit-keyframes jazzItUpABit {
0% {
background-color: papayawhip;
}
25% {
background-color: indianred;
}
50% {
background-color: chartreuse;
}
75% {
background-color: cadetblue;
}
100% {
background-color: oldlace;
}
}
button {
padding: 15px;
background: #c0ffee;
border-radius: 0;
border: 0;
font-size: 20px;
}
</style>
</head>
<body>
<button type="button" id="modal-demo">Click me for modal</button>
<script src="build/classList.js"></script>
<script src="build/ModalService.js"></script>
<script>
var button = document.getElementById('modal-demo');
var service = new ModalService({
skeleton: 'modalTest',
templates: {
'modalTest': function(data) {
return '<div class="modal"><div class="modal-container" data-modal-content>' + data.content + '</div></div>';
},
'modalTest-content': function(data) {
return 'Some normal modal content';
},
'alertModal': function(data) {
return '<p>' + data.alertText + '</p><button type="button" data-modal-close>Ok</button>';
},
'confirmModal': function(data) {
return '<p>' + data.confirmText + '</p><button type="button" data-modal-close>cancel</button><button type="button" data-modal-close>Ok</button>';
}
}
});
button.addEventListener('click', function() {
window.modal = service.confirm('modalTest-content');
modal.open();
}, false);
</script>
</body>
</html>