Skip to content

Commit 8f14594

Browse files
committed
Fonts and DoF display alignment
1 parent abe318c commit 8f14594

File tree

9 files changed

+33
-16
lines changed

9 files changed

+33
-16
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ <h3 data-lens-id="{{index}}" class="name" contenteditable>{{name}}</h3>
117117
<div class="small-12 table-2 columns">
118118
<dl class="dl-horizontal outputs collapsed">
119119
<dt class="dof-display hide-for-table"><span>Depth of Field</span></dt>
120-
<dd class="dof-display"><span class="dof"></span> <button class="tiny radius secondary output-toggle"><span>&#9650;</span><span>&#9660;</span></button></dd>
120+
<dd class="dof-display"><pre class="dof"></pre> <button class="tiny radius secondary output-toggle"><span>&#9650;</span><span>&#9660;</span></button></dd>
121121
</dl>
122122
</div>
123123
<div class="small-12 table-2 columns action-buttons">

js/dfc/app.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ var DFC = (function _DFC() {
455455
* @param {jQuery} $container Container jQuery element
456456
*/
457457
function _updateOuput(id, $container) {
458-
var lens, result;
458+
var lens, result, dof;
459459

460460
// Triggered by an event
461461
if (typeof id === 'object' && id.target) {
@@ -471,8 +471,14 @@ var DFC = (function _DFC() {
471471

472472
result = new DFC.Dof(lens.sensor, lens.focalLength, lens.aperture, distance);
473473

474+
// Add a space before single digit numbers to make them align vertically
475+
dof = result.dof
476+
.toString()
477+
.replace(/^(\d)\'/, ' $1\'')
478+
.replace(/\s(\d)\./, ' $1.');
479+
474480
// Display values
475-
$container.find('.dof').text(result.dof);
481+
$container.find('.dof').text(dof);
476482
$container.find('.eighthDof').text(result.eighthDof);
477483
$container.find('.coc').text(result.coc + ' mm');
478484
$container.find('.hf').text(result.hf);

js/script.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/script.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scss/dfc/_global.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
html, body, input, select, button {
2-
font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
2+
font-family: "Open Sans", FreeSans, Helmet, "Helvetica Neue", Roboto, sans-serif;
3+
}
4+
5+
h1,
6+
h2,
7+
[role="footer"] {
8+
font-family: "Avenir", FreeSans, Helmet, "Helvetica Neue", Roboto, sans-serif;
39
}
410

511
html, body {

scss/dfc/_input.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@
107107
.add-lens {
108108
border: 1rem dashed #ccc;
109109
background: #ddd;
110-
border-radius: 0.375rem;
111110
cursor: pointer;
112111
cursor: copy;
113112
@include transition(border-color 100ms ease-in, background 100ms ease-in);
114113

114+
@media #{$bp-table-max} {
115+
border-radius: 0.375rem;
116+
}
117+
115118
&:focus,
116119
&:hover {
117120
background: rgba(green, 0.1);

scss/dfc/_output.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
}
7979

8080
.dof {
81+
display: inline;
8182
font-family: Menlo, Consolas, monospace;
8283
color: green;
8384
}

scss/foundation/_settings.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//
1+
//
22
// FOUNDATION SETTINGS
33
//
44

@@ -37,7 +37,8 @@
3737
// We use these to control various global styles
3838
// $body-bg: #fff;
3939
// $body-font-color: #222;
40-
// $body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
40+
// $body-font-family: "Open Sans", FreeSans, Helmet, "Avenir New", "Helvetica Neue", Roboto, sans-serif;
41+
$body-font-family: "Avenir Next", FreeSans, Helmet, "Helvetica Neue", Roboto, sans-serif;
4142
// $body-font-weight: normal;
4243
// $body-font-style: normal;
4344

@@ -1083,7 +1084,7 @@
10831084
// $include-open-sans: true;
10841085

10851086
// We use these to control header font styles
1086-
// $header-font-family: join("Open Sans", $body-font-family);
1087+
$header-font-family: $body-font-family; // join("Open Sans", $body-font-family);
10871088
// $header-font-weight: 300;
10881089
// $header-font-style: normal;
10891090
// $header-font-color: #222;
@@ -1124,7 +1125,7 @@
11241125

11251126
// We use these to style <code> tags
11261127
// $code-color: darken($alert-color, 15%);
1127-
// $code-font-family: Consolas, 'Liberation Mono', Courier, monospace;
1128+
$code-font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace;
11281129
// $code-font-weight: bold;
11291130

11301131
// We use these to style anchors

scss/foundation/components/_type.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$include-html-type-classes: $include-html-classes !default;
44

55
// We use these to control header font styles
6-
$header-font-family: join("Open Sans", $body-font-family) !default;
6+
$header-font-family: $body-font-family; // join("Open Sans", $body-font-family) !default;
77
$header-font-weight: 300 !default;
88
$header-font-style: normal !default;
99
$header-font-color: #222 !default;
@@ -44,7 +44,7 @@ $paragraph-text-rendering: optimizeLegibility !default;
4444

4545
// We use these to style <code> tags
4646
$code-color: darken($alert-color, 15%) !default;
47-
$code-font-family: Consolas, 'Liberation Mono', Courier, monospace !default;
47+
$code-font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace !default;
4848
$code-font-weight: bold !default;
4949

5050
// We use these to style anchors
@@ -250,8 +250,8 @@ $microformat-abbr-font-decoration: none !default;
250250

251251
ul {
252252
margin-#{$default-float}: $list-side-margin;
253-
&.no-bullet {
254-
margin-#{$default-float}: $list-side-margin-no-bullet;
253+
&.no-bullet {
254+
margin-#{$default-float}: $list-side-margin-no-bullet;
255255
li {
256256
ul,
257257
ol {
@@ -444,4 +444,4 @@ $microformat-abbr-font-decoration: none !default;
444444
}
445445

446446
}
447-
}
447+
}

0 commit comments

Comments
 (0)