logo

ibnjs

Unnamed repository; edit this file 'description' to name the repository.
commit: 752c75bde36207e25614dedae5fec79465805067
parent 7c0ebbd0a2a9306b7b1ca1cac145054a14f518b7
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 25 Apr 2022 21:14:30 +0200

Add information element with `t` value

Diffstat:

Mibniz.css12+++++++++---
Mibniz.html5++++-
Mibniz.js2++
3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/ibniz.css b/ibniz.css @@ -1,15 +1,16 @@ :root { color-scheme: black; - color: #FFF; - background-color: #000; } /* <https://github.com/whatwg/html/issues/5426#issuecomment-607286557> */ @supports (color-scheme: black) { a { color: violet; } } html, body, main { + color: #FFF; + background-color: #000; margin: 0; padding: 0; + font-family: monospace; } main { width: 100vw; @@ -27,7 +28,6 @@ textarea { background-color: #111; width: 100%; height: 100%; - font-family: monospace; } #ibniz { width: 100%; @@ -35,3 +35,9 @@ textarea { object-fit: contain; image-rendering: optimizeQuality; } +#info { + position: fixed; + bottom: 0; + right: 0; + background-color: rgba(0,0,0,0.5); +} diff --git a/ibniz.html b/ibniz.html @@ -35,7 +35,10 @@ <option value="axCr3ls3r+43lwd*xd*+q1x/x7r+^1%w^x20r8l+^M3*w5r&w5*w9r&w2*w6r&||">FreeFull - christmas demo</option> </select> </form> - <div id="fps"><b>FPS:</b> [loading...]</div> + <aside id="info"> + <span id="fps"><b>FPS:</b> [loading...]</span> + <span id="t"><b>T:</b> [loading...]</span> + </aside> <b>IBNIZ-js 0.C</b><br> <a href="https://github.com/asiekierka/ibnjs">Github repository</a><br> <a href="mailto:asiekierka@gmail.com">Contact</a><br> diff --git a/ibniz.js b/ibniz.js @@ -856,6 +856,7 @@ p.load(runningCode); p.t=0; var codeEdit = document.getElementById("code"); var fpsField = document.getElementById("fps"); +var tField = document.getElementById("t"); var pause = document.getElementById("pause"); var simpleGetPut = document.getElementById("simpleGetPut"); var useAudio = document.getElementById("useAudio"); @@ -886,6 +887,7 @@ function derp() p.config(simpleGetPut.checked,useAudio.checked,recalcAudio.checked); //fpsField.childNodes[1].nodeValue=fps.toFixed(2) + " (about " + (fps*65536*p.parsedCode.length).toFixed(0) + " cycles)"; fpsField.childNodes[1].nodeValue=fps.toFixed(2); + tField.childNodes[1].nodeValue=p.t.toFixed(2); if(exampleApps.selectedIndex!=exampleAppID) { exampleAppID=exampleApps.selectedIndex;