Skip to content

Commit

Permalink
Optimized emscripten logo in generated html (emscripten-core#20690)
Browse files Browse the repository at this point in the history
Replaces the huge SVG in the shell with a smaller logo.
  • Loading branch information
oliversalzburg authored Nov 16, 2023
1 parent 9429b48 commit 90ab3a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4218,7 +4218,9 @@ def generate_traditional_runtime_html(target, options, js_target, target_basenam

shell = do_replace(shell, '{{{ SCRIPT }}}', script.replacement())
shell = shell.replace('{{{ SHELL_CSS }}}', utils.read_file(utils.path_from_root('src/shell.css')))
shell = shell.replace('{{{ SHELL_LOGO }}}', utils.read_file(utils.path_from_root('media/powered_by_logo_mini.svg')))
shell_logo = utils.read_binary(utils.path_from_root('media/powered_by_logo_shell.png'))
shell_logo_b64 = base64_encode(shell_logo)
shell = shell.replace('{{{ SHELL_LOGO }}}', f'<img id="emscripten_logo" src="data:image/png;base64,{shell_logo_b64}">')

check_output_file(target)
write_file(target, shell)
Expand Down
Binary file added media/powered_by_logo_shell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/shell.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ canvas.emscripten { border: 0px none; background-color: black; }
#emscripten_logo {
display: inline-block;
margin: 0;
padding: 6px;
width: 265px;
}

.spinner {
Expand Down

0 comments on commit 90ab3a7

Please sign in to comment.