1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/// HTML tag name created when mounting a cross-platform canvas surface.
pub const WEB_CANVAS_TAG: &str = "canvas";
/// Inline style HTML attribute name.
pub const WEB_ATTR_STYLE: &str = "style";
/// Tabindex HTML attribute name enabling keyboard focus on canvas.
pub const WEB_ATTR_TABINDEX: &str = "tabindex";
/// Default full-viewport body inline CSS eliminating scrollbars and borders.
pub const WEB_BODY_STYLE: &str =
"margin:0;padding:0;width:100vw;height:100vh;overflow:hidden;background:#09090b;";
/// Inline CSS prefix for the full-viewport 1:1 physical canvas surface.
pub const WEB_CANVAS_STYLE_PREFIX: &str =
"position:fixed;inset:0;width:100%;height:100%;display:block;outline:none;cursor:";
/// Inline CSS suffix disabling browser touch panning and text selection on the canvas surface.
pub const WEB_CANVAS_STYLE_SUFFIX: &str =
";margin:0;touch-action:none;user-select:none;-webkit-user-select:none;";
/// Default canvas tabindex value enabling keyboard focus.
pub const WEB_ATTR_TABINDEX_ZERO: &str = "0";
/// 2D rendering context identifier passed to `HTMLCanvasElement.getContext`.
pub const WEB_CONTEXT_2D: &str = "2d";
/// Media query string used to detect browser dark mode preference.
pub const WEB_DARK_MEDIA_QUERY: &str = "(prefers-color-scheme: dark)";
/// Error message when browser `window` or `document` is unavailable.
pub const ERR_WEB_WINDOW_MISSING: &str = "browser window or document unavailable";
/// Error message when `HTMLCanvasElement` creation or casting fails.
pub const ERR_WEB_CANVAS_CREATE: &str = "failed to create HTMLCanvasElement";
/// Error message when `CanvasRenderingContext2d` cannot be acquired.
pub const ERR_WEB_CTX2D_MISSING: &str = "failed to acquire 2d canvas rendering context";
/// Error message when `ImageData` creation or `putImageData` fails.
pub const ERR_WEB_PRESENT_FAILED: &str = "failed to blit ImageData to canvas";
/// CSS cursor keyword for default arrow.
pub const WEB_CURSOR_DEFAULT: &str = "default";
/// CSS cursor keyword for clickable hand pointer.
pub const WEB_CURSOR_POINTER: &str = "pointer";
/// CSS cursor keyword for text selection I-beam.
pub const WEB_CURSOR_TEXT: &str = "text";
/// CSS cursor keyword for precision crosshair.
pub const WEB_CURSOR_CROSSHAIR: &str = "crosshair";
/// CSS cursor keyword for disabled control.
pub const WEB_CURSOR_NOT_ALLOWED: &str = "not-allowed";
/// CSS cursor keyword for open grab hand.
pub const WEB_CURSOR_GRAB: &str = "grab";
/// CSS cursor keyword for active grabbing hand.
pub const WEB_CURSOR_GRABBING: &str = "grabbing";
/// CSS cursor keyword for omnidirectional move.
pub const WEB_CURSOR_MOVE: &str = "move";
/// CSS cursor keyword for horizontal resize.
pub const WEB_CURSOR_EW_RESIZE: &str = "ew-resize";
/// CSS cursor keyword for vertical resize.
pub const WEB_CURSOR_NS_RESIZE: &str = "ns-resize";