Add style to zoom controls on family graph

This commit is contained in:
Antoine Bartuccio 2025-06-18 14:10:26 +02:00
parent 10d5b9d63f
commit 7d454749e0
Signed by: klmp200
GPG Key ID: E7245548C53F904B
3 changed files with 55 additions and 38 deletions

View File

@ -287,6 +287,7 @@ document.addEventListener("alpine:init", () => {
config.activeUser, config.activeUser,
); );
this.graph.userZoomingEnabled(this.isZoomEnabled); this.graph.userZoomingEnabled(this.isZoomEnabled);
this.$refs.graph.prepend(this.$refs.zoomControl);
this.loading = false; this.loading = false;
}, },
})); }));

View File

@ -2,6 +2,12 @@
width: 100%; width: 100%;
height: 70vh; height: 70vh;
display: block; display: block;
overflow: clip;
}
.zoom-control {
float: right;
margin-right: 10px;
} }
.graph-toolbar { .graph-toolbar {
@ -34,30 +40,37 @@
.depth-choice { .depth-choice {
white-space: nowrap; white-space: nowrap;
input[type="number"] { input[type="number"] {
-webkit-appearance: textfield; -webkit-appearance: textfield;
-moz-appearance: textfield; -moz-appearance: textfield;
appearance: textfield; appearance: textfield;
&::-webkit-inner-spin-button, &::-webkit-inner-spin-button,
&::-webkit-outer-spin-button { &::-webkit-outer-spin-button {
-webkit-appearance: none; -webkit-appearance: none;
} }
} }
button { button {
background: none; background: none;
&>.fa { &>.fa {
border-radius: 50%; border-radius: 50%;
font-size: 12px; font-size: 12px;
padding: 5px; padding: 5px;
} }
&:enabled>.fa { &:enabled>.fa {
background-color: #354a5f; background-color: #354a5f;
color: white; color: white;
} }
&:enabled:hover>.fa { &:enabled:hover>.fa {
color: white; color: white;
background-color: #35405f; // just a bit darker background-color: #35405f; // just a bit darker
} }
&:disabled>.fa { &:disabled>.fa {
background-color: gray; background-color: gray;
color: white; color: white;
@ -74,6 +87,7 @@
@media screen and (max-width: 500px) { @media screen and (max-width: 500px) {
flex-direction: column; flex-direction: column;
gap: 20px; gap: 20px;
.toolbar-column { .toolbar-column {
min-width: 100%; min-width: 100%;
} }
@ -91,10 +105,12 @@
margin: 0; margin: 0;
} }
} }
#family-tree-link { #family-tree-link {
display: inline-block; display: inline-block;
margin-top: 10px; margin-top: 10px;
text-align: center; text-align: center;
@media (min-width: 450px) { @media (min-width: 450px) {
margin-right: auto; margin-right: auto;
} }

View File

@ -77,7 +77,6 @@
></i></button> ></i></button>
</span> </span>
</div> </div>
</div> </div>
<div class="toolbar-column"> <div class="toolbar-column">
@ -92,8 +91,10 @@
<i class="fa fa-camera"></i> <i class="fa fa-camera"></i>
{% trans %}Save{% endtrans %} {% trans %}Save{% endtrans %}
</button> </button>
</div>
</div>
<div class="toolbar-input"> <div class="zoom-control" x-ref="zoomControl" x-show="graph !== undefined">
<button <button
@click="() => graph.zoom(graph.zoom() + 1)" @click="() => graph.zoom(graph.zoom() + 1)"
> >
@ -117,8 +118,7 @@
<i class="fa-solid fa-lock"></i> <i class="fa-solid fa-lock"></i>
</button> </button>
</div> </div>
</div>
</div>
<div x-ref="graph" class="graph"></div> <div x-ref="graph" class="graph"></div>
</div> </div>