Compare commits

..

5 Commits

Author SHA1 Message Date
42ea4d08fe Good version 2026-02-28 15:46:39 +00:00
48f0ab881d Move mouse 2026-02-28 15:45:09 +00:00
Serge NOEL
08370809e1 Creation et modification svg 2026-02-27 14:00:02 +01:00
Serge NOEL
2a6da04095 Correction speedometer 2026-02-27 11:00:35 +01:00
Serge NOEL
fcccd73879 Good 2026-02-27 10:50:27 +01:00
4 changed files with 48 additions and 13 deletions

View File

@@ -30,16 +30,47 @@
<div id="speedometer">
<!-- Inline SVG for speedometer -->
<svg width="300" height="200" viewBox="0 0 300 200" xmlns="http://www.w3.org/2000/svg">
<image href="img/Speed.png" x="0" y="0" width="300" height="200"/>
<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" />
<text id="kmText" x="280" y="160" font-size="20" text-anchor="end" fill="#333">
0
</text>
</svg>
</div>
<div style="text-align:center; margin-top:20px;">
<!-- slider-->
<input type="range" id="speedSlider" min="0" max="128" value="0" oninput="updateSpeedometer(this.value);" style="width:80%;">
<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 -->

View File

@@ -4,12 +4,12 @@
#include "WebServer.h"
void handlePage(char *page) {
void handlePage(char *page, char *contentType) {
if (LittleFS.exists(page)) {
File file = LittleFS.open(page, "r");
if (file) {
String html = file.readString();
server.send(200, "text/html", html);
server.send(200, contentType, html);
file.close();
return;
}

View File

@@ -1,3 +1,5 @@
#include <ESP8266WebServer.h>
extern ESP8266WebServer server;
void handlePage(char *page);
void handlePage(char *page, char *contentType);

View File

@@ -6,6 +6,7 @@
#include "main.h"
#include <ESP8266WebServer.h>
#include <LittleFS.h>
#include "WebServer.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
@@ -45,11 +46,12 @@ void setup() {
} else {
Serial.println("[DEBUG] LittleFS mounted");
}
server.on("/", []() { handlePage("/index.html"); });
server.on("/xpressnet.html", []() { handlePage("/xpressnet.html"); });
server.on("/mouse.html", []() { handlePage("/mouse.html"); });
server.on("/js/script.js", []() { handlePage("/js/script.js"); });
server.on("/css/style.css", []() { handlePage("/css/style.css"); });
server.on("/", []() { handlePage("/index.html", "text/html"); });
server.on("/xpressnet.html", []() { handlePage("/xpressnet.html", "text/html"); });
server.on("/mouse.html", []() { handlePage("/mouse.html", "text/html"); });
server.on("/js/mouse.js", []() { handlePage("/js/mouse.js", "application/javascript"); });
server.on("/css/style.css", []() { handlePage("/css/style.css", "text/css"); });
server.on("/img/Speed.png", []() { handlePage("/img/Speed.png", "image/png"); });
server.begin();
Serial.println("[DEBUG] Web server started");
}