5
This commit is contained in:
@@ -480,8 +480,8 @@ function handleContactForm($data) {
|
||||
// Store lead locally first
|
||||
$leadId = storeLead($formData);
|
||||
|
||||
// Send to webhook
|
||||
$webhookResult = sendToWebhook($formData);
|
||||
// Send to Offer webhook (contact form)
|
||||
$webhookResult = sendToWebhook($formData, WEBHOOK_URL);
|
||||
|
||||
// Always return success to user, but include webhook info in debug mode
|
||||
$debugData = DEBUG_MODE ? [
|
||||
@@ -551,13 +551,13 @@ function handleChatMessage($data) {
|
||||
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? ''
|
||||
];
|
||||
|
||||
// Send to webhook
|
||||
$webhookResult = sendToWebhook($chatData);
|
||||
// Send to KI Chat webhook
|
||||
$webhookResult = sendToWebhook($chatData, KI_CHAT_WEBHOOK_URL);
|
||||
|
||||
$debugData = DEBUG_MODE ? [
|
||||
'session_id' => $sessionId,
|
||||
'webhook_result' => $webhookResult,
|
||||
'webhook_url' => WEBHOOK_URL
|
||||
'webhook_url' => KI_CHAT_WEBHOOK_URL
|
||||
] : null;
|
||||
|
||||
if ($webhookResult['success']) {
|
||||
|
||||
@@ -12,12 +12,14 @@
|
||||
hexSize: 30,
|
||||
lineWidth: 1,
|
||||
maxLineWidth: 2.5,
|
||||
baseOpacity: 0.2,
|
||||
maxOpacity: 0.7,
|
||||
magnetRadius: 180,
|
||||
baseOpacity: 0.15,
|
||||
maxOpacity: 0.6,
|
||||
magnetRadius: 200,
|
||||
maxDisplacement: 12,
|
||||
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,
|
||||
orangeR: 245, orangeG: 124, orangeB: 0
|
||||
};
|
||||
@@ -104,27 +106,28 @@
|
||||
}
|
||||
ctx.closePath();
|
||||
|
||||
// Interpolate color: base gray -> teal -> orange
|
||||
if (this.colorInfluence > 0.01) {
|
||||
let r, g, b;
|
||||
if (this.colorInfluence < 0.5) {
|
||||
// Gray to teal
|
||||
const t = this.colorInfluence * 2;
|
||||
r = Math.round(119 + (CONFIG.tealR - 119) * t);
|
||||
g = Math.round(119 + (CONFIG.tealG - 119) * t);
|
||||
b = Math.round(100 + (CONFIG.tealB - 100) * t);
|
||||
} else {
|
||||
// Teal to orange
|
||||
const t = (this.colorInfluence - 0.5) * 2;
|
||||
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})`;
|
||||
// Smooth color interpolation: gray -> teal -> orange based on proximity
|
||||
let r, g, b;
|
||||
if (this.colorInfluence < 0.01) {
|
||||
// Base gray color
|
||||
r = CONFIG.baseR;
|
||||
g = CONFIG.baseG;
|
||||
b = CONFIG.baseB;
|
||||
} else if (this.colorInfluence < 0.6) {
|
||||
// Gray to teal (smooth transition)
|
||||
const t = this.colorInfluence / 0.6;
|
||||
r = Math.round(CONFIG.baseR + (CONFIG.tealR - CONFIG.baseR) * t);
|
||||
g = Math.round(CONFIG.baseG + (CONFIG.tealG - CONFIG.baseG) * t);
|
||||
b = Math.round(CONFIG.baseB + (CONFIG.tealB - CONFIG.baseB) * t);
|
||||
} 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.stroke();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user