better responsive handling

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-04-06 22:08:11 +00:00
parent 389a548d00
commit 15822fdacb
3 changed files with 37 additions and 20 deletions

View File

@ -1,8 +1,26 @@
div { @media screen and (min-width: 1000px) {
display: flex; div {
flex-direction: row; display: flex;
align-items: center; flex-direction: row;
column-gap: 10px; align-items: center;
column-gap: 10px;
}
}
@media screen and (max-width: 1000px) {
* {
}
#instance-status {
display: none;
}
#instance-type {
display: none;
}
#node-name {
display: none;
}
#node-status-div {
display: none;
}
} }
.btn-group { .btn-group {

View File

@ -31,25 +31,24 @@
} }
@media screen and (max-width: 1000px) { @media screen and (max-width: 1000px) {
#instance-container { #instance-container {
display: flex; display: grid;
flex-direction: column; grid-template-columns: auto auto 1fr auto;
column-gap: 2.5em;
align-items: center;
}
#instance-container {
margin: 0px;
} }
#instance-container-header * { #instance-container-header * {
display: none; display: none;
} }
instance-obj { instance-obj {
display: grid; display: contents;
grid-template-columns: auto auto auto 1fr; }
gap: 20px; instance-obj:after, instance-obj:first-of-type:before {
padding-top: 20px; content: " ";
padding-bottom: 20px;
border-bottom: 1px solid var(--content-txt-color); border-bottom: 1px solid var(--content-txt-color);
} grid-column: 1 / span 8;
instance-obj:first-of-type {
border-top: 1px solid var(--content-txt-color);
}
.btn-group {
grid-column: 3 / span 2;
} }
} }
</style> </style>

View File

@ -13,9 +13,9 @@ export class Instance extends HTMLElement {
<p id="instance-id"></p> <p id="instance-id"></p>
<p id="instance-name"></p> <p id="instance-name"></p>
<p id="instance-type"></p> <p id="instance-type"></p>
<div><img id="instance-status-icon"><p id="instance-status"></p></div> <div id="instance-status-div"><img id="instance-status-icon"><p id="instance-status"></p></div>
<p id="node-name"></p> <p id="node-name"></p>
<div><img id="node-status-icon"><p id="node-status"></p></div> <div id="node-status-div"><img id="node-status-icon"><p id="node-status"></p></div>
<div class="btn-group"> <div class="btn-group">
<img id="power-btn" class="clickable"> <img id="power-btn" class="clickable">
<img id="console-btn" class="clickable"> <img id="console-btn" class="clickable">