This commit is contained in:
cnlohr
2024-10-10 01:11:08 -07:00
parent a65de155c0
commit f6b5dfe68d
3 changed files with 13 additions and 10 deletions
+7 -6
View File
@@ -2,22 +2,23 @@
<HTML> <HTML>
<HEAD> <HEAD>
<LINK rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> <LINK rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
<META charset="UTF-8"> <META charset="UTF-8"/>
<STYLE> <STYLE>
body { background-color: Canvas; color: CanvasText; }
:root { color-scheme: dark; } :root { color-scheme: dark; }
</STYLE> </STYLE>
<SCRIPT src=webhidcontrol.js></SCRIPT> <SCRIPT src=webhidcontrol.js></SCRIPT>
<SCRIPT> <SCRIPT>
var darkmode = true;
//body { background-color: Canvas; color: CanvasText; }
function DrawSpan( rowspan, colspan, freq, target, docolor, extrastr = "" ) function DrawSpan( rowspan, colspan, freq, target, docolor, extrastr = "" )
{ {
var fdist = Math.abs( freq - target ); var fdist = Math.abs( freq - target );
fdist = Math.pow( fdist, 0.5 ) * 500; fdist = Math.pow( fdist, 0.5 ) * 500;
// if( fdist > 255 ) fdist = 255; // if( fdist > 255 ) fdist = 255;
let ret = "<TD COLSPAN=" + colspan + ' ROWSPAN' + rowspan + ' '; let ret = "<TD COLSPAN=" + colspan + ' ROWSPAN' + rowspan + ' ';
if( docolor ) ret += 'STYLE="color:black;background-color:rgb(' + fdist + ',' + (511-fdist) + ',0)";'; if( docolor ) ret += 'STYLE="color:black;background-color:rgba(' + fdist + ',' + (511-fdist) + ',0,0.2)";';
ret += '>' + extrastr + freq.toFixed(6) + "</TD>"; ret += '>' + extrastr + freq.toFixed(6) + "</TD>";
return ret; return ret;
} }
@@ -485,7 +486,7 @@ function onLoad()
</TD> </TD>
<TD VALIGN=TOP> <TD VALIGN=TOP>
Live Control: Live Control:<br>
<TABLE><TR> <TABLE><TR>
<TD><INPUT TYPE=SUBMIT onClick="reqConnect()" VALUE="Open Device" ID=connectButton> <TD><INPUT TYPE=SUBMIT onClick="reqConnect()" VALUE="Open Device" ID=connectButton>
<INPUT TYPE=SUBMIT onClick="toggleAudio()" VALUE="Play Audio" ID="ToggleAudioButton"> <INPUT TYPE=SUBMIT onClick="toggleAudio()" VALUE="Play Audio" ID="ToggleAudioButton">
+5 -3
View File
@@ -346,16 +346,18 @@ async function sendLoop()
ctx.clearRect(0, 0, liveGraph.width, liveGraph.height); ctx.clearRect(0, 0, liveGraph.width, liveGraph.height);
let grey = darkmode?"rgb( 240 240 240 )":"rgb(16 16 16)";
let mark = darkmode?"rgb( 255 255 255 )":"rgb(0 0 0)";
var filledness = lastNumQ * 198 / 120; var filledness = lastNumQ * 198 / 120;
ctx.fillStyle = "rgb( 240 240 240 )"; ctx.fillStyle = grey;
ctx.fillRect( 2, 2 + 198 - filledness, 18, filledness - 2); ctx.fillRect( 2, 2 + 198 - filledness, 18, filledness - 2);
filledness = ( lastTimeUsed * 1.0 / lastTotalTime ) * 198; filledness = ( lastTimeUsed * 1.0 / lastTotalTime ) * 198;
ctx.fillStyle = "rgb( 240 240 240 )"; ctx.fillStyle = grey;
ctx.fillRect( 26, 2 + 198 - filledness, 18, filledness - 2 ); ctx.fillRect( 26, 2 + 198 - filledness, 18, filledness - 2 );
ctx.fillStyle = `rgb( 255 255 255 )`; ctx.fillStyle = mark;
let mulcoeff = 2500.0 / lastIntensity; let mulcoeff = 2500.0 / lastIntensity;
var lot = 1.2; var lot = 1.2;