improve some styling

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-04-06 19:47:40 +00:00
parent e98661cb4a
commit c9ce701696
3 changed files with 19 additions and 21 deletions

View File

@ -21,7 +21,7 @@
</nav> </nav>
</header> </header>
<main> <main>
<h2 id="name">Instances / %{vmname}</h2><hr> <h2 id="name"><a href="index.html">Instances</a> / %{vmname}</h2><hr>
<form style="margin-left: auto; margin-right: auto;"> <form style="margin-left: auto; margin-right: auto;">
<fieldset> <fieldset>
<legend>Resources</legend> <legend>Resources</legend>

View File

@ -1,8 +1,10 @@
:root { :root {
--accent-bkg-color: black; --accent-bkg-color: black;
--accent-txt-color: white; --accent-txt-color: white;
--accent-lnk-color: white;
--content-bkg-color: white; --content-bkg-color: white;
--content-txt-color: black; --content-txt-color: black;
--content-lnk-color: #6666FF;
--form-disabled-color: #606060; --form-disabled-color: #606060;
--button-accept: #0F0; --button-accept: #0F0;
--success-color: #0F0; --success-color: #0F0;
@ -53,30 +55,26 @@ nav {
} }
nav a { nav a {
color: var(--accent-txt-color); background-color: var(--accent-bkg-color);
font-size: x-large; color: var(--accent-lnk-color);
text-decoration: none; font-size: xx-large;
position: relative; text-decoration: underline 0.1em var(--accent-bkg-color);
transition: text-decoration-color 250ms;
} }
nav a:before { nav a:hover, nav a[aria-current="true"] {
position: absolute; text-decoration: underline 0.1em var(--accent-lnk-color);
width: 0px;
height: 100%;
left: 0px;
top: 0px;
content: '';
background: var(--accent-txt-color);
opacity: 0.3;
transition: all 0.3s;
} }
nav a[aria-current="true"]:before { main a {
width: 10px; font-size: inherit;
color: var(--content-lnk-color);
text-decoration: underline 0.1em var(--content-bkg-color);
transition: text-decoration-color 250ms;
} }
nav a:hover:before { main a:hover {
width: 100%; text-decoration: underline 0.1em var(--content-lnk-color);
} }
h1 { h1 {

View File

@ -35,7 +35,7 @@ async function getConfig () {
function populateResources () { function populateResources () {
let name = type === "qemu" ? "name" : "hostname"; let name = type === "qemu" ? "name" : "hostname";
document.querySelector("#name").innerText = document.querySelector("#name").innerText.replace("%{vmname}", config.data[name]); document.querySelector("#name").innerHTML = document.querySelector("#name").innerHTML.replace("%{vmname}", config.data[name]);
addResourceLine("resources", "images/resources/cpu.svg", "Cores", {type: "number", value: config.data.cores, min: 1, max: 8192}, "Threads"); // TODO add max from quota API addResourceLine("resources", "images/resources/cpu.svg", "Cores", {type: "number", value: config.data.cores, min: 1, max: 8192}, "Threads"); // TODO add max from quota API
addResourceLine("resources", "images/resources/ram.svg", "Memory", {type: "number", value: config.data.memory, min: 16, step: 1}, "MiB"); // TODO add max from quota API addResourceLine("resources", "images/resources/ram.svg", "Memory", {type: "number", value: config.data.memory, min: 16, step: 1}, "MiB"); // TODO add max from quota API