mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-09 20:31:29 +11:00
Nicer HTML
It's easier with innerHTML rather than constructing DOM by hand.
This commit is contained in:
parent
e399f4792d
commit
8a083d9473
|
@ -459,14 +459,18 @@ fn display_error_message() -> Option<()> {
|
||||||
let document = window.document()?;
|
let document = window.document()?;
|
||||||
let elements = document.get_elements_by_tag_name("body");
|
let elements = document.get_elements_by_tag_name("body");
|
||||||
let body = elements.item(0)?;
|
let body = elements.item(0)?;
|
||||||
let canvas = body.first_child()?;
|
body.set_inner_html(
|
||||||
// TODO: style the notice at least a little, maybe link?
|
r#"<style>
|
||||||
let text = document.create_text_node(
|
p {
|
||||||
"WebGPU is not enabled. Make sure your browser is updated to
|
margin: 2em 10em;
|
||||||
Chrome M113 or another browser compatible with WebGPU.",
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<p><a href="https://chromestatus.com/feature/6213121689518080">WebGPU</a>
|
||||||
|
is not enabled. Make sure your browser is updated to
|
||||||
|
<a href="https://chromiumdash.appspot.com/schedule">Chrome M113</a> or
|
||||||
|
another browser compatible with WebGPU.</p>"#,
|
||||||
);
|
);
|
||||||
let _ = body.insert_before(&text, Some(&canvas));
|
|
||||||
web_sys::console::log_1(&"got body".into());
|
|
||||||
Some(())
|
Some(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue