Skip to content

Commit

Permalink
Add 1.1.2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pcprince committed Nov 13, 2023
1 parent d1f81ce commit f6858ed
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 82 deletions.
4 changes: 3 additions & 1 deletion about.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

<head>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="./index.css">
<link id="uiCSS" rel="stylesheet" href="./ui.css">
<title>About AudioMoth Time App</title>
</head>

<body style="text-align: center; -webkit-user-select: none; -webkit-app-region: drag;">
Expand All @@ -27,7 +29,7 @@
</div>
<div class="row">
<div class="col-lg-12">
<a href id="website-link">www.openacousticdevices.info</a>
<a href id="website-link" style="text-decoration: none;">www.openacousticdevices.info</a>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion about.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
const electron = require('electron');
const {app, process} = require('@electron/remote');
const audiomoth = require('audiomoth-hid');

const nightMode = require('./nightMode.js');

const versionDisplay = document.getElementById('version-display');
const electronVersionDisplay = document.getElementById('electron-version-display');
const audiomothHidVersionDisplay = document.getElementById('audiomoth-hid-version-display');
const websiteLink = document.getElementById('website-link');
const audiomothHidVersionDisplay = document.getElementById('audiomoth-hid-version-display');

versionDisplay.textContent = 'Version ' + app.getVersion();
electronVersionDisplay.textContent = 'Running on Electron version ' + process.versions.electron;
Expand Down
54 changes: 29 additions & 25 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,34 +43,32 @@ let currentTime, deviceId, firmwareVersion, firmwareDescription;

function initialiseDisplay () {

timeDisplay.textContent = '00:00:00 01/01/1970 UTC';
timeDisplay.textContent = '--:--:-- --/--/---- UTC';

}

function disableDisplay () {

timeDisplay.style.color = 'lightgrey';
timeDisplay.classList.add('grey');

idDisplay.style.color = 'lightgrey';
idDisplay.classList.add('grey');

idLabel.style.color = 'lightgrey';
idLabel.classList.add('grey');

firmwareVersionDisplay.style.color = 'lightgrey';
firmwareVersionDisplay.classList.add('grey');

firmwareVersionLabel.style.color = 'lightgrey';
firmwareVersionLabel.classList.add('grey');

firmwareDescriptionDisplay.style.color = 'lightgrey';
firmwareDescriptionDisplay.classList.add('grey');

firmwareDescriptionLabel.style.color = 'lightgrey';
firmwareDescriptionLabel.classList.add('grey');

batteryDisplay.style.color = 'lightgrey';
batteryDisplay.classList.add('grey');

batteryLabel.style.color = 'lightgrey';
batteryLabel.classList.add('grey');

setTimeButton.disabled = true;

applicationMenu.getMenuItemById('copyid').enabled = false;

}

function enableDisplayAndShowTime (date) {
Expand All @@ -85,7 +83,7 @@ function enableDisplayAndShowTime (date) {

timeDisplay.textContent = strftimeUTC('%H:%M:%S %d/%m/%Y UTC', date);

timeDisplay.style.color = '';
timeDisplay.classList.remove('grey');

setTimeButton.disabled = false;

Expand All @@ -99,39 +97,39 @@ function enableDisplayAndShowBatteryState (batteryState) {

batteryDisplay.textContent = batteryState;

batteryDisplay.style.color = '';
batteryDisplay.classList.remove('grey');

batteryLabel.style.color = '';
batteryLabel.classList.remove('grey');

}

function enableDisplayAndShowID (id) {

idDisplay.textContent = id;

idDisplay.style.color = '';
idDisplay.classList.remove('grey');

idLabel.style.color = '';
idLabel.classList.remove('grey');

}

function enableDisplayAndShowVersionNumber (version) {

firmwareVersionDisplay.textContent = version;

firmwareVersionDisplay.style.color = '';
firmwareVersionDisplay.classList.remove('grey');

firmwareVersionLabel.style.color = '';
firmwareVersionLabel.classList.remove('grey');

}

function enableDisplayAndShowVersionDescription (description) {

firmwareDescriptionDisplay.textContent = description;

firmwareDescriptionDisplay.style.color = '';
firmwareDescriptionDisplay.classList.remove('grey');

firmwareDescriptionLabel.style.color = '';
firmwareDescriptionLabel.classList.remove('grey');

}

Expand Down Expand Up @@ -311,16 +309,16 @@ function setTime (time) {

}

electron.ipcRenderer.on('copyID', function () {
electron.ipcRenderer.on('copyID', () => {

clipboard.writeText(idDisplay.textContent);
idDisplay.style.color = 'green';

setTimeout(function () {
setTimeout(() => {

idDisplay.style.color = '';

}, 5000);
}, 2000);

});

Expand Down Expand Up @@ -381,7 +379,7 @@ setTimeButton.addEventListener('click', function () {

communicating = true;

timeDisplay.style.color = 'lightgrey';
timeDisplay.classList.add('grey');

const USB_LAG = 20;

Expand Down Expand Up @@ -452,4 +450,10 @@ electron.ipcRenderer.on('night-mode', (e, nm) => {

});

electron.ipcRenderer.on('poll-night-mode', () => {

electron.ipcRenderer.send('night-mode-poll-reply', nightMode.isEnabled());

});

requestTime();
26 changes: 25 additions & 1 deletion index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@font-face {
font-family: 'Ubuntu';
src: url('./ubuntu.mono.ttf');
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
Expand All @@ -12,5 +17,24 @@ input[type=number]::-webkit-outer-spin-button {
}

.mono-text {
font-variant-numeric: tabular-nums;
font-family: 'Ubuntu';
font-size: 27px;
}

.grey {
color: #D3D3D3;
}

.groupBorder {
border: #cdcdcd thin solid;
padding: 5px;
}

.leftElement {
margin-left: 16px;
}

.rightElement {
margin-right: 16px;
text-align: right;
}
94 changes: 54 additions & 40 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,80 @@

<head>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="index.css">
<link id="uiCSS" rel="stylesheet" href="ui.css">
</head>

<body style="font-size: 10pt; overflow-x:hidden; font-family: Helvetica, Arial, sans-serif; -webkit-user-select: none; -webkit-app-region: drag;">
<div class="container" style="padding: 8px;">
<body style="font-size: 10pt; overflow:hidden; font-family: Helvetica, Arial, sans-serif; -webkit-user-select: none; -webkit-app-region: drag;">

<div class="container">

<div class="row">
<div style="border: #cdcdcd thin solid; margin-left: 15px; width: 543px;">
<div class="row" style="margin-left: 0px;">
<div class="col-12" style="text-align: center; padding-top: 5px; padding-bottom: 5px">
<span class="mono-text" style="font-size: 25px; font-family: &apos;Lucida Console&apos;, Monaco">
<div id="time-display" style="display: inline-block; color: lightgray;"></div>
</span>
</div>
<div class="col-12" style="text-align: center; padding: 8px;">
<div class="groupBorder">
<span>
<div class="mono-text" id="time-display" class="grey">--:--:-- --/--/---- UTC</div>
</span>
</div>
</div>
</div>

<div class="row" style="margin-top: 8px;">
<div style="border: #cdcdcd thin solid; margin-left: 15px; width: 543px;">
<div class="row" style="margin-top: 5px;">
<div class="col-6" style="text-align: left;">
<span id="id-label" style="margin-left: 20px; color: lightgray;">Device ID:</span>
</div>
<div class="col-6" style="text-align: right;">
<span id="id-display" style="margin-right: 20px; border: none; text-align: right; color: lightgray;">-</span>
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-6" style="text-align: left;">
<span id="firmware-description-label" style="margin-left: 20px; color: lightgray;">Firmware description:</span>
</div>
<div class="col-6" style="text-align: right;">
<span id="firmware-description-display" style="margin-right: 20px; color: lightgray;">-</span>
</div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-6" style="text-align: left;">
<span id="firmware-version-label" style="margin-left: 20px; color: lightgray;">Firmware version:</span>
<div class="row">

<div class="col-12" style="padding: 8px; padding-top: 0px;">

<div class="groupBorder">

<div class="row" style="margin-bottom: 3px;">
<div class="col-6" style="text-align: left;">
<span id="id-label" class="grey leftElement">Device ID:</span>
</div>
<div class="col-6" style="text-align: right;">
<span id="id-display" style="border: none;" class="grey rightElement">-</span>
</div>
</div>
<div class="col-6" style="text-align: right;">
<span id="firmware-version-display" style="margin-right: 20px; color: lightgray;">-</span>

<div class="row" style="margin-bottom: 3px;">
<div class="col-6" style="text-align: left;">
<span id="firmware-description-label" class="grey leftElement">Firmware description:</span>
</div>
<div class="col-6" style="text-align: right;">
<span id="firmware-description-display" style="border: none;" class="grey rightElement">-</span>
</div>
</div>
</div>
<div class="row" style="margin-top: 5px; margin-bottom: 5px;">
<div class="col-6" style="text-align: left;">
<span id="battery-label" style="margin-left: 20px; color: lightgray;">Battery:</span>

<div class="row" style="margin-bottom: 3px;">
<div class="col-6" style="text-align: left;">
<span id="firmware-version-label" class="grey leftElement">Firmware version:</span>
</div>
<div class="col-6" style="text-align: right;">
<span id="firmware-version-display" style="border: none;" class="grey rightElement">-</span>
</div>
</div>
<div class="col-6" style="text-align: right;">
<span id="battery-display" style="margin-right: 20px; color: lightgray;">-</span>

<div class="row">
<div class="col-6" style="text-align: left;">
<span id="battery-label" class="grey leftElement">Battery:</span>
</div>
<div class="col-6" style="text-align: right;">
<span id="battery-display" style="border: none;" class="grey rightElement">-</span>
</div>
</div>

</div>

</div>

</div>
<div class="row" style="margin-top: 8px;">
<div style="text-align: center; margin-left: 15px; width: 543px; padding: 0px;">

<div class="row">
<div style="text-align: center; padding: 8px; padding-top: 0px;">
<button id="set-time-button" class="btn btn-success" style="width: 100%;" disabled>Set Time</button>
</div>
</div>

</div>

</body>

<script src="app.js" charset="utf-8"></script>
Expand Down
Loading

0 comments on commit f6858ed

Please sign in to comment.