From 5a0eb31cb695f53b44fceced9dd05beb1030d3e4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 17:09:45 +0000 Subject: [PATCH 1/2] Initial plan From d34ea61e1c9974ea22b2ce5fa474a63d3f90b656 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Mar 2026 17:16:21 +0000 Subject: [PATCH 2/2] Add Cloudflare AI chat bot (EduBot) to homepage Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com> Agent-Logs-Url: https://github.com/alphaonelabs/learn/sessions/5befeeca-5aa8-451b-975e-5abd2704fc0f --- public/index.html | 119 ++++++++++++++++++++++++++++++++++++++++++++++ src/worker.py | 67 ++++++++++++++++++++++++++ wrangler.toml | 3 ++ 3 files changed, 189 insertions(+) diff --git a/public/index.html b/public/index.html index a060227..51832b9 100644 --- a/public/index.html +++ b/public/index.html @@ -24,6 +24,29 @@ .badge { display: inline-block; padding: 2px 10px; border-radius: 9999px; font-size: .75rem; font-weight: 600; } .tag-pill { cursor: pointer; transition: background .15s; } .tag-pill.active { background: #4F46E5; color: #fff; } + + /* ── Chat widget ────────────────────────────────────────────────────── */ + #chat-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: .75rem; } + #chat-toggle { width: 3.5rem; height: 3.5rem; border-radius: 9999px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 4px 16px rgba(79,70,229,.4); background: linear-gradient(135deg,#4F46E5,#7C3AED); color: #fff; transition: transform .2s, box-shadow .2s; } + #chat-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(79,70,229,.5); } + #chat-window { width: 22rem; max-width: calc(100vw - 3rem); background: #fff; border-radius: 1.25rem; box-shadow: 0 8px 40px rgba(0,0,0,.14); display: flex; flex-direction: column; overflow: hidden; } + #chat-window.hidden { display: none !important; } + #chat-header { background: linear-gradient(135deg,#4F46E5,#7C3AED); color: #fff; padding: .875rem 1.25rem; display: flex; align-items: center; justify-content: space-between; } + #chat-header h4 { margin: 0; font-size: .9375rem; font-weight: 700; } + #chat-header p { margin: 0; font-size: .75rem; opacity: .8; } + #chat-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 1.1rem; opacity: .8; line-height: 1; padding: 0; } + #chat-close:hover { opacity: 1; } + #chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .625rem; min-height: 14rem; max-height: 22rem; } + .chat-msg { max-width: 85%; padding: .5rem .875rem; border-radius: 1rem; font-size: .875rem; line-height: 1.5; word-break: break-word; } + .chat-msg.bot { background: #f1f5f9; color: #1e293b; align-self: flex-start; border-bottom-left-radius: .25rem; } + .chat-msg.user { background: linear-gradient(135deg,#4F46E5,#7C3AED); color: #fff; align-self: flex-end; border-bottom-right-radius: .25rem; } + .chat-msg.typing { opacity: .6; font-style: italic; } + #chat-form { display: flex; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid #f1f5f9; } + #chat-input { flex: 1; border: 1px solid #e2e8f0; border-radius: .75rem; padding: .5rem .875rem; font-size: .875rem; outline: none; transition: border-color .15s; } + #chat-input:focus { border-color: #4F46E5; } + #chat-send { background: linear-gradient(135deg,#4F46E5,#7C3AED); color: #fff; border: none; border-radius: .75rem; padding: .5rem .875rem; cursor: pointer; font-size: .875rem; font-weight: 600; transition: opacity .15s; } + #chat-send:hover { opacity: .9; } + #chat-send:disabled { opacity: .5; cursor: not-allowed; }
@@ -146,6 +169,27 @@© 2024–2026 EduPlatform · Cloudflare Python Workers + D1 · All user data encrypted at rest
+ +Ask me anything about EduPlatform!
+