Skip to content

Commit a5648e9

Browse files
committed
Add version number to settings dialog.
1 parent 6e47f5b commit a5648e9

5 files changed

Lines changed: 24 additions & 9 deletions

File tree

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aw-clock",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"license": "MIT",
55
"author": "Kerry Shetline <kerry@shetline.com>",
66
"scripts": {

src/clock.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { isIE, isRaspbian, padLeft } from 'ks-util';
2424
import { AppService } from './app.service';
2525
import * as $ from 'jquery';
2626

27-
const SVC_NAMESPACE = 'http://www.w3.org/2000/svg';
27+
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
2828

2929
const SECOND_HAND_ANIMATION_TIME = 200;
3030

@@ -131,7 +131,7 @@ export class Clock {
131131
for (let i = 0; i < 360; i += 6) {
132132
const x1 = center + radius * Math.cos(Math.PI * i / 180);
133133
const y1 = center + radius * Math.sin(Math.PI * i / 180);
134-
const tickMark = document.createElementNS(SVC_NAMESPACE, 'circle');
134+
const tickMark = document.createElementNS(SVG_NAMESPACE, 'circle');
135135

136136
tickMark.setAttributeNS(null, 'cx', x1.toString());
137137
tickMark.setAttributeNS(null, 'cy', y1.toString());
@@ -144,7 +144,7 @@ export class Clock {
144144
const h = (i === 270 ? 12 : ((i + 90) % 360) / 30);
145145
const x2 = center + textRadius * Math.cos(Math.PI * i / 180);
146146
const y2 = center + textRadius * Math.sin(Math.PI * i / 180);
147-
const text2 = document.createElementNS(SVC_NAMESPACE, 'text');
147+
const text2 = document.createElementNS(SVG_NAMESPACE, 'text');
148148

149149
text2.setAttributeNS(null, 'x', x2.toString());
150150
text2.setAttributeNS(null, 'y', y2.toString());
@@ -155,7 +155,7 @@ export class Clock {
155155

156156
const x3 = center + constellationRadius * Math.cos(Math.PI * (-i - 15) / 180);
157157
const y3 = center + constellationRadius * Math.sin(Math.PI * (-i - 15) / 180);
158-
const text3 = document.createElementNS(SVC_NAMESPACE, 'text');
158+
const text3 = document.createElementNS(SVG_NAMESPACE, 'text');
159159

160160
text3.setAttributeNS(null, 'x', x3.toString());
161161
text3.setAttributeNS(null, 'y', y3.toString());
@@ -171,8 +171,8 @@ export class Clock {
171171
planetSymbols.forEach((planet, index) => {
172172
const x = center + 10 + index * 2;
173173
const dy = 0.75 + (index % 2) * 2;
174-
const rect = document.createElementNS(SVC_NAMESPACE, 'rect');
175-
const text = document.createElementNS(SVC_NAMESPACE, 'text');
174+
const rect = document.createElementNS(SVG_NAMESPACE, 'rect');
175+
const text = document.createElementNS(SVG_NAMESPACE, 'text');
176176

177177
rect.setAttributeNS(null, 'x', (x - 0.9).toString());
178178
rect.setAttributeNS(null, 'y', (center + dy - 2).toString());

src/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@
193193
</div>
194194
</div>
195195
<div class="dialog-buttons">
196-
<button id="settings-reload">Reload</button> &bull;
196+
<span class="version-number">1.0.5</span>
197+
<button id="settings-reload">Reload</button>
198+
<span>&bull;</span>
197199
<button id="settings-cancel">Cancel</button>
198200
<button id="settings-ok">OK</button>
199201
</div>

src/styles.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,23 @@ body {
174174
position: absolute;
175175
bottom: 1em;
176176
right: 1em;
177+
left: 1em;
178+
display: flex;
179+
align-items: center;
177180

178181
& button {
179182
min-width: 80px; // Ignored by macOS Chrome
180183
}
184+
185+
& button:not(:first-child), span:not(:first-child) {
186+
margin-left: 0.5em;
187+
}
188+
}
189+
190+
.version-number {
191+
flex-grow: 1;
192+
color: #CCC;
193+
font-size: smaller;
181194
}
182195

183196
.alert-buttons {

0 commit comments

Comments
 (0)