feat: improve UI visibility and interaction

Enhanced UI element visibility and interaction across the editor and
scene components. By switching to classList manipulation for showing and
hiding UI elements, the approach aligns better with modern best
practices, ensuring smooth transitions and consistency in user
experience. The addition of `!important` in the CSS for the `.hide`
class guarantees the override of conflicting styles, addressing
potential visibility issues. Adjustments in HTML formatting enhance
readability and maintainability without altering functionality. This
change, while seemingly minor, significantly improves the user's ability
to intuitively navigate and interact with the UI, potentially reducing
frustration and increasing overall user satisfaction.
This commit is contained in:
Kumi 2024-03-28 11:15:36 +01:00
parent 4043f031ab
commit ae3d7ffc98
Signed by: kumi
GPG key ID: ECBCC9082395383F
4 changed files with 28 additions and 31 deletions

View file

@ -67,3 +67,11 @@ body {
.dropdown-menu { .dropdown-menu {
max-width: 100%; max-width: 100%;
} }
#resetButton {
display: inline;
}
#buttons {
display: block;
}

View file

@ -29,7 +29,7 @@
} }
.hide { .hide {
display: none; display: none !important;
} }
.btn-open-sidebar { .btn-open-sidebar {

View file

@ -79,8 +79,8 @@ function startCreateElement(event) {
</form> </form>
`; `;
document.getElementById("resetButton").style = "display: none;"; document.getElementById("resetButton").classList.remove("hide");
document.getElementById("buttons").style = "display: block;"; document.getElementById("buttons").classList.remove("hide");
document document
.getElementById("resourcetype") .getElementById("resourcetype")
@ -235,8 +235,8 @@ function startModifyElement(event) {
element_data.obj.destination_z; element_data.obj.destination_z;
} }
document.getElementById("resetButton").style = "display: inline;"; document.getElementById("resetButton").classList.remove("hide");
document.getElementById("buttons").style = "display: block;"; document.getElementById("buttons").classList.remove("hide");
}); });
} }

View file

@ -24,13 +24,13 @@
<div class="row"> <div class="row">
<!-- Main area for the scene --> <!-- Main area for the scene -->
<div class="col-md-9 scene-container"> <div class="col-md-9 scene-container">
<quackscape-scene <quackscape-scene
scene="{{ scene.id }}" scene="{{ scene.id }}"
x="{{ scene.default_x }}" x="{{ scene.default_x }}"
y="{{ scene.default_y }}" y="{{ scene.default_y }}"
z="{{ scene.default_z }}" z="{{ scene.default_z }}"
embedded embedded
></quackscape-scene> ></quackscape-scene>
</div> </div>
<!-- Sidebar for properties --> <!-- Sidebar for properties -->
@ -39,30 +39,19 @@
<div id="propertiesContent" class="mb-3"> <div id="propertiesContent" class="mb-3">
<div class="mb-2"> <div class="mb-2">
<label for="propertyExample" class="form-label" <label for="propertyExample" class="form-label"
>Click into the sphere to create a new object, >Click into the sphere to create a new object, or on an existing
or on an existing object to edit it.</label object to edit it.</label
> >
</div> </div>
</div> </div>
<div class="mb-2" id="buttons" style="display: none;"> <div class="mb-2 hide" id="buttons">
<button <button id="saveButton" class="btn btn-primary">Save</button>
id="saveButton" <button id="resetButton" class="btn btn-secondary hide">
class="btn btn-primary"
>
Save
</button>
<button
style="display: none;"
id="resetButton"
class="btn btn-secondary"
>
Reset Reset
</button> </button>
<button <button id="cancelButton" class="btn btn-danger">Cancel</button>
id="cancelButton" <button id="deleteButton" class="btn btn-danger hide">
class="btn btn-danger" Delete
>
Cancel
</button> </button>
</div> </div>
</div> </div>