mirror of
https://github.com/cnlohr/lolra.git
synced 2026-06-17 00:09:31 +00:00
Cleanup
This commit is contained in:
+1
-1
Submodule ch32v/ch32v003fun updated: 0631938a88...31a231ff27
@@ -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">
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user