Skip to content

Commit 8682603

Browse files
authored
Merge pull request #3 from johnclary/dev
major mono move logger
2 parents 4271aa7 + d8d3382 commit 8682603

9 files changed

+88
-58
lines changed

public/index.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
work correctly both with client-side routing and a non-root public URL.
2525
Learn how to configure a non-root public URL by running `npm run build`.
2626
-->
27-
<link href="https://fonts.googleapis.com/css?family=Electrolize|Jura&display=swap" rel="stylesheet">
28-
<!-- <link href="https://fonts.googleapis.com/css2?family=Jura:wght@700&display=swap" rel="stylesheet"> -->
27+
<!-- <link href="https://fonts.googleapis.com/css?family=Electrolize|Jura&display=swap" rel="stylesheet"> -->
28+
<!-- <link href="https://fonts.googleapis.com/css2?family=Jura:wght@700&display=swap" rel="stylesheet"> -->
29+
<link href="https://fonts.googleapis.com/css2?family=Major+Mono+Display&display=swap" rel="stylesheet">
30+
2931
<title>React App</title>
3032
</head>
3133
<body>

src/components/cassette.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class Cassette extends Component {
168168
.attr("font-size", 7)
169169
.attr("font-weight", "bold")
170170
.attr("fill", "#000")
171-
.text("HELLO");
171+
.text("hello");
172172

173173
return component.setState(
174174
{

src/components/logger.jsx

+60-38
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ class Logger extends Component {
88
this.state = {};
99
this.myRef = React.createRef();
1010
this.state.animate = false;
11-
this.state.maxHeight = 250;
12-
this.state.fontSize = 19;
11+
this.state.maxHeight = 24;
12+
this.state.fontSize = 24;
1313
this.state.fillStyle = "green";
1414
this.state.maxUpdateTime = 5000; // max milliseconds before new log is printed
1515
this.state.minUpdateTime = 750; // max milliseconds before new log is printed
1616
this.state.strokeGreen = "#5eff89";
1717
this.state.strokeRed = "#eb4034";
18-
this.state.strokeBlue = "#7773ff";
18+
this.state.strokeBlue = "#40b3ff";
1919
}
2020

2121
componentDidMount() {
@@ -84,32 +84,48 @@ class Logger extends Component {
8484

8585
getLog() {
8686
const metrics = [
87-
"oxygen regenerators: ",
88-
"protease inhibitors: ",
89-
"fuel convolvers: ",
90-
"aft ion refractors: ",
91-
"double-angel + vape ",
92-
"double-angel + vape ",
93-
"double-angel + vape ",
94-
"double-angel + vape ",
95-
"double-angel + vape ",
96-
"forward ion refractors: ",
97-
"aft solar shields: ",
98-
"forward solar shields: ",
99-
"dioxide sifters: ",
100-
"orthagonic trim: ",
101-
"thermite spectrometer: ",
102-
"solenoid decouplers: ",
103-
"diazapam conflators: ",
104-
"thulium reconstitutor: ",
105-
"hyper array trajectory: ",
106-
"gallium thruster: ",
107-
"load re-balancers: ",
108-
"hyperclonic deflectors: ",
109-
"copernicium inductor: ",
110-
"radon inductors: ",
111-
"astatine fabrictors: ",
112-
"sim-grav rotators: ",
87+
" | oxygen regenerators | ",
88+
" | protease inhibitors | ",
89+
" | fuel convolvers | ",
90+
" | aft ion refractors | ",
91+
" | forward ion refractors | ",
92+
" | aft solar shields | ",
93+
" | forward solar shields | ",
94+
" | dioxide sifters | ",
95+
" | orthagonic trim | ",
96+
" | thermite spectrometer | ",
97+
" | solenoid decouplers | ",
98+
" | diazapam conflators | ",
99+
" | thulium reconstitutor | ",
100+
" | hyper array trajectory | ",
101+
" | gallium thruster | ",
102+
" | load re-balancers | ",
103+
" | hyperclonic deflectors | ",
104+
" | copernicium inductor | ",
105+
" | radon inductors | ",
106+
" | astatine fabrictors | ",
107+
" | sim-grav rotators | ",
108+
" | orissa horizon | ",
109+
" | telemetry phasing | ",
110+
" | tetrahedral rotation | ",
111+
" | polyhedral convexor | ",
112+
" | gyrobotics | ",
113+
" | warp invector | ",
114+
" | curvature solver | ",
115+
" | metaphase cleaving | ",
116+
" | quark drag | ",
117+
" | quantum versor | ",
118+
" | spheroid gain | ",
119+
" | photon displacer | ",
120+
" | gamma flux | ",
121+
" | copernicium ingestor | ",
122+
" | iberium mixers | ",
123+
" | polymosaic scoping | ",
124+
" | rhodium allocator | ",
125+
" | cesium flexor | ",
126+
" | semifold vaporizor |",
127+
128+
113129
];
114130

115131
const modifiers = [
@@ -125,7 +141,10 @@ class Logger extends Component {
125141
["stable", "ok"],
126142
["stable", "ok"],
127143
["stable", "ok"],
128-
["stable", "ok"],
144+
["locked", "ok"],
145+
["locked", "ok"],
146+
["override", "bad"],
147+
["auto", "ok"],
129148
["recalculating", "in_progress"],
130149
["normal", "ok"],
131150
["normal", "ok"],
@@ -140,17 +159,17 @@ class Logger extends Component {
140159
const y = Math.floor(Math.random() * modifiers.length);
141160

142161
// random hex
143-
// const code = "[" + (Math.random()*0xF<<0).toString(16) + "x" + (Math.random()*0xF<<0).toString(16).toUpperCase() + "]";
144-
const code = "";
162+
const code = (Math.random()*0xFFFF<<0).toString(16);
163+
// const code = "";
145164
let val = modifiers[y]
146165

147166
if (!val) {
148167
// show exclamation point for low vals
149168
val = Math.floor(Math.random() * 100);
150-
val = val > 20 ? [val + "%", "ok"] : [val + "%", "bad"];
169+
val = val > 35 ? [val + "%", "ok"] : [val + "%", "bad"];
151170
}
152171

153-
return [code + " " + metrics[x], val];
172+
return [ code + metrics[x], val];
154173
}
155174

156175

@@ -159,6 +178,9 @@ class Logger extends Component {
159178
const fontSize = component.state.fontSize;
160179
const canvas = d3.select(component.myRef.current);
161180
const context = canvas.node().getContext("2d");
181+
182+
context.textAlign = "right";
183+
162184
context.clearRect(0, 0, component.state.width, component.state.height);
163185

164186
const delay = 15;
@@ -172,7 +194,7 @@ class Logger extends Component {
172194
// print all but the last line all at once
173195
context.fillStyle = component.state.strokeGreen;
174196
log[0].split("").map( function(char) {
175-
context.font = fontSize + "px Jura";
197+
context.font = fontSize + "px Major Mono Display";
176198
const charWidth = context.measureText(char).width;
177199
component.writeLetter(context, char, xOffset, i * fontSize);
178200
xOffset += charWidth;
@@ -189,7 +211,7 @@ class Logger extends Component {
189211

190212
log[1][0].split("").map( function(char) {
191213
// make the status part of the line bold, too
192-
context.font = "bold " + fontSize + "px Jura";
214+
context.font = "bold " + fontSize + "px Major Mono Display";
193215
const charWidth = context.measureText(char).width;
194216
component.writeLetter(context, char, xOffset, i * fontSize);
195217
xOffset += charWidth;
@@ -203,7 +225,7 @@ class Logger extends Component {
203225

204226
log[0].split("").map( function(char) {
205227
counter++;
206-
context.font = fontSize + "px Jura";
228+
context.font = fontSize + "px Major Mono Display";
207229
const charWidth = context.measureText(char).width;
208230

209231
setTimeout(
@@ -220,7 +242,7 @@ class Logger extends Component {
220242
log[1][0].split("").map( function(char) {
221243
counter++;
222244

223-
context.font = "bold " + fontSize + "px Jura";
245+
context.font = "bold " + fontSize + "px Major Mono Display";
224246

225247
const charWidth = context.measureText(char).width;
226248

src/components/meterHoriz.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class MeterHoriz extends Component {
169169

170170
return (
171171
<React.Fragment>
172-
<h6 className="instrHeader">{this.props.label}: <span className={this.blinkText()} > {(Math.floor(this.state.currentVal * 100) + "%")}</span></h6>
172+
<h6 className="instrHeader">{this.props.label} <span className={this.blinkText()} > {(Math.floor(this.state.currentVal * 100) + "%")}</span></h6>
173173
<svg ref={this.myRef}></svg>
174174
</React.Fragment>
175175
);

src/components/planet.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ class Planet extends Component {
147147
render() {
148148
return (
149149
<React.Fragment>
150-
<h6 className="instrHeader">Target: <span className="instrValue">Earth</span></h6>
151-
<h6 className="instrHeader">Dist: <span className="instrValue">{this.state.formatNumber(this.state.distance)}m</span></h6>
150+
<h6 className="instrHeader">target <span className="instrValue">earth</span></h6>
151+
<h6 className="instrHeader">dist <span className="instrValue">{this.state.formatNumber(this.state.distance)}m</span></h6>
152152
<canvas ref={this.myRef}></canvas>
153153
</React.Fragment>
154154
);

src/components/radar.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class Radar extends Component {
299299
render() {
300300
return (
301301
<React.Fragment>
302-
<h6 className="instrHeader">Tracking: <span className={this.blinkText()} > {this.state.tracking}</span></h6>
302+
<h6 className="instrHeader">tracking <span className={this.blinkText()} > {this.state.tracking}</span></h6>
303303
<canvas ref={this.myRef}></canvas>
304304
</React.Fragment>
305305
);

src/components/starfield.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ class Starfield extends Component {
99
this.state = {};
1010
this.state.animateStarfield = false;
1111
this.state.flying = false;
12-
this.state.maxHeight = 500;
12+
this.state.maxHeight = 400;
1313
this.state.numStars = 1000;
1414
this.state.distance = -50000; // max project distance from viewer
1515
this.state.initZValMax = 500; // largest initial poroximity of generated stars
1616
this.state.alphaScale = d3.scaleLinear().domain([0, this.state.initZValMax]).range([.1, 1]);
17-
this.state.starList = ["ACAMAR", "ACHERNAR", "Achird", "ACRUX", "Acubens", "ADARA", "Adhafera", "Adhil", "AGENA", "Ain al Rami", "Ain", "Al Anz", "Al Kalb al Rai", "Al Minliar al Asad", "Al Minliar al Shuja", "Aladfar", "Alathfar", "Albaldah", "Albali", "ALBIREO", "Alchiba", "ALCOR", "ALCYONE", "ALDEBARAN", "ALDERAMIN", "Aldhibah", "Alfecca Meridiana", "Alfirk", "ALGENIB", "ALGIEBA", "ALGOL", "Algorab", "ALHENA", "ALIOTH", "ALKAID", "Alkalurops", "Alkes", "Alkurhah", "ALMAAK", "ALNAIR", "ALNATH", "ALNILAM", "ALNITAK", "Alniyat", "Alniyat", "ALPHARD", "ALPHEKKA", "ALPHERATZ", "Alrai", "Alrisha", "Alsafi", "Alsciaukat", "ALSHAIN", "Alshat", "Alsuhail", "ALTAIR", "Altarf", "Alterf", "Aludra", "Alula Australis", "Alula Borealis", "Alya", "Alzirr", "Ancha", "Angetenar", "ANKAA", "Anser", "ANTARES", "ARCTURUS", "Arkab Posterior", "Arkab Prior", "ARNEB", "Arrakis", "Ascella", "Asellus Australis", "Asellus Borealis", "Asellus Primus", "Asellus Secondus", "Asellus Tertius", "Asterope", "Atik", "Atlas", "Auva", "Avior", "Azelfafage", "Azha", "Azmidiske", "Baham", "Baten Kaitos", "Becrux", "Beid", "BELLATRIX", "BETELGEUSE", "Botein", "Brachium", "CANOPUS", "CAPELLA", "Caph", "CASTOR", "Cebalrai", "Celaeno", "Chara", "Chort", "COR CAROLI", "Cursa", "Dabih", "Deneb Algedi", "Deneb Dulfim", "Deneb el Okab", "Deneb el Okab", "Deneb Kaitos Shemali", "DENEB", "DENEBOLA", "Dheneb", "Diadem", "DIPHDA", "Double Double (7051)", "Double Double (7052)", "Double Double (7053)", "Double Double (7054)", "Dschubba", "Dsiban", "DUBHE", "Ed Asich", "Electra", "ELNATH", "ENIF", "ETAMIN", "FOMALHAUT", "Fornacis", "Fum al Samakah", "Furud", "Gacrux", "Gianfar", "Gienah Cygni", "Gienah Ghurab", "Gomeisa", "Gorgonea Quarta", "Gorgonea Secunda", "Gorgonea Tertia", "Graffias", "Grafias", "Grumium", "HADAR", "Haedi", "HAMAL", "Hassaleh", "Head of Hydrus", "Herschel's 'Garnet Star'", "Heze", "Hoedus II", "Homam", "Hyadum I", "Hyadum II", "IZAR", "Jabbah", "Kaffaljidhma", "Kajam", "KAUS AUSTRALIS", "Kaus Borealis", "Kaus Meridionalis", "Keid", "Kitalpha", "KOCAB", "Kornephoros", "Kraz", "Kuma", "Lesath", "Maasym", "Maia", "Marfak", "Marfak", "Marfic", "Marfik", "MARKAB", "Matar", "Mebsuta", "MEGREZ", "Meissa", "Mekbuda", "Menkalinan", "MENKAR", "Menkar", "Menkent", "Menkib", "MERAK", "Merga", "Merope", "Mesarthim", "Metallah", "Miaplacidus", "Minkar", "MINTAKA", "MIRA", "MIRACH", "Miram", "MIRPHAK", "MIZAR", "Mufrid", "Muliphen", "Murzim", "Muscida", "Muscida", "Muscida", "Nair al Saif", "Naos", "Nash", "Nashira", "Nekkar", "NIHAL", "Nodus Secundus", "NUNKI", "Nusakan", "Peacock", "PHAD", "Phaet", "Pherkad Minor", "Pherkad", "Pleione", "Polaris Australis", "POLARIS", "POLLUX", "Porrima", "Praecipua", "Prima Giedi", "PROCYON", "Propus", "Propus", "Propus", "Rana", "Ras Elased Australis", "Ras Elased Borealis", "RASALGETHI", "RASALHAGUE", "Rastaban", "REGULUS", "Rigel Kentaurus", "RIGEL", "Rijl al Awwa", "Rotanev", "Ruchba", "Ruchbah", "Rukbat", "Sabik", "Sadalachbia", "SADALMELIK", "Sadalsuud", "Sadr", "SAIPH", "Salm", "Sargas", "Sarin", "Sceptrum", "SCHEAT", "Secunda Giedi", "Segin", "Seginus", "Sham", "Sharatan", "SHAULA", "SHEDIR", "Sheliak", "SIRIUS", "Situla", "Skat", "SPICA", "Sterope II", "Sualocin", "Subra", "Suhail al Muhlif", "Sulafat", "Syrma", "Tabit (1543)", "Tabit (1544)", "Tabit (1552)", "Tabit (1570)", "Talitha", "Tania Australis", "Tania Borealis", "TARAZED", "Taygeta", "Tegmen", "Tejat Posterior", "Terebellum", "Terebellum", "Terebellum", "Terebellum", "Thabit", "Theemim", "THUBAN", "Torcularis Septentrionalis", "Turais", "Tyl", "UNUKALHAI", "VEGA", "VINDEMIATRIX", "Wasat", "Wezen", "Wezn", "Yed Posterior", "Yed Prior", "Yildun", "Zaniah", "Zaurak", "Zavijah", "Zibal", "Zosma", "Zuben Elakrab", "Zuben Elakribi", "Zuben Elgenubi", "Zuben Elschemali"]
17+
this.state.starList = ["acamar", "achernar", "achird", "acrux", "acubens", "adara", "adhafera", "adhil", "agena", "ain al rami", "ain", "al anz", "al kalb al rai", "al minliar al asad", "al minliar al shuja", "aladfar", "alathfar", "albaldah", "albali", "albireo", "alchiba", "alcor", "alcyone", "aldebaran", "alderamin", "aldhibah", "alfecca meridiana", "alfirk", "algenib", "algieba", "algol", "algorab", "alhena", "alioth", "alkaid", "alkalurops", "alkes", "alkurhah", "almaak", "alnair", "alnath", "alnilam", "alnitak", "alniyat", "alniyat", "alphard", "alphekka", "alpheratz", "alrai", "alrisha", "alsafi", "alsciaukat", "alshain", "alshat", "alsuhail", "altair", "altarf", "alterf", "aludra", "alula australis", "alula borealis", "alya", "alzirr", "ancha", "angetenar", "ankaa", "anser", "antares", "arcturus", "arkab posterior", "arkab prior", "arneb", "arrakis", "ascella", "asellus australis", "asellus borealis", "asellus primus", "asellus secondus", "asellus tertius", "asterope", "atik", "atlas", "auva", "avior", "azelfafage", "azha", "azmidiske", "baham", "baten kaitos", "becrux", "beid", "bellatrix", "betelgeuse", "botein", "brachium", "canopus", "capella", "caph", "castor", "cebalrai", "celaeno", "chara", "chort", "cor caroli", "cursa", "dabih", "deneb algedi", "deneb dulfim", "deneb el okab", "deneb el okab", "deneb kaitos shemali", "deneb", "denebola", "dheneb", "diadem", "diphda", "double double (7051)", "double double (7052)", "double double (7053)", "double double (7054)", "dschubba", "dsiban", "dubhe", "ed asich", "electra", "elnath", "enif", "etamin", "fomalhaut", "fornacis", "fum al samakah", "furud", "gacrux", "gianfar", "gienah cygni", "gienah ghurab", "gomeisa", "gorgonea quarta", "gorgonea secunda", "gorgonea tertia", "graffias", "grafias", "grumium", "hadar", "haedi", "hamal", "hassaleh", "head of hydrus", "herschel's 'garnet star'", "heze", "hoedus ii", "homam", "hyadum i", "hyadum ii", "izar", "jabbah", "kaffaljidhma", "kajam", "kaus australis", "kaus borealis", "kaus meridionalis", "keid", "kitalpha", "kocab", "kornephoros", "kraz", "kuma", "lesath", "maasym", "maia", "marfak", "marfak", "marfic", "marfik", "markab", "matar", "mebsuta", "megrez", "meissa", "mekbuda", "menkalinan", "menkar", "menkar", "menkent", "menkib", "merak", "merga", "merope", "mesarthim", "metallah", "miaplacidus", "minkar", "mintaka", "mira", "mirach", "miram", "mirphak", "mizar", "mufrid", "muliphen", "murzim", "muscida", "muscida", "muscida", "nair al saif", "naos", "nash", "nashira", "nekkar", "nihal", "nodus secundus", "nunki", "nusakan", "peacock", "phad", "phaet", "pherkad minor", "pherkad", "pleione", "polaris australis", "polaris", "pollux", "porrima", "praecipua", "prima giedi", "procyon", "propus", "propus", "propus", "rana", "ras elased australis", "ras elased borealis", "rasalgethi", "rasalhague", "rastaban", "regulus", "rigel kentaurus", "rigel", "rijl al awwa", "rotanev", "ruchba", "ruchbah", "rukbat", "sabik", "sadalachbia", "sadalmelik", "sadalsuud", "sadr", "saiph", "salm", "sargas", "sarin", "sceptrum", "scheat", "secunda giedi", "segin", "seginus", "sham", "sharatan", "shaula", "shedir", "sheliak", "sirius", "situla", "skat", "spica", "sterope ii", "sualocin", "subra", "suhail al muhlif", "sulafat", "syrma", "tabit (1543)", "tabit (1544)", "tabit (1552)", "tabit (1570)", "talitha", "tania australis", "tania borealis", "tarazed", "taygeta", "tegmen", "tejat posterior", "terebellum", "terebellum", "terebellum", "terebellum", "thabit", "theemim", "thuban", "torcularis septentrionalis", "turais", "tyl", "unukalhai", "vega", "vindemiatrix", "wasat", "wezen", "wezn", "yed posterior", "yed prior", "yildun", "zaniah", "zaurak", "zavijah", "zibal", "zosma", "zuben elakrab", "zuben elakribi", "zuben elgenubi", "zuben elschemali"]
1818
this.state.rMax = 2 // maximum star radius
1919
this.state.zIncrement = 1;
2020
this.state.labelPct = .005 // % of stars that are labeled
@@ -209,7 +209,7 @@ class Starfield extends Component {
209209
context.strokeStyle = "#eb4034";
210210
context.fillStyle = "#eb4034";
211211
context.strokeRect(x - edge/2, y - edge/2 ,edge ,edge);
212-
context.font = "18px Courier New";
212+
context.font = "18px Major Mono Display";
213213
context.fillText(label, x + edge, y);
214214
}
215215

src/index.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
body {
22
background-color: #000000;
3-
font-family: 'Courier New', monospace;
3+
/*font-family: 'Jura', sans-serif;*/
4+
font-family: 'Major Mono Display', monospace;
45
color: #5eff89;
56
}
67

0 commit comments

Comments
 (0)