mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
worker rewriting
This commit is contained in:
parent
2598bee87b
commit
f6c3c13d1e
22 changed files with 543 additions and 392 deletions
25
static/ui.js
25
static/ui.js
|
@ -145,6 +145,29 @@ function App() {
|
|||
`;
|
||||
}
|
||||
|
||||
window.addEventListener("load", () => {
|
||||
window.addEventListener("load", async () => {
|
||||
document.body.appendChild(h(App));
|
||||
function b64(buffer) {
|
||||
let binary = "";
|
||||
let bytes = new Uint8Array(buffer);
|
||||
let len = bytes.byteLength;
|
||||
for (let i = 0; i < len; i++) {
|
||||
binary += String.fromCharCode(bytes[i]);
|
||||
}
|
||||
|
||||
return btoa(binary);
|
||||
}
|
||||
const arraybuffer = await (await fetch("/scramjet.png")).arrayBuffer();
|
||||
console.log(
|
||||
"%cb",
|
||||
`
|
||||
background-image: url(data:image/png;base64,${b64(arraybuffer)});
|
||||
color: transparent;
|
||||
padding-left: 200px;
|
||||
padding-bottom: 100px;
|
||||
background-size: contain;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
`
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue