From 710a07d913c2cc457056bb463e3f10f2c50acf0b Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 28 Oct 2024 20:08:03 -0700 Subject: [PATCH] Fix stylization for firefox --- ch32v/lib/calculator.css | 19 +++++-------------- ch32v/lib/calculator.html | 33 ++++++++++++++++++++------------- ch32v/lib/webhidcontrol.js | 2 +- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/ch32v/lib/calculator.css b/ch32v/lib/calculator.css index 2d63bf6..c0f1c86 100644 --- a/ch32v/lib/calculator.css +++ b/ch32v/lib/calculator.css @@ -26,22 +26,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. src: url('AudioLinkMono-Bold.ttf') format('truetype') } -@property --dark { - syntax: ""; - inherits: true; - initial-value: #111; -} - -@property --light { - syntax: ""; - inherits: true; - initial-value: white; -} - :root { color-scheme: dark; --gl: radial-gradient(circle 1px at 0px 0px, var(--light) 1px, transparent 0); --gd: radial-gradient(circle 1px at 0px 0px, var(--dark) 1px, transparent 0); + --dark: #111; + --light: #eee; --bg-0: var(--dark); --bg-1: var(--gl) 0px 0px / 4px 4px, var(--dark); --bg-2: var(--gl) 0px 0px / 4px 4px, var(--gl) 2px 2px / 4px 4px, var(--dark); @@ -166,7 +156,7 @@ input::-webkit-inner-spin-button { input[type=number] { background: var(--bg-0); outline: 0; - /*text-indent: 12px;*/ + -moz-appearance:textfield; /* Firefox */ padding-top: 1rem; padding-bottom: 1rem; padding-left: 1.1rem; @@ -191,6 +181,7 @@ textarea,input:not([type='number']) { outline: 0; border-radius: .8rem; padding: .5rem; + padding-bottom:.3rem; text-shadow: var(--l-shadow); border: 1px var(--light) solid; animation: dark-to-light 200ms ease-out forwards; @@ -203,7 +194,7 @@ textarea,input:not([type='number']) { } } -button, input[type=submit] { +button,input[type=submit] { background: var(--bg-0); border: 0; outline: 0; diff --git a/ch32v/lib/calculator.html b/ch32v/lib/calculator.html index 5664903..c9d5df6 100644 --- a/ch32v/lib/calculator.html +++ b/ch32v/lib/calculator.html @@ -13,10 +13,20 @@ var darkmode = true; function DrawSpan( rowspan, colspan, freq, target, docolor, extrastr = "" ) { var fdist = Math.abs( freq - target ); - fdist = Math.pow( fdist, 0.5 ) * 500; -// if( fdist > 255 ) fdist = 255; + fdist = Math.pow( fdist, 0.5 ) * 300; + if( fdist > 511 ) fdist = 511; + let ret = " 8 ) bg = 8; + if( docolor ) ret += 'STYLE="color:var(--' + ((bg >= 3 ) ? 'dark' : 'light' ) + ');' + + 'text-shadow: 1px 1px 2px ' + ((bg < 3 ) ? '#000' : '#fff' ) + ',' + + '-1px 1px 2px ' + ((bg < 3 ) ? '#000' : '#fff' ) + ',' + + '1px -1px 2px ' + ((bg < 3 ) ? '#000' : '#fff' ) + ',' + + '-1px -1px 2px ' + ((bg < 3 ) ? '#000' : '#fff' ) + ';' + + 'background:var(--bg-' + bg.toFixed(0) + ');"'; + //background-color:rgba(' + fdist + ',' + (511-fdist) + ',0,0.2)";'; ret += '>' + extrastr + freq.toFixed(6) + ""; return ret; } @@ -222,7 +232,7 @@ function computeTable() else if( goertzels ) { contents += - "" + + "
" + "" + "" + "
Goertzel
Goertzel (Inverse)
" + @@ -410,7 +420,6 @@ function computeTable() contents += ""; } - document.getElementById( "TABLE" ).innerHTML = contents; } @@ -457,10 +466,9 @@ function onLoad() - -
+

Tool for computing tuning to specific frequencies by use of direct ADC reading at specific timer-controlled rate to "tune" to specific frequencies either by quadrature or differential.

@@ -484,7 +492,6 @@ function onLoad()
- Live Control:
+
@@ -499,17 +506,17 @@ Live Control:
-
ADC Buffer Enable
Pow2 Attenuation:
-
+
+
+
+
- -
- diff --git a/ch32v/lib/webhidcontrol.js b/ch32v/lib/webhidcontrol.js index 802773b..360d3a8 100644 --- a/ch32v/lib/webhidcontrol.js +++ b/ch32v/lib/webhidcontrol.js @@ -370,7 +370,7 @@ async function sendLoop() (kBsecAvg).toFixed(2) + " kB/s
" + (xActionSecAvg).toFixed(2) + "x/s
"; document.getElementById( "GeneralData" ).innerHTML = - "" + + "
Count: " + goodCount + " / " + badCount + "
" + "" + "" + "" +
Count: " + goodCount + " / " + badCount + "Inten: " + ((Math.log( lastIntensity * lastIntensity )/Math.log(10)) * 10-120).toFixed(2) + "db (" + lastIntensity + ")ADCs: " + (lastadc>>16).toFixed(0) + " / " + (lastadc&0xffff).toFixed(0) + "Remote clock: MHz ` + "