-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
121 lines (102 loc) · 16.9 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
document.addEventListener('DOMContentLoaded', (event) => {
const canvas = document.getElementById('colorWheel');
const ctx = canvas.getContext('2d');
const img = new Image();
img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFoCAMAAABNO5HnAAAAdVBMVEXu7u7tHCP2gh8ArU4tOJb5lxzxVyL///8AW6z/wA//1QNmLZEArNgAj9WaJI/PEYzL2yrtE1sAp3UAqrHtGEFqvUUAgMjo5xMAqIoApmEAq8WsII6KKI/tCXM5tUoAm9+mzjij0dnq36Lckr2Jx0RktcL3tGr66d1eAAAgAElEQVR42uyd227bOBCGJRqUwVwFBoyuboxGUPX+j7i2LIlzIsWj7KSdtIld70X364+fM8Mh1ZxxNDje4NOmGYZhmn79+tjil43h1/CIN/s7C5++41/rPH/6AAzgwvglxwL8H+iQT+cXw+Qg7Af9jM9h+Afa/+l5ZmyM+diJX/74vMdd3P9AOz4dBvOAfP8y+aDnGJp/oMmnzUPIG+ZSoBdpN+d/oOcPhtktnpDN/K0g6KeyLeu/FfTTkzfEJRT9KcUm7L8S9IPyx5PyQnj9VRz0Juy/DPT9f3im/JQyhrwv6UTQ6/L494A+N4uWgVscoOjFQ/4W0PcXE8QrYDamHujP37+hrH8s6GeOAfxCxJwD+nMX9D2Gnw36KeZ7aMC3tKKDQG+y/omgn858h6yNcSk5TNJ5zrHFcCjoA9OMRcoGFYFHK/o3jJ+XhGw19gN1kKYPAc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3Bj8dNAK6u2CRr6MRX+PmbTewproYubngxaoMUc6KWgl2hCd8NTi7NNBxpZziz2nSWvvyQ5Vio4Kmj4Jg5Md+pVSugmwju+OXUv7J4n2cJ9Fs8tVwK5YQTLsCJ+AvxX0S9a436NZlSOof7jIFM1axRv7x3MnsOxZ1lhg0VipaDaNzgp5C2og4dzvBj1/xqJCR8ajHRvqEDMHTtxZgkDM/wTonKwB6xJDdYiGDx3AT3nuTX/ed4FOs4aMpEHYsnodHShlcyTK0yj6p2Z9vydO7GJJXujCEpPjYcfPv8HDl49FeSbQP6w1YYPcxdLPKjkAPsUrbXkyb0B5MtBP2COFndku1IKNAPULMTzj5begPCHo55chbIBUJC3DZ9LRWla0/DTKJ8M/DnotXj9ok8u6GUWTYunr3v80jsve2H/QsW/NOCF9Ebji0cATwtdPZx0b8hT4DzoV/JnZtwlvvXgHCmF7xj/RSUGvP5qBj/cH8zWPCY84TtPsEsacDyX79i/u44cmrXgtWwAAAABJRU5ErkJggg=='; // Replace this with your actual base64 string
img.onload = () => {
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
console.log("Image loaded and drawn on canvas.");
};
canvas.addEventListener('click', (event) => {
const rect = canvas.getBoundingClientRect();
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;
console.log(`Clicked coordinates: x=${x}, y=${y}`);
const imageData = ctx.getImageData(x, y, 1, 1).data;
console.log(`Image data: ${imageData}`);
const r = imageData[0];
const g = imageData[1];
const b = imageData[2];
const hexColor = rgbToHex(r, g, b);
document.getElementById('colorValue').textContent = `Selected Color: ${hexColor}`;
document.getElementById('rgbValue').textContent = `RGB: (${r}, ${g}, ${b})`;
document.getElementById('rValue').value = r;
document.getElementById('gValue').value = g;
document.getElementById('bValue').value = b;
// Update background color
document.body.style.backgroundColor = hexColor;
});
function rgbToHex(r, g, b) {
return '#' + [r, g, b].map(x => {
const hex = x.toString(16);
return hex.length === 1 ? '0' + hex : hex;
}).join('');
}
function updateColor() {
const r = parseInt(document.getElementById('rValue').value);
const g = parseInt(document.getElementById('gValue').value);
const b = parseInt(document.getElementById('bValue').value);
if (r > 255 || g > 255 || b > 255) {
document.getElementById('invalidInputMessage').style.display = 'block';
return;
} else {
document.getElementById('invalidInputMessage').style.display = 'none';
}
const hexColor = rgbToHex(r, g, b);
document.getElementById('colorValue').textContent = `Selected Color: ${hexColor}`;
document.getElementById('rgbValue').textContent = `RGB: (${r}, ${g}, ${b})`;
// Update background color
document.body.style.backgroundColor = hexColor;
}
function showPasswordInput() {
document.getElementById('passwordInputDiv').style.display = 'block';
}
function validatePassword() {
const inputPassword = document.getElementById('passwordInput').value;
document.getElementById('passwordInputDiv').style.display = 'none'; // Hide password input
if (inputPassword === PASSWORD) {
sendColor();
} else {
alert('Incorrect password!');
}
}
function sendColor() {
const color = document.getElementById('colorValue').textContent.split(': ')[1];
// Send the color value to your server or ESP8266
console.log(`Color to send: ${color}`);
}
function addGPIOControl(gpioNumber) {
const gpioControlsDiv = document.getElementById('gpioControls');
const gpioDiv = document.createElement('div');
gpioDiv.className = 'gpio';
const label = document.createElement('label');
label.textContent = `GPIO ${gpioNumber}: `;
const input = document.createElement('input');
input.type = 'checkbox';
input.id = `gpio${gpioNumber}`;
input.addEventListener('change', () => {
const state = input.checked ? 'ON' : 'OFF';
console.log(`GPIO ${gpioNumber} is ${state}`);
fetch(`/setGPIO?pin=${gpioNumber}&state=${state}`)
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
});
gpioDiv.appendChild(label);
gpioDiv.appendChild(input);
gpioControlsDiv.appendChild(gpioDiv);
}
function sendButtonValue(button) {
console.log(`Button ${button} pressed`);
fetch(`/button?name=${button}`)
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
}
// Add GPIO controls dynamically (you can adjust the number of GPIOs as needed)
addGPIOControl(0);
addGPIOControl(1);
addGPIOControl(2);
addGPIOControl(3);
addGPIOControl(4);
});