Skip to content

Commit e1621bb

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 e1621bb

File tree

1 file changed

+42
-21
lines changed

1 file changed

+42
-21
lines changed

examples/example.template.html

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,24 @@
2020

2121
.verticalLine {
2222
width: 0.5px;
23+
background-color: lightgray;
2324
}
2425

25-
body {
26-
font-family: Arial, sans-serif;
27-
background-color: #f4f4f9;
28-
color: #333;
26+
.split-container {
27+
display: flex;
28+
align-items: stretch;
29+
justify-content: center;
30+
width: 90%;
31+
margin: auto;
2932
}
3033

31-
label {
32-
display: block;
33-
font-size: 14px;
34-
margin-bottom: 6px;
35-
font-weight: bold;
34+
.container {
35+
width: 45%;
36+
margin: 10px;
37+
padding: 15px;
38+
background: #fff;
39+
border-radius: 5px;
40+
box-sizing: border-box;
3641
}
3742

3843
.apiInput {
@@ -52,8 +57,27 @@
5257
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
5358
}
5459

55-
.row {
56-
margin-bottom: 30px;
60+
@media (max-width: 768px) {
61+
.split-container {
62+
flex-direction: column;
63+
}
64+
65+
.container {
66+
width: 100%;
67+
margin: 10px 0;
68+
}
69+
70+
.verticalLine {
71+
display: none;
72+
}
73+
74+
.api-info {
75+
order: -1;
76+
}
77+
78+
.api-methods {
79+
order: 1;
80+
}
5781
}
5882

5983
#configButtons {
@@ -189,13 +213,14 @@
189213
<div style="display: flex; flex-direction: column; align-items: center; width: 100%">
190214
<h2>Branch Metrics Web SDK Example</h2>
191215
<hr class="lineBreak horizontalLine">
192-
<div style="display: flex; align-items: stretch; justify-content: center; width: 90%;">
193-
<div class="container">
216+
<div class="split-container">
217+
<div class="container api-methods">
194218
<section>
195-
<div class="row col-lg-8 col-lg-offset-2">
219+
<div class="row">
196220
<h3>Methods</h3>
197-
<a>https://help.branch.io/developers-hub/docs/web-full-reference</a>
221+
<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>
198222
<hr class="lineBreak horizontalLine">
223+
199224
<h4>Session</h4>
200225
<div class="group">
201226
<button class="btn btn-info" onclick="callData()">.data()</button>
@@ -223,12 +248,9 @@ <h4>Tracking</h4>
223248
<button class="btn btn-info" onclick="callDisableTracking()">Disable Tracking</button>
224249
<button class="btn btn-info" onclick="callEnableTracking()">Enable Tracking</button>
225250
</div>
226-
</div>
227-
<div class="row col-lg-8 col-lg-offset-2">
228251
<h3>Api Settings</h3>
229252
<hr class="lineBreak horizontalLine">
230253
<div class="group" id="configButtons"></div>
231-
232254
<label id="branchKeyLabel" for="branchKeyInput">Branch Key:</label>
233255
<input type="text" id="branchKeyInput" class="apiInput">
234256
<br>
@@ -242,9 +264,9 @@ <h3>Api Settings</h3>
242264
</section>
243265
</div>
244266
<div class="lineBreak verticalLine"></div>
245-
<div class="container">
267+
<div class="container api-info">
246268
<section>
247-
<div class="row col-lg-8 col-lg-offset-2">
269+
<div class="row">
248270
<h3>Api Requests</h3>
249271
<hr class="lineBreak horizontalLine">
250272
<h4>Session Info
@@ -261,7 +283,6 @@ <h4>Response</h4>
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)