mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
js: Move dialogue-box sizing and positioning from JavaScript to CSS
This has the advantage that if you resize the window while a dialogue box is active, the dialogue box adjusts itself accordingly.
This commit is contained in:
@ -184,9 +184,6 @@ function dialog_init(titletext) {
|
|||||||
// Now create a form which sits on top of that in turn.
|
// Now create a form which sits on top of that in turn.
|
||||||
dlg_form = document.createElement("form");
|
dlg_form = document.createElement("form");
|
||||||
dlg_form.id = "dlgform";
|
dlg_form.id = "dlgform";
|
||||||
dlg_form.style.width = (window.innerWidth * 2 / 3) + "px";
|
|
||||||
dlg_form.style.top = (window.innerHeight / 10) + "px";
|
|
||||||
dlg_form.style.left = (window.innerWidth / 6) + "px";
|
|
||||||
|
|
||||||
var title = document.createElement("p");
|
var title = document.createElement("p");
|
||||||
title.className = "title";
|
title.className = "title";
|
||||||
|
@ -225,12 +225,15 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
#dlgform {
|
#dlgform {
|
||||||
|
width: 66.6667vw;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
top: 10vh;
|
||||||
|
left: 16.6667vw;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user