Skip to content

Commit

Permalink
dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
valsteen committed Feb 22, 2024
1 parent 3785f88 commit f6a25f0
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion beat-detector-594cac6e242750e6.js

This file was deleted.

1 change: 1 addition & 0 deletions beat-detector-6195d6ca7a8cbbe2.js

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><meta content="text/html; charset=utf-8" http-equiv=Content-Type><meta content="width=device-width,initial-scale=1.0,user-scalable=no" name=viewport><title>Midi beat detector</title><script type=module>import a,*as b from"/midi_bpm_detection/beat-detector-594cac6e242750e6.js";a(`/midi_bpm_detection/beat-detector-594cac6e242750e6_bg.wasm`);window.wasmBindings=b</script><base href=/midi_bpm_detection/><link href=/midi_bpm_detection/favicon-f402c8741ce815ec.ico integrity=sha384-jNOAE6jgE03LznIulCTVP6BH4NrTuROFjP9wj8bV1UUMJKtZAvstFpIAP3PDcFpx rel=icon><link href=manifest.json rel=manifest><link href=icon_ios_touch_192.png rel=apple-touch-icon><meta media="(prefers-color-scheme: light)" content=white name=theme-color><meta media="(prefers-color-scheme: dark)" content=#404040 name=theme-color><style>html{touch-action:manipulation}body{background:#909090}@media (prefers-color-scheme:dark){body{background:#404040}}html,body{width:100%;height:100%;overflow:hidden;margin:0!important;padding:0!important}p{text-align:center;color:#fff;z-index:100;width:100%;margin:0;padding:4px;font-family:sans-serif;position:fixed}canvas{margin-left:auto;margin-right:auto;display:block;position:absolute;top:0%;left:50%;transform:translate(-50%)}.centered{color:#f0f0f0;text-align:center;margin-left:auto;margin-right:auto;font-family:Ubuntu-Light,Helvetica,sans-serif;font-size:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.lds-dual-ring{width:24px;height:24px;display:inline-block}.lds-dual-ring:after{content:" ";border:3px solid #fff;border-color:#fff #0000;border-radius:50%;width:24px;height:24px;margin:0;animation:1.2s linear infinite lds-dual-ring;display:block}@keyframes lds-dual-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}</style><script>var start=(a=>{_guiRemote=a});var _guiRemote</script><link as=fetch crossorigin href=/midi_bpm_detection/beat-detector-594cac6e242750e6_bg.wasm integrity=sha384-prH2q2ZkVeFwy6hr-8bBv2z7Kfd3qZZwjh7dkixkocH3m9wa8YiSitCNDhDTC2iC rel=preload type=application/wasm><link crossorigin href=/midi_bpm_detection/beat-detector-594cac6e242750e6.js integrity=sha384-vBpQTvEYkP_Eug7-wa8mtmompUnljwa8aS8QMzCCMFkrSRfyyKg69C2WrnZXu3sc rel=modulepreload></head><body><p>Beat detector demo. Just tap some keys on your computer keyboard or MIDI device. Pitch and velocity related parameters won't have any effect with computer keyboard.</p><canvas id=the_canvas_id></canvas><script>if(`serviceWorker` in navigator&&window.location.hash!==`#dev`){window.addEventListener(`load`,(()=>{navigator.serviceWorker.register(`sw.js`)}))}</script><script>`use strict`;(()=>{let h=`0`,g=`div`;const a=`{{__TRUNK_ADDRESS__}}`;const b=`{{__TRUNK_WS_BASE__}}`;let c=``;c=c?c:window.location.protocol===`https:`?`wss`:`ws`;const d=c+ `://`+ a+ b+ `.well-known/trunk/ws`;class e{constructor(){this._overlay=document.createElement(g);const a=this._overlay.style;a.height=`100vh`;a.width=`100vw`;a.position=`fixed`;a.top=h;a.left=h;a.backgroundColor=`rgba(222, 222, 222, 0.5)`;a.fontFamily=`sans-serif`;a.zIndex=`1000000`;a.backdropFilter=`blur(1rem)`;const b=document.createElement(g);b.style.position=`absolute`;b.style.top=`30%`;b.style.left=`15%`;b.style.maxWidth=`85%`;this._title=document.createElement(g);this._title.innerText=`Build failure`;this._title.style.paddingBottom=`2rem`;this._title.style.fontSize=`2.5rem`;this._message=document.createElement(g);this._message.style.whiteSpace=`pre-wrap`;const c=document.createElement(g);c.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="#dc3545" viewBox="0 0 16 16"><path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/></svg>`;this._title.prepend(c);b.append(this._title,this._message);this._overlay.append(b);this._inject();window.setInterval(()=>{this._inject()},250)}reason(a){this._message.textContent=a}_inject(){if(!this._overlay.isConnected){document.body?.prepend(this._overlay)}}}class f{constructor(a){this.url=a;this.poll_interval=5000;this._overlay=null}start(){const a=new WebSocket(this.url);a.onmessage=a=>{const b=JSON.parse(a.data);switch(b.type){case `reload`:this.reload();break;case `buildFailure`:this.buildFailure(b.data);break}};a.onclose=this.onclose}onclose(){window.setTimeout(()=>{const a=new WebSocket(this.url);a.onopen=()=>window.location.reload();a.onclose=this.onclose},this.poll_interval)}reload(){window.location.reload()}buildFailure({reason:a}){console.error(`Build failed:`,a);console.debug(`Overlay`,this._overlay);if(!this._overlay){this._overlay=new e()};this._overlay.reason=a}}new f(d).start()})()</script></body></html>
<!doctype html><meta content="text/html; charset=utf-8" http-equiv=Content-Type><meta content="width=device-width,initial-scale=1.0,user-scalable=no" name=viewport><title>Midi beat detector</title><script type=module>import a,*as b from"/midi_bpm_detection/beat-detector-6195d6ca7a8cbbe2.js";a(`/midi_bpm_detection/beat-detector-6195d6ca7a8cbbe2_bg.wasm`);window.wasmBindings=b</script><base href=/midi_bpm_detection/><link href=/midi_bpm_detection/favicon-f402c8741ce815ec.ico integrity=sha384-jNOAE6jgE03LznIulCTVP6BH4NrTuROFjP9wj8bV1UUMJKtZAvstFpIAP3PDcFpx rel=icon><link href=manifest.json rel=manifest><link href=icon_ios_touch_192.png rel=apple-touch-icon><meta media="(prefers-color-scheme: light)" content=white name=theme-color><meta media="(prefers-color-scheme: dark)" content=#404040 name=theme-color><style>html{touch-action:manipulation}body{background:#909090}@media (prefers-color-scheme:dark){body{background:#404040}}html,body{width:100%;height:100%;overflow:hidden;margin:0!important;padding:0!important}p{text-align:center;color:#fff;z-index:100;width:100%;margin:0;padding:4px;font-family:sans-serif;position:fixed}canvas{margin-left:auto;margin-right:auto;display:block;position:absolute;top:0%;left:50%;transform:translate(-50%)}.centered{color:#f0f0f0;text-align:center;margin-left:auto;margin-right:auto;font-family:Ubuntu-Light,Helvetica,sans-serif;font-size:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.lds-dual-ring{width:24px;height:24px;display:inline-block}.lds-dual-ring:after{content:" ";border:3px solid #fff;border-color:#fff #0000;border-radius:50%;width:24px;height:24px;margin:0;animation:1.2s linear infinite lds-dual-ring;display:block}@keyframes lds-dual-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}</style><script>var onMIDISuccess=(a=>{console.log(`MIDI access obtained`,a);listenToMIDIInputs(a)});var listenToMIDIInputs=(a=>{const b=a.inputs.values();for(let a=b.next();a&&!a.done;a=b.next()){a.value.onmidimessage=getMIDIMessage}});var getMIDIMessage=(a=>{let e=144;const [b,c,d]=a.data;if(b>=e&&b<160&&d>0){const f=a.timeStamp;_guiRemote.event_in(b- e,c,d,f)}});var start=(a=>{let b=0;_guiRemote=a;document.addEventListener(`keydown`,c=>{const d=c.timeStamp;a.event_in(b,b,80,d)})});var onMIDIFailure=(()=>{console.log(`Access to MIDI devices not granted.`)});var _guiRemote;if(`requestMIDIAccess` in navigator){navigator.requestMIDIAccess().then(onMIDISuccess,onMIDIFailure)}</script><link as=fetch crossorigin href=/midi_bpm_detection/beat-detector-6195d6ca7a8cbbe2_bg.wasm integrity=sha384-j_6ND5gUmcYSau7xLvt5MhOUmEhvtDCSCEiCa5d8_dOwvuDgKv82DO_xUFy0KtCh rel=preload type=application/wasm><link crossorigin href=/midi_bpm_detection/beat-detector-6195d6ca7a8cbbe2.js integrity=sha384-6nIBPDbfA_ehRTH0x3RiMYu_DOfHYzMRus6us7iwTklJSKmWck1hH-dDMXEKye5E rel=modulepreload></head><body><p>Beat detector demo. Just tap some keys on your computer keyboard or MIDI device. Pitch and velocity related parameters won't have any effect with computer keyboard.</p><canvas id=the_canvas_id></canvas><script>if(`serviceWorker` in navigator&&window.location.hash!==`#dev`){window.addEventListener(`load`,(()=>{navigator.serviceWorker.register(`sw.js`)}))}</script><script>`use strict`;(()=>{let h=`0`,g=`div`;const a=`{{__TRUNK_ADDRESS__}}`;const b=`{{__TRUNK_WS_BASE__}}`;let c=``;c=c?c:window.location.protocol===`https:`?`wss`:`ws`;const d=c+ `://`+ a+ b+ `.well-known/trunk/ws`;class e{constructor(){this._overlay=document.createElement(g);const a=this._overlay.style;a.height=`100vh`;a.width=`100vw`;a.position=`fixed`;a.top=h;a.left=h;a.backgroundColor=`rgba(222, 222, 222, 0.5)`;a.fontFamily=`sans-serif`;a.zIndex=`1000000`;a.backdropFilter=`blur(1rem)`;const b=document.createElement(g);b.style.position=`absolute`;b.style.top=`30%`;b.style.left=`15%`;b.style.maxWidth=`85%`;this._title=document.createElement(g);this._title.innerText=`Build failure`;this._title.style.paddingBottom=`2rem`;this._title.style.fontSize=`2.5rem`;this._message=document.createElement(g);this._message.style.whiteSpace=`pre-wrap`;const c=document.createElement(g);c.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="#dc3545" viewBox="0 0 16 16"><path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/></svg>`;this._title.prepend(c);b.append(this._title,this._message);this._overlay.append(b);this._inject();window.setInterval(()=>{this._inject()},250)}reason(a){this._message.textContent=a}_inject(){if(!this._overlay.isConnected){document.body?.prepend(this._overlay)}}}class f{constructor(a){this.url=a;this.poll_interval=5000;this._overlay=null}start(){const a=new WebSocket(this.url);a.onmessage=a=>{const b=JSON.parse(a.data);switch(b.type){case `reload`:this.reload();break;case `buildFailure`:this.buildFailure(b.data);break}};a.onclose=this.onclose}onclose(){window.setTimeout(()=>{const a=new WebSocket(this.url);a.onopen=()=>window.location.reload();a.onclose=this.onclose},this.poll_interval)}reload(){window.location.reload()}buildFailure({reason:a}){console.error(`Build failed:`,a);console.debug(`Overlay`,this._overlay);if(!this._overlay){this._overlay=new e()};this._overlay.reason=a}}new f(d).start()})()</script></body></html>

0 comments on commit f6a25f0

Please sign in to comment.