Skip to content

Commit a917499

Browse files
update
1 parent 08efc02 commit a917499

File tree

4 files changed

+39
-20
lines changed

4 files changed

+39
-20
lines changed

_includes/chat-launcher.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,23 @@
77
<div id="chat-launcher" class="fixed inset-0 flex items-center justify-center z-50 transition-all duration-500">
88

99
<form id="chat-launcher-form"
10-
class="flex justify-center items-center bg-gray-800 w-90 text-white px-4 py-2 rounded-full shadow-md transition-all duration-500 w-60">
10+
class="flex flex-col bg-gray-800 w-90 text-white px-4 py-2 rounded-full shadow-md transition-all duration-500 w-60">
11+
<div class="flex">
1112
<input id="launcher-input" type="text" placeholder="Tulis pesan..."
1213
class="bg-transparent outline-none w-full h-10 text-left placeholder-gray-400" autocomplete="off" />
13-
<div id="chat-btn-area" class="flex gap-2 items-center hidden">
14+
</div>
15+
<div id="chat-btn-area" class="flex justify-between items-center gap-2 items-center hidden">
16+
<small class="text-gray-300 opacity-0.20">Daffa</small>
17+
<div>
1418
<button id="mic-button" type="button" class="cursor-pointer p-2 bg-gray-700 rounded-full hover:bg-gray-600">
15-
<svg class="w-4 h-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mic-icon lucide-mic"><path d="M12 19v3"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><rect x="9" y="2" width="6" height="13" rx="3"/></svg>
19+
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mic-icon lucide-mic"><path d="M12 19v3"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><rect x="9" y="2" width="6" height="13" rx="3"/></svg>
1620
</button>
1721
<button id="send-button" class="cursor-pointer p-2 bg-blue-600 text-white rounded-full hover:bg-blue-700">
18-
<svg class="w-4 h-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send-icon lucide-send"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/></svg>
22+
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-send-icon lucide-send"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/></svg>
1923
</button>
2024
</div>
25+
</div>
26+
</div>
2127
</form>
2228
</div>
2329

@@ -27,6 +33,6 @@
2733
</div>
2834

2935
<!-- Chat Box Area -->
30-
<div id="chat-box-wrapper" class="hidden max-w-sm md:max-w-xl lg:max-w-3xl fixed top-0 left-0 right-0 bottom-20 overflow-y-auto p-4 space-y-4 bg-transparent text-white z-40 transition-all duration-500 ease-in-out transform scale-0 opacity-0" style="max-height: 80vh;margin: auto;margin-top: 65px;">
36+
<div id="chat-box-wrapper" class="hidden max-w-sm md:max-w-xl lg:max-w-3xl fixed top-0 left-0 right-0 bottom-20 overflow-y-auto p-4 space-y-4 bg-transparent text-white z-40 transition-all duration-500 ease-in-out transform scale-0 opacity-0" style="max-height: 80vh;margin: auto;margin-top: 65px;margin-bottom: 25px;">
3137
<div id="chat-messages" class="w-full verflow-y-auto scroll-smooth h-[400px]"></div>
3238
</div>

assets/data/product.json

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
11
[
2+
{
3+
"title": "Chat GPT masterclass PLR",
4+
"desc": "GPT PLR Masterclass adalah paket pelatihan eksklusif yang mengajarkan cara memaksimalkan ChatGPT untuk berbagai keperluan bisnis dan pembuatan konten. Didesain untuk pemula hingga praktisi digital",
5+
"price": "35000",
6+
"link": "https://lynk.id/androidbutut/1l1z984plk15/checkout",
7+
"img": "https://notes.digitaload.in/wp-content/uploads/2025/05/25.png",
8+
"tags": ["terlaris", "favorit", "murah", "rekomendasi"]
9+
},
210
{
311
"title": "Copywriting + Video Cara Jualan",
412
"desc": "Klik untuk lihat dan unduh produk.",
5-
"img": "https://placehold.co/300x180?text=Copywriting+++Video+Cara+Jualan",
6-
"link": "https://dafffadevhosting.github.io"
13+
"img": "https://placehold.co/300x180?text=Cooming+Soon",
14+
"link": "https://dafffadevhosting.github.io",
15+
"tags": ["favorit", "murah"]
716
},
817
{
918
"title": "50 Excel Financial Templates",
1019
"desc": "Klik untuk lihat dan unduh produk.",
11-
"img": "https://placehold.co/300x180?text=50+Excel+Financial+Templates",
12-
"link": "https://dafffadevhosting.github.io"
20+
"img": "https://placehold.co/300x180?text=Cooming+Soon",
21+
"link": "https://dafffadevhosting.github.io",
22+
"tags": []
1323
},
1424
{
1525
"title": "48 Buku Cerita B.Inggris Bisa Diedit",
1626
"desc": "Klik untuk lihat dan unduh produk.",
17-
"img": "https://placehold.co/300x180?text=48+Buku+Cerita+B.Inggris+Bisa+Diedit",
18-
"link": "https://dafffadevhosting.github.io"
27+
"img": "https://placehold.co/300x180?text=Cooming+Soon",
28+
"link": "https://dafffadevhosting.github.io",
29+
"tags": ["rekomendasi"]
1930
},
2031
{
2132
"title": "19 Excel Sheets for Teachers & Students",
2233
"desc": "Klik untuk lihat dan unduh produk.",
23-
"img": "https://placehold.co/300x180?text=19+Excel+Sheets+for+Teachers+&+Students",
24-
"link": "https://dafffadevhosting.github.io"
34+
"img": "https://placehold.co/300x180?text=Cooming+Soon",
35+
"link": "https://dafffadevhosting.github.io",
36+
"tags": ["murah"]
2537
},
2638
{
2739
"title": "15 Template Resume Professional",
2840
"desc": "Klik untuk lihat dan unduh produk.",
29-
"img": "https://placehold.co/300x180?text=15+Template+Resume+Professional",
30-
"link": "https://dafffadevhosting.github.io"
41+
"img": "https://placehold.co/300x180?text=Cooming+Soon",
42+
"link": "https://dafffadevhosting.github.io",
43+
"tags": ["rekomendasi"]
3144
}
3245
]

assets/js/core/core-ai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ setupVoiceRecognition(micBtn, async (transcript) => {
8383
launcherInput.addEventListener("blur", () => {
8484
setTimeout(() => {
8585
const isActive = document.activeElement;
86-
const allowed = ["launcher-input", "send-button", "mic-button"];
86+
const allowed = ["launcher-input", "send-button", "mic-button", "href"];
8787

8888
if (!allowed.includes(isActive?.id)) {
8989
resetLauncher();
@@ -177,7 +177,7 @@ setupVoiceRecognition(micBtn, async (transcript) => {
177177
bubble.className = "bg-blue-100 dark:bg-gray-800 text-gray-800 mt-4 dark:text-gray-200 px-4 py-2 rounded-xl flex items-center gap-2 shadow";
178178

179179
const playBtn = document.createElement("button");
180-
playBtn.innerHTML = `<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines-icon lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>`;
180+
playBtn.innerHTML = `<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines-icon lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>`;
181181
playBtn.className = "text-lg";
182182
playBtn.onclick = () => speakWithTTS(label.includes("Daffa") ? text : label);
183183

assets/js/voice-engine.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function setupVoiceRecognition(micBtn, handleSend) {
2626

2727
micBtn.addEventListener("click", () => {
2828
if (speechSynthesis.speaking) speechSynthesis.cancel();
29-
micBtn.innerHTML = `<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-activity-icon lucide-activity"><path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/></svg>`;
29+
micBtn.innerHTML = `<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-activity-icon lucide-activity"><path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/></svg>`;
3030
recognition.start();
3131
});
3232

@@ -39,12 +39,12 @@ export function setupVoiceRecognition(micBtn, handleSend) {
3939
};
4040

4141
recognition.onend = () => {
42-
micBtn.innerHTML = `<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mic-icon lucide-mic"><path d="M12 19v3"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><rect x="9" y="2" width="6" height="13" rx="3"/></svg>`;
42+
micBtn.innerHTML = `<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mic-icon lucide-mic"><path d="M12 19v3"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><rect x="9" y="2" width="6" height="13" rx="3"/></svg>`;
4343
};
4444

4545
recognition.onerror = (e) => {
4646
console.warn("🎤 Voice Recognition Error:", e.error);
47-
micBtn.innerHTML = `<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mic-off-icon lucide-mic-off"><line x1="2" x2="22" y1="2" y2="22"/><path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/><path d="M5 10v2a7 7 0 0 0 12 5"/><path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/><path d="M9 9v3a3 3 0 0 0 5.12 2.12"/><line x1="12" x2="12" y1="19" y2="22"/></svg>`;
47+
micBtn.innerHTML = `<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-mic-off-icon lucide-mic-off"><line x1="2" x2="22" y1="2" y2="22"/><path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/><path d="M5 10v2a7 7 0 0 0 12 5"/><path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/><path d="M9 9v3a3 3 0 0 0 5.12 2.12"/><line x1="12" x2="12" y1="19" y2="22"/></svg>`;
4848
};
4949
}
5050

0 commit comments

Comments
 (0)