Skip to content

Commit 449b07e

Browse files
rsantanalumisrsantanatech
authored andcommitted
Improve responsive design
1 parent f929861 commit 449b07e

File tree

5 files changed

+73
-15
lines changed

5 files changed

+73
-15
lines changed

css/1140.css

+4-6
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,11 @@ img {
9191
/* Smaller screens */
9292

9393
@media only screen and (max-width: 1023px) {
94-
9594
body {
96-
font-size: 0.8em;
97-
line-height: 1.5em;
98-
}
99-
100-
}
95+
/* font-size: 0.8em; */
96+
line-height: 1.5em;
97+
}
98+
}
10199

102100

103101
/* Mobile */

css/explaingit.css

+63-5
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ span.cmd {
108108

109109
#ExplainGitZen-Container .playground-container {
110110
position: absolute;
111-
top: 0;
112-
bottom: 20px;
113-
right: 20px;
114-
left: 20px;
111+
top: 10px;
112+
bottom: 30px;
113+
right: 30px;
114+
left: 30px;
115115
}
116116

117117
.remote-name-display {
@@ -168,7 +168,7 @@ span.cmd {
168168
padding-left: 15px;
169169
color: #FFF;
170170
line-height: 14px;
171-
background: url(../images/prompt.gif) no-repeat left top black;
171+
background: url(../images/prompt.gif) no-repeat left center black;
172172
}
173173

174174
.control-box input[type="text"] {
@@ -322,3 +322,61 @@ g.head-tag > text {
322322
font-weight: bold;
323323
text-transform: uppercase;
324324
}
325+
326+
/* Mobile/portrait view */
327+
@media screen and (max-width: 767px), (max-device-width: 1920px) and (orientation: portrait) {
328+
.playground-container {
329+
display: flex;
330+
flex-flow: column;
331+
}
332+
333+
.control-box {
334+
position: relative;
335+
width: 100%;
336+
flex: 1 1 33%;
337+
order: 1;
338+
display: flex;
339+
flex-flow: column;
340+
overflow: hidden;
341+
}
342+
343+
.control-box input {
344+
width: calc(100% - 15px) !important;
345+
font-size: 16px !important;
346+
position: relative !important;
347+
}
348+
349+
.control-box .log {
350+
position: relative;
351+
order: 2;
352+
height: 100%;
353+
top: 0;
354+
bottom: 0;
355+
}
356+
357+
.scenario-chooser {
358+
position: relative !important;
359+
left: 0 !important;
360+
top: 0 !important;
361+
}
362+
363+
.svg-container {
364+
position: relative !important;
365+
width: 100%;
366+
flex: 1 1 33%;
367+
left: 0 !important;
368+
min-height: auto !important;
369+
}
370+
}
371+
372+
@media screen and (min-width: 540px) and (max-device-width: 1920px) and (orientation: portrait) {
373+
body, .control-box .log, .control-box .log div {
374+
font-size: 24px !important;
375+
line-height: 2em !important;
376+
}
377+
378+
.control-box input {
379+
font-weight: bold;
380+
font-size: 35px !important;
381+
}
382+
}

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
</script>
1313

1414
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
15+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
1516
<title>Visualizing Git</title>
1617
<script src="js/vendor/jquery.js"></script>
1718
<script src="js/vendor/jquery-ui.min.js"></script>

js/controlbox.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,14 @@ function(_yargs, d3, demos) {
372372
boolean: ['amend'],
373373
string: ['m']
374374
})
375-
var msg = ""
376375
this.transact(function() {
377376
if (opts.amend) {
378377
this.getRepoView().amendCommit(opts.m || this.getRepoView().getCommit('head').message)
379378
} else {
380379
this.getRepoView().commit(null, opts.m);
381380
}
382381
}, function(before, after) {
383-
var reflogMsg = 'commit: ' + msg
382+
var reflogMsg = 'commit: ' + (after.commit.message ?? '');
384383
this.getRepoView().addReflogEntry(
385384
'HEAD', after.commit.id, reflogMsg
386385
)

js/historyview.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ define(['d3'], function() {
258258
this.currentBranch = config.currentBranch || 'master';
259259

260260
this.width = config.width;
261-
this.height = config.height || 400;
261+
this.height = 400;
262262
this.orginalBaseLine = config.baseLine;
263263
this.baseLine = this.height * (config.baseLine || 0.9);
264264

@@ -528,7 +528,7 @@ define(['d3'], function() {
528528

529529
svg.attr('id', this.name)
530530
.attr('width', this.width)
531-
.attr('height', this.isRemote ? this.height + 150 : this.height);
531+
.attr('height', this.height + 150);
532532

533533
if (this.isRemote) {
534534
svg.append('svg:text')
@@ -603,12 +603,14 @@ define(['d3'], function() {
603603
var perc = this.height.substring(0, this.height.length - 1) / 100.0;
604604
var baseLineCalcHeight = Math.round(this.svg.node().parentNode.offsetHeight * perc) - 65;
605605
var newBaseLine = Math.round(baseLineCalcHeight * (this.originalBaseLine || 0.6));
606+
606607
if (newBaseLine !== this.baseLine) {
607608
this.baseLine = newBaseLine;
608609
this.initialCommit.cy = newBaseLine;
609610
this.svg.attr('height', baseLineCalcHeight);
610611
}
611612
}
613+
612614
this._calculatePositionData();
613615
this._calculatePositionData(); // do this twice to make sure
614616
this._renderCircles();

0 commit comments

Comments
 (0)