Skip to content

Commit

Permalink
Add syntax highlighting in egui web fetch example
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Dec 28, 2020
1 parent 2870001 commit 07e96ca
Show file tree
Hide file tree
Showing 8 changed files with 435 additions and 181 deletions.
160 changes: 160 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions docs/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

body {
background: #101010;
background: #202020;
}

/* Allow canvas to fill entire web page: */
Expand All @@ -24,14 +24,22 @@
margin: 0 !important;
padding: 0 !important;
}

/* Center canvas vertically and horizontally: */
canvas {
margin-right: auto;
margin-left: auto;
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
</head>

<body>
<!--
THis is where the app will show up.
The WASM code will resize this to cover the entire screen.
-->
<!-- The WASM code will resize this dynamically -->
<canvas id="the_canvas_id"></canvas>

<script>
Expand All @@ -58,7 +66,7 @@
.then(on_wasm_loaded)["catch"](console.error);

function on_wasm_loaded() {
// This call installs a bunch of callbacks and then return
// This call installs a bunch of callbacks and then returns.
wasm_bindgen.start("the_canvas_id");
}
</script>
Expand Down
Loading

0 comments on commit 07e96ca

Please sign in to comment.