/
index.html
146 lines (130 loc) · 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
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
140
141
142
143
144
145
146
<html>
<head>
<!-- Meta -->
<title>Onboarded Example - Product Tour</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Onboarded">
<meta name="author" content="Onboarded">
<meta name="viewport" content="width=device-width">
<!-- CSS -->
<link rel="stylesheet" href="./css/normalize.css" type="text/css" media="screen">
<link rel="stylesheet" href="./css/style.css" type="text/css" media="screen">
<!-- Responsive CSS -->
<link rel="stylesheet" type="text/css" href="./css/altStyles.css">
<!-- Load jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- Load Onboarded plugin -->
<script src="//d237d8mq680mpf.cloudfront.net/jquery-onboarded/latest/jquery-onboarded.min.js"></script>
<!-- Custom Product Tour Javascript -->
<script>
// Method to unhighlight everything on the page
window.cleanUpFlowStyleClasses = function () {
$("#headerItemOne").removeClass("lit-up")
$("#headerItemTwo").removeClass("lit-up")
$("#footerItemOne").removeClass("lit-up")
$("#mainItemOne").removeClass("lit-up")
}
jQuery( function () {
// Load Onboarded
window.ol = Onboarded.load()
$("#start").on("click", function (e) {
// Show the overlay background and start the flow without checking API for user's state
$(".overlay").removeClass("hidden")
ol.startFlow({ skipApiCheck: true })
})
$('.overlay').on("click", function (e) {
// When a user clicks on overlay, dismiss the flow without resetting it
ol.getFlow().dismiss()
return false
})
$("#endFlow").on("click", function (e) {
// Completion button - Dismisses and Resets the flow
ol.resetFlow().dismissFlow()
})
// Event Handlers
$(document)
.on("onboarded:flow:afterDismissal", function (e, flow, step) {
cleanUpFlowStyleClasses()
// When flow gets dismissed, hide the overlay
$(".overlay").addClass("hidden")
})
.on("onboarded:step:afterStart", function (e, step) {
// step.$step
switch ( step.label ) {
case "one":
cleanUpFlowStyleClasses()
$("#headerItemOne").addClass("lit-up")
return false
break
case "two":
cleanUpFlowStyleClasses()
$("#headerItemTwo").addClass("lit-up")
return false
break
case "three":
cleanUpFlowStyleClasses()
$("#footerItemOne").addClass("lit-up")
return false
break
case "four":
cleanUpFlowStyleClasses()
$("#mainItemOne").addClass("lit-up")
return false
break
default:
return e
}
})
})
</script>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="headerItemOne">Nav One</div>
<div id="headerItemTwo">Nav Two</div>
</div>
<div id="main">
<h1 class="top"><a id="logo" href="http://www.getonboarded.com"></a></h1>
<h1 class="tag">Onboarded Example - Product Tour</h1>
<button id="start">Start Tour</button>
<div class="margin-top margin-bottom">
<div id="mainItemOne">Something important goes here.</div>
</div>
</div>
<div id="footer">
<div id="footerItemOne">Other Content</div>
</div>
<!-- Start Onboarded Flow Markup -->
<!-- Dont forget to swap data-onboarded-token with your own project token so you can log in to see your data and analytics ! -->
<div class="oc" data-onboarded-token="-6j5J3BOlXxjXTxYAR6OGA" style="display: none;">
<div data-onboarded-flow="product-tour-example">
<section id="step-one" data-step="one">
<h2>Fill With Nav One Onboarding Content</h2>
<button data-name="next" data-action-next="two">Next</button>
</section>
<section id="step-two" data-step="two">
<h2>Fill With Nav Two Onboarding Content</h2>
<button data-name="previous" data-action-next="one">Prev</button>
<button data-name="next" data-action-next="three">Next</button>
</section>
<section id="step-three" data-step="three">
<h2>Fill With Other Onboarding Content</h2>
<button data-name="previous" data-action-next="two">Prev</button>
<button data-name="next" data-action-next="four">Next</button>
</section>
<section id="step-four" data-step="four">
<h2>Fill With More Onboarding Content</h2>
<button data-name="previous" data-action-next="three">Prev</button>
<button id="endFlow" data-name="finish" data-action-complete>Done</button>
</section>
</div>
</div>
<!-- End Onboarded Flow Markup -->
<div class="overlay hidden"></div>
</div>
<script type="text/javascript">
console.log("Onboarded Example - Product Tour");
</script>
</body>
</html>