Files
ESP8266-Station/data/mouse.html
2026-02-27 14:00:02 +01:00

91 lines
5.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mouse Speedometer</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div class="container">
<h2>Mouse Speedometer</h2>
<div id="toolBar">
<!-- ON/OFF (Gray OFF/ Orange ON) -->
<i class="fa-solid fa-power-off"></i>
<!-- display DCCID or '-' if Analogique or Marklin -->
<i class="fa-solid fa-train"></i><span id="DCCID">34</span>
<!-- display mode (Analogique or Marklin or DCC) -->
<i class="fa-solid fa-wave-square"></i><span id="Mode">Analogique</span>
<!-- display direction (Forward or Reverse) -->
<i class="fa-solid fa-forward"></i>
<!-- Program CV -->
<i class="fa-solid fa-cogs"></i>
<!-- Accessories switch to accessories page -->
<i class="fa-solid fa-traffic-light"></i>
</div>
<div id="SelectLoco">
<!-- display a view of scale model -->
<img src="img/locos/loco.png" alt="Loco" width="300" height="50" onClick="SelectLoco();" style="cursor:pointer; margin-right:20px;">
</div>
<div id="speedometer">
<!-- Inline SVG for speedometer -->
<svg width="300" height="200" viewBox="0 0 300 200" xmlns="http://www.w3.org/2000/svg">
<circle cx="150" cy="120" r="120" fill="black" />
<!-- <image href="img/Speed.png" x="0" y="0" width="300" height="200"/> -->
<g id="ticks" stroke="white" stroke-width="3" stroke-linecap="round" transform="rotate(-90 150 120)">
<line x1="102.500" y1="37.728" x2="92.500" y2="20.407" />
<line x1="140.070" y1="25.520" x2="137.979" y2="5.630" />
<line x1="179.357" y1="29.650" x2="185.537" y2="10.629" />
<line x1="213.567" y1="49.401" x2="226.950" y2="34.538" />
<line x1="236.787" y1="81.360" x2="255.058" y2="73.225" />
<line x1="245.000" y1="120.000" x2="265.000" y2="120.000" />
<line x1="236.787" y1="158.640" x2="255.058" y2="166.775" />
<line x1="213.567" y1="190.599" x2="226.950" y2="205.462" />
<line x1="179.357" y1="210.350" x2="185.537" y2="229.371" />
<line x1="140.070" y1="214.480" x2="137.979" y2="234.370" />
<line x1="102.500" y1="202.272" x2="92.500" y2="219.593" />
</g>
<g id="speedLabels" transform="rotate(-90 150 120)">
<text x="111.000" y="52.450" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 111.000 52.450)">0</text>
<text x="141.847" y="42.427" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 141.847 42.427)">20</text>
<text x="174.103" y="45.818" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 174.103 45.818)">40</text>
<text x="202.192" y="62.035" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 202.192 62.035)">60</text>
<text x="221.257" y="88.275" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 221.257 88.275)">80</text>
<text x="228.000" y="120.000" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 228.000 120.000)">100</text>
<text x="221.257" y="151.725" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 221.257 151.725)">120</text>
<text x="202.192" y="177.965" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 202.192 177.965)">140</text>
<text x="174.103" y="194.182" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 174.103 194.182)">160</text>
<text x="141.847" y="197.573" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 141.847 197.573)">180</text>
<text x="111.000" y="187.550" font-size="14" text-anchor="middle" dominant-baseline="middle" fill="#FFF" transform="rotate(90 111.000 187.550)">200</text>
</g>
<rect x="100" y="172" width="94" height="24" rx="4" ry="4" fill="#FFF" />
<text id="TotalKm" x="190" y="190" font-size="20" text-anchor="end" fill="#AAA">0.0</text>
<text x="130" y="90" font-size="20" fill="#DDD">Km/h</text>
<line id="needle" x1="150" y1="120" x2="150" y2="70" stroke="#e74c3c" stroke-width="6" stroke-linecap="round" />
</svg>
</div>
<div style="text-align:center; margin-top:20px;">
<!-- slider-->
<input type="range" id="speedSlider" min="0" max="200" value="0" oninput="updateSpeedometer(this.value);" style="width:80%;">
</div>
<div id="Functions">
<!-- Display F0 to F7 -->
<div class="function" id="F0">F0</div>
<div class="function" id="F1">F1</div>
<div class="function" id="F2">F2</div>
<div class="function" id="F3">F3</div>
<div class="function" id="F4">F4</div>
<div class="function" id="F5">F5</div>
<div class="function" id="F6">F6</div>
<div class="function" id="F7">F7</div>
</div>
</div>
<script type="text/javascript" src="js/mouse.js"></script>
</body>
</html>