web: Fix canvas to the top left of the screen
This commit is contained in:
parent
9fd547112d
commit
c26eccfe28
6
dist/web/source/style.css
vendored
6
dist/web/source/style.css
vendored
@ -179,4 +179,10 @@ a:hover {
|
|||||||
#logo {
|
#logo {
|
||||||
height: 25%;
|
height: 25%;
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.canvas-fixed {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
@ -25,6 +25,10 @@ EM_JS(void, resizeCanvas, (), {
|
|||||||
js_resizeCanvas();
|
js_resizeCanvas();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
EM_JS(void, fixCanvasInPlace, (), {
|
||||||
|
document.getElementById('canvas').classList.add('canvas-fixed');
|
||||||
|
});
|
||||||
|
|
||||||
EM_JS(void, setupThemeListener, (), {
|
EM_JS(void, setupThemeListener, (), {
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
|
||||||
Module._handleThemeChange();
|
Module._handleThemeChange();
|
||||||
@ -88,6 +92,9 @@ namespace hex {
|
|||||||
return;
|
return;
|
||||||
alert("Failed to load permanent file system: "+err);
|
alert("Failed to load permanent file system: "+err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Center splash screen
|
||||||
|
document.getElementById('canvas').classList.remove('canvas-fixed');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +102,7 @@ namespace hex {
|
|||||||
resizeCanvas();
|
resizeCanvas();
|
||||||
setupThemeListener();
|
setupThemeListener();
|
||||||
setupInputModeListener();
|
setupInputModeListener();
|
||||||
|
fixCanvasInPlace();
|
||||||
|
|
||||||
bool themeFollowSystem = ImHexApi::System::usesSystemThemeDetection();
|
bool themeFollowSystem = ImHexApi::System::usesSystemThemeDetection();
|
||||||
EventOSThemeChanged::subscribe(this, [themeFollowSystem] {
|
EventOSThemeChanged::subscribe(this, [themeFollowSystem] {
|
||||||
|
Loading…
Reference in New Issue
Block a user