-
Notifications
You must be signed in to change notification settings - Fork 22
/
index.html
52 lines (46 loc) · 1.28 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="dist/simplepicker.css">
<title>simplepicker</title>
<style>
.event-log {
font-family: consolas, Monaco, monospace;
margin: 10px 5px;
line-height: 2;
border: 1px solid #4c4c4c;
height: auto;
width: 90%;
padding: 2px 6px;
color: #4c4c4c;
white-space: pre;
}
</style>
</head>
<body>
<button class="simplepicker-btn">Show Picker</button>
<div class="event-log">Event logs:<br></div>
<script src="dist/simplepicker.js"></script>
<script>
let simplepicker = new SimplePicker({
zIndex: 10
});
simplepicker.open();
const $button = document.querySelector('button');
const $eventLog = document.querySelector('.event-log');
$button.addEventListener('click', (e) => {
simplepicker.open();
});
// $eventLog.innerHTML += '\n\n';
simplepicker.on('submit', (date, readableDate) => {
$eventLog.innerHTML += readableDate + '\n';
});
simplepicker.on('close', (date) => {
$eventLog.innerHTML += 'Picker Closed' + '\n';
});
</script>
</body>
</html>