Skip to content

Commit

Permalink
UI texts adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmas committed Sep 26, 2023
1 parent 46052d0 commit bd3c1e6
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 28 deletions.
Binary file removed images/dot-blue.png
Binary file not shown.
Binary file removed images/dot-grey.png
Binary file not shown.
Binary file removed images/dot-red.png
Binary file not shown.
Binary file removed images/mercator-tex.jpg
Binary file not shown.
Binary file removed images/nightearth-4096.png
Binary file not shown.
17 changes: 12 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
<img class="dot" src="images/dot-grey.png"></img>
Debris
</li>
<li class="clickable unassigned">
<img class="dot" src="images/dot-yellow.png"></img>
Unassigned
</li>
</ul>
<ul id="controls-info">
<li>
Expand All @@ -80,11 +84,14 @@
to calculate satellite positions.</p>

<span class="box-header">About the author</span>
<p>My name is James Yoder; I'm an alumnus of <a href="http://www.usfirst.org/roboticsprograms/frc"><i>FIRST</i> Robotics
Competition </a> (FRC) <a href="http://team624.org">Team 624</a> and an incoming Electrical and Computer Engineering freshman at the
University of Texas at Austin. </p>
<p>Contact: <a href="mailto:[email protected]">[email protected]</a></p>
<p>See Stuff in Space on <a href="https://github.com/jeyoder/ThingsInSpace"> GitHub </a></p>
<p>This is was originally developped, in 2015, by James Yoder, an alumnus of <a href="http://www.usfirst.org/roboticsprograms/frc"><i>FIRST</i> Robotics
Competition </a> (FRC) <a href="http://team624.org">Team 624</a> and a graduate of the University of Texas at Austin.</p>
<p>The project has since been taken up by the community to further its development and keep it relevant.</p>
<span class="box-header">Source Code and Issue Reporting</span>
<p>This current fork is available on <a href="https://github.com/ajmas/StuffInSpace">GitHub</a>,
with James Yoder's upstream repository also being available on
<a href="https://github.com/jeyoder/StuffInSpace">GitHub</a>.
</p>


</div>
Expand Down
Binary file added public/images/dot-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions public/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,18 @@ ul {
#about-box {
right: 10px;
width: 500px;
height: 335px;
height: 435px;
}

#help-box {
right: 70px;
width: 200px;
height: 225px;
height: 250px;
}

#help-box .dot {
filter: brightness(1.5);
-webkit-filter: brightness(1.5);
}

.box-header {
Expand All @@ -347,7 +352,7 @@ ul {
height: 25px;
line-height: 25px;
margin-top: 5px;
magin-bottom: 5px;
margin-bottom: 5px;
}

.dot {
Expand Down
3 changes: 2 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const baseUrl = import.meta.env.BASE_URL;
const constants = {
baseUrl
baseUrl,
propergateInterval: 500 // milliseconds
};

export default constants;
40 changes: 34 additions & 6 deletions src/logger.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
/* eslint-disable no-console */
function log (level, output, ...args) {
output(level, ...args);

const logLevels = ['error', 'warn', 'info', 'debug'];
const enabledOutputs = {};
let allOutputs = {};

function log (scope, level, output, ...args) {
if (scope.enabledOutputs[level]) {
output(level.toUpperCase(), ...args);
}
}

function setLogLevel (level) {
const levelIdx = logLevels.indexOf(level.toLowerCase());
for (let i = 0; i < logLevels.length; i++) {
enabledOutputs[logLevels[i]] = i <= levelIdx;
}
}

function getLogger () {
return {
error: log.bind(this, 'ERROR', console.error),
warn: log.bind(this, 'WARN', console.warn),
info: log.bind(this, 'INFO', console.info),
debug: log.bind(this, 'DEBUG', console.debug)
...allOutputs,
setLogLevel
};
}

function init () {
allOutputs = {
error: log.bind(this, { enabledOutputs }, 'error', console.error),
warn: log.bind(this, { enabledOutputs }, 'warn', console.warn),
info: log.bind(this, { enabledOutputs }, 'info', console.info),
debug: log.bind(this, { enabledOutputs }, 'debug', console.debug)
};

for (let i = 0; i < logLevels.length; i++) {
enabledOutputs[logLevels[i]] = true;
}
}

init();
setLogLevel('debug');

export default getLogger();
1 change: 0 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,6 @@ function initListeners () {
});

menuItem.addEventListener('mouseout', (event) => {
logger.debug('.menu-item', 'mouseout', event);
const target = event.currentTarget;
const subMenu = target.querySelector('.submenu');
if (subMenu) {
Expand Down
2 changes: 0 additions & 2 deletions src/orbit-calculation-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ onmessage = function (message) {
const pointsOut = new Float32Array((numSegs + 1) * 3);

if (!satCache || !satCache[satId]) {
// logger.debug('satCache', satCache);
logger.debug('satCache', satId, satCache[satId]);
return;
}

Expand Down
5 changes: 2 additions & 3 deletions src/sat-cruncher-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ import {
jday, twoline2satrec, eciToGeodetic, gstime, sgp4
} from 'satellite.js';
import logger from './logger';
import constants from './constants';

const satCache = [];
const propergateInterval = 20000; // 500;
const propergateInterval = constants.propergateInterval;
const oneOnce = true;
let satPos;
let satVel;
let satAlt;

function propagate () {
logger.debug('Propagate');

const now = new Date();
let j = jday(
now.getUTCFullYear(),
Expand Down
3 changes: 3 additions & 0 deletions src/sat-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ const groupConfigs = [
},
{
id: 'Starlink', name: 'Starlink', groupType: 'nameRegex', data: /STARLINK/
},
{
id: 'Unknown', name: 'Unknown', groupType: 'objectType', data: 'UNKNOWN'
}
];

Expand Down
6 changes: 3 additions & 3 deletions src/sat.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SatSet {
this.satCruncher = undefined;

try {
logger.debug('Registering /sat-cruncher.js');
logger.info('Kicking off sat-cruncher-worker');
this.satCruncher = SatCruncherWorker();
} catch (_error) {
logger.error('unsupported browser');
Expand All @@ -43,10 +43,10 @@ class SatSet {
this.gotExtraData = false;

// eslint-disable-next-line func-names, space-before-function-paren
this.satCruncher.onmessage = this.handleMessage.bind(this);
this.satCruncher.onmessage = this.onMessage.bind(this);
}

async handleMessage (message) {
async onMessage (message) {
const scope = this;
try {
if (!this.gotExtraData) { // store extra data that comes from crunching
Expand Down
4 changes: 0 additions & 4 deletions src/search-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ function clearHover () {
hovering = false;
hoverSatId = -1;

// TODO move to main
// orbitDisplay.setHoverOrbit(hoverSatId);
// app.satSet.setHover(hoverSatId);

app.setHover(hoverSatId);
}

Expand Down

0 comments on commit bd3c1e6

Please sign in to comment.