utf-8, css

This commit is contained in:
Stefan Ostermann 2023-11-26 22:09:57 +01:00
parent c432a5644b
commit 11e4b78c70
3 changed files with 8 additions and 6 deletions

View File

@ -4,10 +4,11 @@ const char index_html[] PROGMEM = R"rawliteral(
<head>
<title>HannaBox</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<link rel='stylesheet' href='/style.css' type='text/css' media='all' />
</head>
<body>
<h1>HannaBox</h1>
<h1>🎵 HannaBox 🎵</h1>
<span id="state"></span><br/><br/>
<span id="voltage"></span><br/>
<span id="uid"></span><br/>
@ -36,7 +37,7 @@ const char index_html[] PROGMEM = R"rawliteral(
-->
<p>
<h2>Inhalt</h2>
<h2>🎶 Playlist 🎶</h2>
%DIRECTORY%
</p>

View File

@ -9,6 +9,7 @@ body {
li {
cursor: pointer;
list-style-type: none;
}
.play-button, .next-button, .prev-button {

View File

@ -469,7 +469,7 @@ void setup()
if (wifiManager.autoConnect("HannaBox"))
{
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
{ request->send_P(200, "text/html", index_html, processor); });
{ request->send_P(200, "text/html charset=UTF-8", index_html, processor); });
server.on("/style.css", HTTP_GET, [](AsyncWebServerRequest *request)
{ request->send_P(200, "text/css", css); });
@ -477,18 +477,18 @@ void setup()
server.on("/state", HTTP_GET, [](AsyncWebServerRequest *request)
{
String state = getState();
request->send(200, "application/json", state.c_str()); });
request->send(200, "application/json charset=UTF-8", state.c_str()); });
server.on("/start", HTTP_GET, [](AsyncWebServerRequest *request)
{
request->send(200, "text/plain", "start");
request->send(200, "text/plain charset=UTF-8", "start");
start(); });
server.on("/toggleplaypause", HTTP_GET, [](AsyncWebServerRequest *request)
{
request->send(200, "text/plain", "toggleplaypause");
request->send(200, "text/plain charset=UTF-8", "toggleplaypause");
togglePlayPause(); });
server.on("/stop", HTTP_GET, [](AsyncWebServerRequest *request)