This widget is a small function providing a responsive calculator popup for your webpages, supporting simple maths such as 1+1 and (1+1)*2 and supporting plus, minus, multiple, divide, percentages and curved brackets.
The widget also has the option to show the results converted to different units (lengths, weights, areas and basic temperatures).
html
js :: popup the calculator
standAloneMode is for stand alone popups (PWAs) that don't need the titlebar.
The widget allows you to show either a small calculator with just the input and answers, or you can include a keyboard for environments that might otherwise place the device keyboard in the way of the UI.
On a keyboard enabled device, start with const showCalcKeypad = window.matchMedia('(pointer: coarse)').matches; or just const showCalcKeypad=false; in MFCalculatorPopup(isInputEditable, showCalcKeypad, isStandalone):

On a touch screen device needing an overlay keyboard, start with const showCalcKeypad=false; (this will have the popup include a keypad so that the device keyboard doesn't get in the way).

The function requires the .css file included, and the fonts material-icons and material-icons-outlined to work
The function uses localStorage to remember if you wanted to use conversions
This script will also support being a PWA using stand-alone mode, as seen with demo-pwa.html, allowing you to install the calculator onto your desktop
Pop out the demo:
Windows Chrome:
Windows Edge:

Once installed - simply pin the icon to the taskbar and you have a conversions calculator ready and easy to find every time.
Also see
articles/How-to-format-html-ready-for-console.logsquarearticles/Implementing-a-Monaco-Editorsquarearticles/iConnectionTestsquarearticles/javascript-camerasquarearticles/list-editsquarearticles/minifierssquarearticles/opayosquarearticles/table-drag-sortersquarearticles/typewatchsquareprojects/MFCalculatorPopupsquareprojects/MFCalendarPopupsquareprojects/MFChartColumnsquareprojects/MFColorPickersquareprojects/MFColorPickerBasicsquareprojects/MFColumnDataBarsquareprojects/MFColumnGradientsquareprojects/MFCropCornerUIsquareprojects/MFFloatawayMsgsquareprojects/MFHourglasssquareprojects/MFLazyImagessquareprojects/MFPanZoomsquareprojects/MFPanelssquareprojects/MFScrollIndicatorssquareprojects/MFSelectorsquareprojects/MFShowConsolesquareprojects/MFTableCellSummingsquare