Skip to content

Commit fa70965

Browse files
committed
[other] make websdk example page look decent on mobile
Right now its totally bugged cause we try to split view on a vertical screen. This makes it so that we will just have a vertical scroll on mobile
1 parent 80c9fae commit fa70965

File tree

1 file changed

+51
-30
lines changed

1 file changed

+51
-30
lines changed

examples/example.template.html

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,26 @@
88
<title>Branch Metrics Web SDK Example App</title>
99
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
1010
<style type="text/css">
11-
.lineBreak {
12-
opacity: 0.5;
13-
background-color: lightgray;
11+
.split-container {
12+
display: flex;
13+
align-items: stretch;
14+
justify-content: center;
15+
width: 90%;
16+
margin: auto;
1417
}
1518

16-
.horizontalLine {
17-
height: 0.5px;
18-
width: 100%;
19+
.container {
20+
width: 45%;
21+
margin: 10px;
22+
padding: 15px;
23+
background: #fff;
24+
border-radius: 5px;
25+
box-sizing: border-box;
1926
}
2027

2128
.verticalLine {
2229
width: 0.5px;
23-
}
24-
25-
body {
26-
font-family: Arial, sans-serif;
27-
background-color: #f4f4f9;
28-
color: #333;
29-
}
30-
31-
label {
32-
display: block;
33-
font-size: 14px;
34-
margin-bottom: 6px;
35-
font-weight: bold;
30+
background-color: lightgray;
3631
}
3732

3833
.apiInput {
@@ -52,8 +47,27 @@
5247
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
5348
}
5449

55-
.row {
56-
margin-bottom: 30px;
50+
@media (max-width: 768px) {
51+
.split-container {
52+
flex-direction: column;
53+
}
54+
55+
.container {
56+
width: 100%;
57+
margin: 10px 0;
58+
}
59+
60+
.verticalLine {
61+
display: none;
62+
}
63+
64+
.api-info {
65+
order: -1;
66+
}
67+
68+
.api-methods {
69+
order: 1;
70+
}
5771
}
5872

5973
#configButtons {
@@ -189,42 +203,45 @@
189203
<div style="display: flex; flex-direction: column; align-items: center; width: 100%">
190204
<h2>Branch Metrics Web SDK Example</h2>
191205
<hr class="lineBreak horizontalLine">
192-
<div style="display: flex; align-items: stretch; justify-content: center; width: 90%;">
193-
<div class="container">
206+
<div class="split-container">
207+
<div class="container api-methods">
194208
<section>
195-
<div class="row col-lg-8 col-lg-offset-2">
209+
<div class="row">
196210
<h3>Methods</h3>
197-
<a>https://help.branch.io/developers-hub/docs/web-full-reference</a>
211+
<a href="https://help.branch.io/developers-hub/docs/web-full-reference" target="_blank">https://help.branch.io/developers-hub/docs/web-full-reference</a>
198212
<hr class="lineBreak horizontalLine">
213+
199214
<h4>Session</h4>
200215
<div class="group">
201216
<button class="btn btn-info" onclick="callData()">.data()</button>
202217
<button class="btn btn-info" onclick="callLogout()">Logout</button>
203218
<button class="btn btn-info" onclick="callFirst()">.first()</button>
204219
</div>
220+
205221
<h4>Identity</h4>
206222
<div class="group">
207223
<input class="example-input" type="text" id="identityID" placeholder="[email protected]">
208224
<button id="setIdentity" class="btn btn-info" onclick="callSetIdentity()">Set Identity</button>
209225
</div>
226+
210227
<h4>Events</h4>
211228
<div class="group">
212229
<button class="btn btn-info" onclick="callLogEvent('PURCHASE')">Create Standard Event</button>
213230
<button class="btn btn-info" onclick="callLogEvent('testedCustomEvent')">Create Custom Event</button>
214231
</div>
232+
215233
<h4>Sharing</h4>
216234
<div class="group">
217235
<button class="btn btn-info" onclick="callLink()">Create Link</button>
218236
<button class="btn btn-info" onclick="callQrCode()">Create QrCode</button>
219237
<button class="btn btn-info" onclick="callBanner()">.banner()</button>
220238
</div>
239+
221240
<h4>Tracking</h4>
222241
<div class="group">
223242
<button class="btn btn-info" onclick="callDisableTracking()">Disable Tracking</button>
224243
<button class="btn btn-info" onclick="callEnableTracking()">Enable Tracking</button>
225244
</div>
226-
</div>
227-
<div class="row col-lg-8 col-lg-offset-2">
228245
<h3>Api Settings</h3>
229246
<hr class="lineBreak horizontalLine">
230247
<div class="group" id="configButtons"></div>
@@ -241,27 +258,31 @@ <h3>Api Settings</h3>
241258
</div>
242259
</section>
243260
</div>
261+
244262
<div class="lineBreak verticalLine"></div>
245-
<div class="container">
263+
264+
<div class="container api-info">
246265
<section>
247-
<div class="row col-lg-8 col-lg-offset-2">
266+
<div class="row">
248267
<h3>Api Requests</h3>
249268
<hr class="lineBreak horizontalLine">
269+
250270
<h4>Session Info
251271
<button class="btn btn-info" onclick="copySessionInfo()" style="margin-left: 10px; font-size: 12px; padding: 2px 8px; cursor: pointer;">
252272
Copy
253273
</button>
254274
</h4>
255275
<pre id="session-info">Reading session from .init()...</pre>
276+
256277
<h4>Request</h4>
257278
<pre id="request">Click a button!</pre>
279+
258280
<h4>Response</h4>
259281
<pre id="response">Click a button!</pre>
260282
</div>
261283
</section>
262284
</div>
263285
</div>
264-
265286
</div>
266287
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
267288
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

0 commit comments

Comments
 (0)