-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
139 lines (125 loc) · 5.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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap demo</title>
<link href="https://cdn.jsdelivr.net/npm/intro.js@7.0.1/minified/introjs.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row pt-4 pb-4">
<div class="col text-center">
<h1>Hello, world!</h1>
<button class="btn btn-primary" id="button">
Start Tour
</button>
</div>
</div>
<div class="row mt-4">
<div class="col-4">
<div class="card card1">
<div class="card-body">
<h4>Card 1</h4>
</div>
</div>
</div>
<div class="col-4">
<div class="card card2">
<div class="card-body">
<h4 class="card2-header">Card 2</h4>
<input class="form-control mb-2"></input>
<button class="btn btn-secondary btn-block ">
Card 2 Button
</button>
<button class="btn btn-danger btn-block mt-2">
Cancel
</button>
</div>
</div>
</div>
<div class="col-4">
<div class="card card3">
<div class="card-body">
<h4>Card 3</h4>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.3/dist/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/intro.js@7.0.1/intro.min.js"></script>
<script src="build/index.js"></script>
<script>
document.querySelector('.btn-secondary').addEventListener('click', async () => {
if (!document.querySelector('input').value) {
return;
}
await wait(2000);
$('#exampleModal').modal('show');
});
document.querySelector('.btn-danger').addEventListener('click', async () => {
document.querySelector('.card2').remove();
});
document.querySelector('.btn-primary').addEventListener('click', () => {
advanceTour({
exitOnOverlayClick: false,
steps: [{
title: 'Welcome',
intro: 'Hello World! 👋'
},
{
element: '.card2',
intro: 'Add a value to create something',
hints: [{
element: 'input',
hint: 'Enter the text'
}],
hideNext: true,
},
{
element: '.btn-secondary',
intro: 'Click Button to continue',
hideNext: true,
condition: '.form-control:has-text',
hidePrev: true
},
{
condition: '.modal-dialog:visible(500)',
element: '.modal-dialog',
intro: 'You see a modal now'
},
{
title: 'Farewell!',
intro: 'And this is our final step!'
}]
});
});
function wait(timeout) {
return new Promise(resolve => setTimeout(resolve, timeout));
}
</script>
</body>
</html>