feat: chat speaks as Juan — first person, CV photo avatar, disclaimer tooltip

- Agent prompt rewritten to first person ("I worked at...", "I built...")
- Bot avatar replaced with dni-thumb.jpeg (2.6KB, 56x56 retina)
- Greeting: "Pregúntame lo que quieras sobre mi currículum"
- Underlined "mi currículum" with floating tooltip disclaimer
- Every response ends with cordial email contact invitation
- Background photos now visible in production (random per load)
- Toggle button remains dev-only
This commit is contained in:
juanatsap
2026-04-26 23:32:48 +01:00
parent 3b6d5e781a
commit f5c78e6845
7 changed files with 111 additions and 72 deletions
+29 -2
View File
@@ -59,8 +59,8 @@
<div id="chat-messages" class="chat-messages">
<div class="chat-row chat-row-bot">
<div class="chat-avatar"><iconify-icon icon="mdi:robot-happy-outline"></iconify-icon></div>
<div class="chat-msg">{{if eq .Lang "es"}}¡Hola! Pregúntame lo que quieras sobre Juan.{{else}}Hi! Ask me anything about Juan.{{end}}</div>
<div class="chat-avatar chat-avatar-juan"><img src="/static/images/profile/dni-thumb.jpeg" alt="Juan"></div>
<div class="chat-msg">{{if eq .Lang "es"}}¡Hola! Pregúntame lo que quieras sobre <span class="chat-disclaimer" data-tip="Solo respondo preguntas profesionales relacionadas con el CV." onmouseenter="showChatTip(this)" onmouseleave="hideChatTip()">mi currículum</span>.{{else}}Hi! Ask me anything about <span class="chat-disclaimer" data-tip="I only answer professional questions related to the CV." onmouseenter="showChatTip(this)" onmouseleave="hideChatTip()">my CV</span>.{{end}}</div>
</div>
</div>
@@ -348,6 +348,33 @@ function scrollToCV(link) {
}
return false;
}
// Floating tooltip for chat disclaimer (escapes overflow:hidden)
function showChatTip(el) {
hideChatTip();
var tip = document.createElement('div');
tip.id = 'chat-tip';
tip.textContent = el.getAttribute('data-tip');
tip.style.cssText = 'position:fixed;background:rgba(0,0,0,0.85);color:#fff;font-size:11px;font-weight:600;padding:4px 8px;border-radius:6px;z-index:10000;pointer-events:none;box-shadow:0 2px 8px rgba(0,0,0,0.3);max-width:180px;line-height:1.3;opacity:0;transition:opacity .15s';
document.body.appendChild(tip);
var r = el.getBoundingClientRect();
var panel = el.closest('.chat-panel');
var panelR = panel ? panel.getBoundingClientRect() : { right: window.innerWidth };
var spaceRight = panelR.right - r.right;
// Show right if room, otherwise show below
if (spaceRight > tip.offsetWidth + 12) {
tip.style.left = (r.right + 8) + 'px';
tip.style.top = (r.top + r.height / 2 - tip.offsetHeight / 2) + 'px';
} else {
tip.style.left = r.left + 'px';
tip.style.top = (r.bottom + 6) + 'px';
}
tip.style.opacity = '1';
}
function hideChatTip() {
var t = document.getElementById('chat-tip');
if (t) t.remove();
}
</script>
{{end}}
{{end}}