-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
138 lines (111 loc) · 3.36 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
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
// load Branch
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode autoAppIndex banner closeBanner closeJourney creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setBranchViewData setIdentity track validateCode trackCommerceEvent logEvent disableTracking".split(" "), 0);
// init Branch
branch.init('key_live_abMVppLQKWJLIg9krOs0Immkqxn0Xpy2', function(err, data) {
console.log(data);
});
function saveClicked() {
console.log("Save clicked");
var snowmanObj = new Object();
snowmanObj.name = document.getElementById("name-input").value;
snowmanObj.head = document.getElementById("head-selection").value;
snowmanObj.neck = document.getElementById("neck-selection").value;
var snowmanJSON = JSON.stringify(snowmanObj);
var linkData = {
data: {
'snowman_obj': snowmanJSON
}
};
branch.link(linkData, function(err, link) {
console.log(link);
var appButton = document.getElementById("open-app-button");
appButton.style.display = "block";
appButton.setAttribute("href", link);
});
};
</script>
</head>
<style type="text/css">
body
{
margin: 0;
font-family: "HelveticaNeue", "Helvetica-Neue", "Helvetica Neue", "Helvetica", sans-serif;
}
.container
{
margin: 0;
margin-left: 10px;
padding: 0;
margin-top: 20px;
width: 100%;
}
.container div
{
box-sizing: border-box;
min-height: 150px;
min-width: 150px;
}
.container
{
/* display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
flex-flow: row wrap; */
}
#open-app-button
{
display: none;
}
@media (min-width: 600px)
{
.container
{
margin-left: 10px;
}
}
@media (min-width: 800px)
{
.container
{
width: 800px;
margin-left: auto;
margin-right: auto;
}
}
</style>
<body>
<div class="container" role="main">
<h1>Select Accessories</h1>
<form action="#" onsubmit="saveClicked();return false">
<h2>Name Your Snowman</h2>
<input id="name-input" type="text"></input>
<h2>Head</h2>
<select name="head" id="head-selection">
<option value="normal_hat">Select an Option</option>
<option value="normal_hat">Normal Hat</option>
<option value="baseball_cap">Baseball Cap</option>
<option value="beanie">Beanie</option>
</select>
<h2>Neck</h2>
<select name="head" id="neck-selection">
<option value="bow_tie">Select an Option</option>
<option value="bow_tie">Bow Tie</option>
<option value="tie">Tie</option>
<option value="scarf">Scarf</option>
<option value="branch_pin">Branch Pin</option>
</select>
<br><br><br>
<!-- <input type="submit" value="Continue in App"> -->
<input type="submit" value="Save">
<br><br><br>
<a href="#" id="open-app-button">Open in App</a>
</form>
</div>
</body>
<script>
</script>
</html>