This commit is contained in:
2026-02-06 13:26:38 +01:00
parent 73968dfbd6
commit 44a88dcfad
2 changed files with 31 additions and 28 deletions

View File

@@ -480,8 +480,8 @@ function handleContactForm($data) {
// Store lead locally first // Store lead locally first
$leadId = storeLead($formData); $leadId = storeLead($formData);
// Send to webhook // Send to Offer webhook (contact form)
$webhookResult = sendToWebhook($formData); $webhookResult = sendToWebhook($formData, WEBHOOK_URL);
// Always return success to user, but include webhook info in debug mode // Always return success to user, but include webhook info in debug mode
$debugData = DEBUG_MODE ? [ $debugData = DEBUG_MODE ? [
@@ -551,13 +551,13 @@ function handleChatMessage($data) {
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? '' 'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? ''
]; ];
// Send to webhook // Send to KI Chat webhook
$webhookResult = sendToWebhook($chatData); $webhookResult = sendToWebhook($chatData, KI_CHAT_WEBHOOK_URL);
$debugData = DEBUG_MODE ? [ $debugData = DEBUG_MODE ? [
'session_id' => $sessionId, 'session_id' => $sessionId,
'webhook_result' => $webhookResult, 'webhook_result' => $webhookResult,
'webhook_url' => WEBHOOK_URL 'webhook_url' => KI_CHAT_WEBHOOK_URL
] : null; ] : null;
if ($webhookResult['success']) { if ($webhookResult['success']) {

View File

@@ -12,12 +12,14 @@
hexSize: 30, hexSize: 30,
lineWidth: 1, lineWidth: 1,
maxLineWidth: 2.5, maxLineWidth: 2.5,
baseOpacity: 0.2, baseOpacity: 0.15,
maxOpacity: 0.7, maxOpacity: 0.6,
magnetRadius: 180, magnetRadius: 200,
maxDisplacement: 12, maxDisplacement: 12,
returnSpeed: 0.1, returnSpeed: 0.1,
// Colors (teal to orange gradient based on proximity) // Base color (neutral gray)
baseR: 119, baseG: 119, baseB: 100,
// Colors for proximity effect (teal to orange)
tealR: 38, tealG: 166, tealB: 154, tealR: 38, tealG: 166, tealB: 154,
orangeR: 245, orangeG: 124, orangeB: 0 orangeR: 245, orangeG: 124, orangeB: 0
}; };
@@ -104,27 +106,28 @@
} }
ctx.closePath(); ctx.closePath();
// Interpolate color: base gray -> teal -> orange // Smooth color interpolation: gray -> teal -> orange based on proximity
if (this.colorInfluence > 0.01) { let r, g, b;
let r, g, b; if (this.colorInfluence < 0.01) {
if (this.colorInfluence < 0.5) { // Base gray color
// Gray to teal r = CONFIG.baseR;
const t = this.colorInfluence * 2; g = CONFIG.baseG;
r = Math.round(119 + (CONFIG.tealR - 119) * t); b = CONFIG.baseB;
g = Math.round(119 + (CONFIG.tealG - 119) * t); } else if (this.colorInfluence < 0.6) {
b = Math.round(100 + (CONFIG.tealB - 100) * t); // Gray to teal (smooth transition)
} else { const t = this.colorInfluence / 0.6;
// Teal to orange r = Math.round(CONFIG.baseR + (CONFIG.tealR - CONFIG.baseR) * t);
const t = (this.colorInfluence - 0.5) * 2; g = Math.round(CONFIG.baseG + (CONFIG.tealG - CONFIG.baseG) * t);
r = Math.round(CONFIG.tealR + (CONFIG.orangeR - CONFIG.tealR) * t); b = Math.round(CONFIG.baseB + (CONFIG.tealB - CONFIG.baseB) * t);
g = Math.round(CONFIG.tealG + (CONFIG.orangeG - CONFIG.tealG) * t);
b = Math.round(CONFIG.tealB + (CONFIG.orangeB - CONFIG.tealB) * t);
}
ctx.strokeStyle = `rgba(${r}, ${g}, ${b}, ${this.opacity})`;
} else { } else {
ctx.strokeStyle = `rgba(119, 119, 100, ${this.opacity})`; // Teal to orange (only very close to cursor)
const t = (this.colorInfluence - 0.6) / 0.4;
r = Math.round(CONFIG.tealR + (CONFIG.orangeR - CONFIG.tealR) * t);
g = Math.round(CONFIG.tealG + (CONFIG.orangeG - CONFIG.tealG) * t);
b = Math.round(CONFIG.tealB + (CONFIG.orangeB - CONFIG.tealB) * t);
} }
ctx.strokeStyle = `rgba(${r}, ${g}, ${b}, ${this.opacity})`;
ctx.lineWidth = this.lineWidth; ctx.lineWidth = this.lineWidth;
ctx.stroke(); ctx.stroke();
} }