浏览代码

Hide/show password

master
gituser 1周前
父节点
当前提交
4c07783a43
共有 4 个文件被更改,包括 55 次插入3 次删除
  1. 1
    0
      .cproject
  2. 1
    0
      .gitignore
  3. 52
    2
      LEDLamp.ino
  4. 1
    1
      sloeber.ino.cpp

+ 1
- 0
.cproject 查看文件

@@ -103,4 +103,5 @@
</storageModule>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>

+ 1
- 0
.gitignore 查看文件

@@ -1,3 +1,4 @@
/core
/libraries
/Release
/sloeber.ino.cpp

+ 52
- 2
LEDLamp.ino 查看文件

@@ -49,6 +49,22 @@ void handleRoot() {
R"rawliteral(
<!DOCTYPE html>
<html>

<script>
function togglePassword() {
const pass = document.getElementById("pass");
const eye = document.querySelector(".toggle-eye");
if (pass.type === "password") {
pass.type = "text";
eye.textContent = "❌";
} else {
pass.type = "password";
eye.textContent = "👁";
}
}
</script>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Wemos Setup</title>
@@ -133,6 +149,38 @@ void handleRoot() {
word-break: break-all;
}

.pw-wrapper {
position: relative;
width: 100%;
margin: 8px 0;
}
.pw-wrapper input {
width: 100%;
padding: 12px 40px 12px 12px; /* Platz für Icon rechts */
border-radius: 10px;
border: none;
outline: none;
font-size: 14px;
box-sizing: border-box;
}
.toggle-eye {
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
font-size: 16px;
opacity: 0.6;
user-select: none;
transition: 0.2s;
}
.toggle-eye:hover {
opacity: 1;
}

@keyframes fadeIn {
from {opacity: 0; transform: translateY(10px);}
to {opacity: 1; transform: translateY(0);}
@@ -151,8 +199,10 @@ void handleRoot() {

<form action="/save" method="POST">
<input name="ssid" placeholder="WLAN Name (SSID)">
<input name="pass" type="password" placeholder="Passwort">

<div class="pw-wrapper">
<input id="pass" name="pass" type="password" placeholder="Passwort">
<span class="toggle-eye" onclick="togglePassword()">👁</span>
</div>
<button type="submit">Verbinden</button>
</form>


+ 1
- 1
sloeber.ino.cpp 查看文件

@@ -2,7 +2,7 @@
//This is a automatic generated file
//Please do not modify this file
//If you touch this file your change will be overwritten during the next build
//This file has been generated on 2026-06-07 14:55:03
//This file has been generated on 2026-06-07 15:50:46

#include "Arduino.h"
#include "Arduino.h"

正在加载...
取消
保存