Files
HuangYuChuh-ComfyUI-LLMs-To…/web/api_key_toggle.html
T
2025-01-30 00:32:58 +08:00

47 lines
1.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>API Key Toggle</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
#api-key {
width: 300px;
padding: 5px;
}
.button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
margin-top: 10px;
}
</style>
</head>
<body>
<h1>API Key Visibility Toggle</h1>
<input type="text" id="api-key" value="Your API Key Here">
<button class="button" id="toggle-button">Hide API Key</button>
<script>
const apiKeyInput = document.getElementById('api-key');
const toggleButton = document.getElementById('toggle-button');
let isHidden = false;
toggleButton.addEventListener('click', () => {
if (isHidden) {
apiKeyInput.type = 'text';
toggleButton.textContent = 'Hide API Key';
} else {
apiKeyInput.type = 'password';
toggleButton.textContent = 'Show API Key';
}
isHidden = !isHidden;
});
</script>
</body>
</html>