Files
TANK-GIT/html/index.html
2026-06-17 07:11:08 +02:00

288 lines
7.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Tank Monitor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* ======================= */
/* THEME VARIABLES */
/* ======================= */
:root {
--bg: #f4f6f8;
--text: #000;
--card-bg: #ffffff;
--accent: #1976d2;
--tank-bg: #e0e0e0;
--wave: rgba(255,255,255,0.35);
--footer: #555;
}
body.dark {
--bg: #121212;
--text: #e0e0e0;
--card-bg: #1f1f1f;
--accent: #1e88e5;
--tank-bg: #333;
--wave: rgba(255,255,255,0.25);
--footer: #888;
}
body {
font-family: Arial, sans-serif;
background: var(--bg);
color: var(--text);
margin: 0;
padding: 0;
transition: background 0.3s, color 0.3s;
}
/* ======================= */
/* HEADER + THEME SWITCH */
/* ======================= */
.header {
background: var(--accent);
color: white;
padding: 15px;
text-align: center;
font-size: 22px;
position: relative;
}
.theme-toggle {
position: absolute;
right: 20px;
top: 15px;
}
.theme-toggle input {
appearance: none;
width: 50px;
height: 25px;
background: #555;
border-radius: 50px;
cursor: pointer;
position: relative;
transition: background 0.3s;
}
.theme-toggle input:checked {
background: #90caf9;
}
.theme-toggle input::before {
content: "";
position: absolute;
width: 21px;
height: 21px;
background: white;
border-radius: 50%;
top: 2px;
left: 2px;
transition: transform 0.3s;
}
.theme-toggle input:checked::before {
transform: translateX(25px);
}
/* ======================= */
/* CONTAINERS + CARDS */
/* ======================= */
.container {
width: 95%;
max-width: 900px;
margin: auto;
padding-top: 20px;
}
.card {
background: var(--card-bg);
border-radius: 12px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.25);
transition: background 0.3s;
}
.card h3 {
margin-top: 0;
color: var(--accent);
}
.stats-block p {
margin: 6px 0;
font-size: 16px;
}
.tank-flex-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
gap: 30px;
flex-wrap: wrap;
}
/* ======================= */
/* VERTICAL TANK WAVE */
/* ======================= */
.tank-container {
width: min(100vw, 150px);
height: min(75vh, 250px);
background: var(--tank-bg);
border-radius: 10px;
overflow: hidden;
display: flex;
align-items: flex-end;
box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
transition: width 0.3s, height 0.3s;
}
#tank-fill {
width: 100%;
height: 0%;
background: #4caf50;
position: relative;
transition: height 1s linear, background-color 1s linear;
}
#tank-fill::before,
#tank-fill::after {
content: "";
position: absolute;
left: 0;
width: 200%;
height: 20px;
background: var(--wave);
border-radius: 50%;
animation: wave 3s infinite linear;
}
#tank-fill::before { top: -5px; }
#tank-fill::after {
top: -12px;
opacity: 0.5;
animation-duration: 5s;
}
@keyframes wave {
from { transform: translateX(-50%); }
to { transform: translateX(0%); }
}
/* ======================= */
/* BUTTONS */
/* ======================= */
button {
padding: 12px 20px;
background: #e53935;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
width: 100%;
}
button:hover {
background: #ff5252;
}
.button-row {
display: flex;
gap: 15px;
}
.button-row button {
width: 100%;
}
@media (max-width: 480px) {
.button-row {
flex-direction: column;
}
}
/* ======================= */
/* FOOTER */
/* ======================= */
.footer {
text-align: center;
margin-top: 30px;
color: var(--footer);
font-size: 12px;
padding-bottom: 30px;
}
/* Mobile tank adjustment */
@media (max-width: 600px) {
.tank-container {
width: 65px;
height: 25vh;
}
}
</style>
<script src="/app.js" defer></script>
</head>
<body>
<div class="header">
Tank Monitor
<label class="theme-toggle">
<input id="modeSwitch" type="checkbox">
</label>
</div>
<div class="container">
<!-- System Stats + Tank -->
<div class="card">
<h3>System Stats</h3>
<div class="tank-flex-wrapper">
<div class="stats-block">
<p><b>Date:</b> <span id="date">--</span></p>
<p><b>Time:</b> <span id="time">--</span></p>
<p><b>Uptime:</b> <span id="uptime">--</span></p>
<p><b>Level:</b> <span id="level">--</span></p>
<p><b>Pressure:</b> <span id="pressure">--</span></p>
<p><b>Tank Level:</b> <span id="percent">--</span></p>
<p><b>CPU Temp:</b> <span id="cpu">--</span></p>
<p><b>WiFi RSSI:</b> <span id="rssi">--</span></p>
<p><b>Free Memory:</b> <span id="mem">--</span></p>
</div>
<div class="tank-container">
<div id="tank-fill"></div>
</div>
</div>
</div>
<!-- Actions -->
<div class="card">
<h3>Actions</h3>
<div class="button-row">
<!-- <button onclick="fetch('/tare')">Tank Full</button> -->
<button onclick="tankFullProtected()">Tank Full</button>
<button onclick="fetch('/calibrate')">Calibrate</button>
</div>
</div>
</div>
<div class="footer" id="footer-text">
Powered by Raspberry Pi Pico W & HX710B
</div>
</body>
</html>