Files
ble_api/web_dash/web/html/src/styles.css
T

401 lines
11 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* -------------------------------------------------
1. Global settings & color palette
------------------------------------------------- */
:root {
/* Dark theme - body & card backgrounds */
--bg-body: #2c3e50; /* main page background */
--bg-card: #34495e; /* card / panel background */
--bg-sidebar: #3d566e; /* sidebar background (slightly lighter) */
/* Accent / link color */
--clr-accent: #3498db; /* blue accent for links */
/* Text color */
--clr-text: #ecf0f1; /* light whiteish text */
/* Borders / accents */
--clr-border: #1f2b38; /* dark border color */
/* button colors*/
--clr-btn-bg: var(--bg-card); /* default button background */
--clr-btn-text: var(--clr-text); /* button text color */
--clr-btn-border: var(--clr-border); /* border color */
--clr-btn-accent: var(--clr-accent); /* hover/focus color */
--clr-btn-shadow: rgba(0,0,0,0.3);
/* select colors */
--clr-select-bg: var(--bg-card); /* dropdown background */
--clr-select-text: var(--clr-text); /* option text colour */
--clr-select-border: var(--clr-border);
--clr-select-accent: var(--clr-accent);/* focus / hover border */
--clr-select-shadow: rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
/* Body */
body {
margin: 0;
padding: 0;
background: var(--bg-body);
color: var(--clr-text);
font-family: Arial, Helvetica, sans-serif;
}
/* Links */
a { color: var(--clr-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* -------------------------------------------------
2. Layout - wrapper, sidebar, main
------------------------------------------------- */
.wrapper { display: flex; }
.sidebar {
position: fixed; /* keep sidebar visible during scroll */
top: 0; /* stick to the top of the viewport */
left: 0; /* align to the left edge */
height: 100vh; /* full viewport height */
/* ---- size & spacing ------------------------------------------- */
width: 200px; /* same as before */
padding: 1rem;
overflow-y: auto; /* allow sidebar content to scroll if needed */
/* ---- look ------------------------------------------------------- */
background: var(--bg-sidebar);
/* optional: keep it above other content */
z-index: 1000;
}
.sidebar h3 { margin: 0 0 .4rem 0; font-size: 1.3rem; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ol { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: .4rem; font-size: 1.1rem; }
.sidebar a { color: var(--clr-accent); }
.sidebar a.active { font-weight: bold; }
/*
.endpointList {
}
*/
.main{
flex: 1;
padding: 1rem;
padding-left: 200px; /* space for the fixed sidebar */
/* optional: avoid accidental horizontal overflow */
overflow-x: hidden;
}
/* -------------------------------------------------
3. Card component
------------------------------------------------- */
.card {
max-width: 950px;
margin: 20px auto 1rem auto;
padding: 20px;
background: var(--bg-card);
border: 1px solid var(--clr-border);
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
/* -------------------------------------------------
4. Tables
------------------------------------------------- */
table, th, td {
border: 2px solid var(--clr-border);
border-collapse: collapse;
}
th, td { padding: 10px; }
/* Alternate row color for metrics table */
#host_metrics_table tbody tr td:nth-of-type(even) {
background: #3e5c78; /* slight contrast */
}
/* -------------------------------------------------
5. Lists & headings
------------------------------------------------- */
h1, h2, h3, h4 { color: var(--clr-text); margin: 0 0 .4rem 0; }
ul { list-style: none; padding: 0; }
ol { list-style: none; padding: 0; }
li { margin-bottom: 10px; color: var(--clr-text); }
/* System & component lists */
.system-list, .info-list {
list-style: none; padding: 0; margin: 0;
}
.system-list li, .info-list li { margin-bottom: 5px; color: var(--clr-text); }
/* -------------------------------------------------
6. Components grid
------------------------------------------------- */
.components {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1rem;
}
.component {
padding: 10px;
border: 1px solid var(--clr-border);
border-radius: 4px;
}
.component h3 { margin: 0 0 5px; }
/* -------------------------------------------------
7. Panel toggles / modal
------------------------------------------------- */
.help-link {
cursor: pointer;
user-select: none;
color: var(--clr-accent);
text-align: right;
}
.help-link:hover { text-decoration: underline; }
#helpText { display: none; }
.componentDetail-link {
cursor: pointer;
user-select: none;
color: var(--clr-accent);
text-align: left;
}
.componentDetail-link:hover { text-decoration: underline; }
#componentDetailText { display: none; }
/* -------------------------------------------------
8. Misc helpers
------------------------------------------------- */
/* Hide numeric markers in metric columns (if any) */
#host_metrics_column td { list-style: none; padding-left: 0; margin-left: 0; }
.host-status {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-left: 6px;
margin-right: 8px;
vertical-align: middle;
background: #808080; /* default - unknown / no timestamp */
transition: background-color 1s linear; /* smooth fade */
}
/* -------------------------------------------------
9. Mobile adjustments
------------------------------------------------- */
@media (max-width: 768px) {
/* 1. Make the whole page a column */
.wrapper {
flex-direction: column;
}
/* 2. Hide the sidebar initially */
.sidebar {
position: relative; /* take it out of the flow */
width: 100%;
max-height: 0; /* collapsed */
overflow: hidden;
transition: max-height 0.3s ease-out;
background: var(--bg-sidebar);
padding: 0; /* remove padding */
}
.sidebar.show {
max-height: 500px; /* enough for all items */
padding: 1rem;
}
/* 3. Move the toggle button into the header */
.mobile-toggle {
display: block;
font-size: 1.5rem;
background: transparent;
border: none;
color: var(--clr-accent);
padding: 0.5rem;
margin-bottom: 0.5rem;
}
/* 4. Main content no left padding */
.main {
padding-left: 0;
padding-right: 1rem;
}
/* 5. Table scroll on small screens */
.card table {
width: 100%;
table-layout: fixed;
}
.card table thead,
.card table tbody,
.card table tr,
.card table td,
.card table th {
display: block;
}
.card table tbody {
overflow-x: auto;
white-space: nowrap;
}
.card table td,
.card table th {
display: inline-block;
vertical-align: top;
width: 30%;
}
/* 6. Adjust the host status dot positioning */
.host-status {
margin-left: 2px;
margin-right: 12px;
}
}
/* Optional: style the drawer indicator */
.sidebar.show::before {
content: "✕ Close";
display: block;
padding: 0.5rem 1rem;
background: var(--bg-sidebar);
color: var(--clr-accent);
font-weight: bold;
}
/* for stacking storage clients */
.storage_client{
flex: 1;
padding: 1rem;
padding-left: 200px; /* space for the fixed sidebar */
overflow-x: hidden;
display: flex; /* make it a flex container */
flex-direction: column; /* stack its children (cards) vertically */
align-items: center; /* center the cards horizontally */
}
/* lets make buttons nice*/
/* 2. Base button style */
.btn {
display: inline-block;
padding: .55rem 1.25rem;
font-size: .9rem;
font-weight: 500;
line-height: 1.4;
color: var(--clr-btn-text);
background: var(--clr-btn-bg);
border: 1px solid var(--clr-btn-border);
border-radius: .25rem;
cursor: pointer;
transition: background .15s ease, box-shadow .15s ease, transform .075s ease;
text-align: center;
user-select: none;
vertical-align: middle;
}
/* 3. Primary button - accent color */
.btn-primary {
background: var(--clr-btn-accent);
border-color: var(--clr-btn-accent);
color: #fff; /* brighter text for dark button */
}
/* 4. Secondary button - subtle background */
.btn-secondary {
background: transparent;
border-color: var(--clr-btn-accent);
color: var(--clr-btn-accent);
}
/* 5. Hover & focus states */
.btn:hover,
.btn:focus-visible {
background: #2b3f4c; /* a slightly darker shade of card bg */
box-shadow: 0 3px 8px var(--clr-btn-shadow);
transform: translateY(-1px);
outline: 0;
}
/* 6. Disabled state */
.btn:disabled,
.btn[aria-disabled="true"] {
opacity: .55;
cursor: not-allowed;
background: var(--bg-card);
border-color: var(--clr-border);
}
/* 7. Extra - block‑level button */
.btn-block {
display: block;
width: 100%;
text-align: center;
}
/* let's also make the <select> element not suck*/
/* Base <select> style */
.select-dark {
appearance: none; /* hide native arrow in Chrome/Edge/FF */
-webkit-appearance: none;
-moz-appearance: none;
display: inline-block;
padding: .45rem 1.25rem .45rem .75rem;
font-size: .9rem;
line-height: 1.4;
color: var(--clr-select-text);
background: var(--clr-select-bg);
border: 1px solid var(--clr-select-border);
border-radius: .25rem;
cursor: pointer;
position: relative;
min-width: 150px; /* optional - forces a decent width */
/* Custom arrow - positioned after the element */
background-image: linear-gradient(45deg, transparent 50%, var(--clr-select-accent) 50%),
linear-gradient(135deg, var(--clr-select-accent) 50%, transparent 50%),
linear-gradient(to right, var(--clr-select-border), var(--clr-select-border));
background-position:
calc(100% - 20px) calc(50% + 2px),
calc(100% - 15px) calc(50% + 2px),
calc(100% - 3px) 50%;
background-size:
5px 5px,
5px 5px,
1px 1.5rem;
background-repeat: no-repeat;
}
/* Hover & focus - subtle accent border */
.select-dark:hover,
.select-dark:focus-visible {
border-color: var(--clr-select-accent);
box-shadow: 0 0 3px var(--clr-select-shadow);
outline: none; /* rely on the box-shadow for focus */
}
/* Disabled state - greys out the control */
.select-dark:disabled,
.select-dark[aria-disabled="true"] {
opacity: .55;
cursor: not-allowed;
background: var(--bg-card);
border-color: var(--clr-border);
}
/* <option> styling - works in most browsers */
.select-dark option {
background: var(--bg-card);
color: var(--clr-select-text);
}
/* Optional - make the arrow bigger on hover for visibility */
.select-dark:hover {
background-position:
calc(100% - 18px) calc(50% + 2px),
calc(100% - 13px) calc(50% + 2px),
calc(100% - 3px) 50%;
}