{"id":259,"date":"2025-12-19T17:05:05","date_gmt":"2025-12-19T17:05:05","guid":{"rendered":"https:\/\/jamoorey.in\/?page_id=259"},"modified":"2025-12-20T08:45:19","modified_gmt":"2025-12-20T08:45:19","slug":"custom-html","status":"publish","type":"page","link":"https:\/\/jamoorey.in\/","title":{"rendered":"Financial Wizard"},"content":{"rendered":"\n<style>\n\/* Intro Blurb *\/\n.finchat-intro {\n  max-width: 720px;\n  margin: 0 auto 20px auto;\n  color: #1f2937;\n  font-size: 16px;\n  line-height: 1.6;\n}\n\n.finchat-intro strong {\n  font-weight: 600;\n}\n\n.finchat-intro .finchat-note {\n  margin-top: 8px;\n  font-size: 13px;\n  color: #6b7280;\n  font-style: italic;\n}\n<\/style>\n\n<div class=\"finchat-intro\">\n  <strong>A simple way to understand financial concepts.<\/strong><br>\n  Use our financial education chatbot to explore topics like markets, savings, and investing fundamentals through clear, easy-to-read explanations.\n  <div class=\"finchat-note\">\n    This tool is for educational purposes only and does not provide financial advice.\n  <\/div>\n<\/div>\n\n\n\n\n<style>\n\/* Container *\/\n#finchat-box {\n  max-width: 600px;\n  margin: 20px auto;\n  padding: 20px;\n  border-radius: 12px;\n  background: #ffffff;\n  box-shadow: 0 10px 30px rgba(0,0,0,0.08);\n  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;\n}\n\n\/* Heading *\/\n#finchat-box h3 {\n  margin-top: 0;\n  margin-bottom: 12px;\n  font-size: 20px;\n  color: #1a202c;\n}\n\n\/* Textarea *\/\n#finchat-box textarea {\n  width: 100%;\n  min-height: 80px;\n  padding: 12px;\n  font-size: 15px;\n  border-radius: 8px;\n  border: 1px solid #cbd5e0;\n  resize: vertical;\n}\n\n\/* Button *\/\n#finchat-box button {\n  margin-top: 12px;\n  padding: 10px 16px;\n  font-size: 15px;\n  background-color: #2563eb;\n  color: #ffffff;\n  border: none;\n  border-radius: 8px;\n  cursor: pointer;\n}\n\n#finchat-box button:disabled {\n  background-color: #93c5fd;\n  cursor: not-allowed;\n}\n\n\/* Response container *\/\n#finchat-response {\n  margin-top: 16px;\n  padding: 12px;\n  background: #f8fafc;\n  border-radius: 8px;\n  font-size: 15px;\n  color: #1f2937;\n}\n\n\/* Disclaimer *\/\n#finchat-disclaimer {\n  margin-top: 8px;\n  font-size: 12px;\n  color: #6b7280;\n}\n\n\/* Loader *\/\n#finchat-loader {\n  display: none;\n  margin-top: 10px;\n  font-size: 14px;\n  color: #475569;\n}\n\n\/* AI response formatting *\/\n.finchat-heading {\n  font-size: 18px;\n  font-weight: 700;\n  margin-bottom: 12px;\n  color: #0f172a;\n}\n\n.finchat-section {\n  margin-top: 14px;\n  margin-bottom: 6px;\n  font-weight: 600;\n  font-size: 16px;\n  color: #1e293b;\n}\n\n.finchat-paragraph {\n  margin-bottom: 8px;\n  line-height: 1.6;\n  color: #1f2937;\n}\n\n.finchat-bullet {\n  margin-left: 12px;\n  margin-bottom: 6px;\n  line-height: 1.5;\n}\n\n<\/style>\n\n<div id=\"finchat-box\">\n  <h3>Ask a Financial Question<\/h3>\n\n  <textarea id=\"finchat-question\" placeholder=\"Example: What is SIP in India?\"><\/textarea>\n\n  <button id=\"finchat-btn\" onclick=\"askFinChat()\">Ask<\/button>\n\n  <div id=\"finchat-loader\">Thinking\u2026<\/div>\n\n  <div id=\"finchat-response\"><\/div>\n  <div id=\"finchat-disclaimer\"><\/div>\n<\/div>\n\n<script>\nasync function askFinChat() {\n  const question = document.getElementById(\"finchat-question\").value.trim();\n  const button = document.getElementById(\"finchat-btn\");\n  const loader = document.getElementById(\"finchat-loader\");\n  const responseBox = document.getElementById(\"finchat-response\");\n  const disclaimerBox = document.getElementById(\"finchat-disclaimer\");\n\n  if (!question) {\n    responseBox.innerText = \"Please enter a question.\";\n    return;\n  }\n\n  button.disabled = true;\n  loader.style.display = \"block\";\n  responseBox.innerText = \"\";\n  disclaimerBox.innerText = \"\";\n\n  try {\n    const res = await fetch(\"https:\/\/api.jamoorey.in\/chat\", {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application\/json\" },\n      body: JSON.stringify({ message: question })\n    });\n\n    if (!res.ok) {\n      throw new Error(\"Server error. Please try again.\");\n    }\n\n    const data = await res.json();\n\n    responseBox.innerHTML = formatResponse(data.reply) || \"No response received.\";\n    disclaimerBox.innerText = data.disclaimer || \"\";\n\n  } catch (err) {\n    responseBox.innerText = \"Sorry, something went wrong. Please try again later.\";\n  } finally {\n    loader.style.display = \"none\";\n    button.disabled = false;\n  }\n}\n<\/script>\n\n<script>\nfunction formatResponse(text) {\n  \/\/ Escape HTML for safety\n  text = text\n    .replace(\/&\/g, \"&amp;\")\n    .replace(\/<\/g, \"&lt;\")\n    .replace(\/>\/g, \"&gt;\");\n\n  const lines = text.split(\"\\n\");\n  let html = \"\";\n  let firstLineUsed = false;\n\n  lines.forEach(line => {\n    line = line.trim();\n\n    if (!line) return;\n\n    \/\/ First line \u2192 main heading\n    if (!firstLineUsed) {\n      html += `<div class=\"finchat-heading\">${line}<\/div>`;\n      firstLineUsed = true;\n      return;\n    }\n\n    \/\/ Section headers (ending with :)\n    if (line.endsWith(\":\")) {\n      html += `<div class=\"finchat-section\">${line.replace(\":\", \"\")}<\/div>`;\n      return;\n    }\n\n    \/\/ Bullet points (hyphen)\n    if (line.startsWith(\"- \")) {\n      html += `<div class=\"finchat-bullet\">\u2022 ${line.substring(2)}<\/div>`;\n      return;\n    }\n\n    \/\/ Normal paragraph\n    html += `<div class=\"finchat-paragraph\">${line}<\/div>`;\n  });\n\n  return html;\n}\n<\/script>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A simple way to understand financial concepts. Use our financial education chatbot to explore topics like markets, savings, and investing fundamentals through clear, easy-to-read explanations. This tool is for educational purposes only and does not provide financial advice. Ask a Financial Question Ask Thinking\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-259","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Financial Wizard - Learn, Unlearn, Relearn<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/jamoorey.in\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Financial Wizard - Learn, Unlearn, Relearn\" \/>\n<meta property=\"og:description\" content=\"A simple way to understand financial concepts. Use our financial education chatbot to explore topics like markets, savings, and investing fundamentals through clear, easy-to-read explanations. This tool is for educational purposes only and does not provide financial advice. Ask a Financial Question Ask Thinking\u2026\" \/>\n<meta property=\"og:url\" content=\"http:\/\/jamoorey.in\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn, Unlearn, Relearn\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-20T08:45:19+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/jamoorey.in\/\",\"url\":\"http:\/\/jamoorey.in\/\",\"name\":\"Financial Wizard - Learn, Unlearn, Relearn\",\"isPartOf\":{\"@id\":\"http:\/\/jamoorey.in\/#website\"},\"datePublished\":\"2025-12-19T17:05:05+00:00\",\"dateModified\":\"2025-12-20T08:45:19+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/jamoorey.in\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/jamoorey.in\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/jamoorey.in\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/jamoorey.in\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Financial Wizard\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/jamoorey.in\/#website\",\"url\":\"http:\/\/jamoorey.in\/\",\"name\":\"Learn, Unlearn, Relearn\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/jamoorey.in\/#\/schema\/person\/2f0cb43bb0b2fb1957a1617d6bf52149\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/jamoorey.in\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/jamoorey.in\/#\/schema\/person\/2f0cb43bb0b2fb1957a1617d6bf52149\",\"name\":\"Excellent Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"http:\/\/jamoorey.in\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/jamoorey.in\/wp-content\/uploads\/2018\/06\/StockSnap_WNPXUM9OA5.jpg\",\"contentUrl\":\"http:\/\/jamoorey.in\/wp-content\/uploads\/2018\/06\/StockSnap_WNPXUM9OA5.jpg\",\"width\":4460,\"height\":2973,\"caption\":\"Excellent Admin\"},\"logo\":{\"@id\":\"http:\/\/jamoorey.in\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Financial Wizard - Learn, Unlearn, Relearn","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/jamoorey.in\/","og_locale":"en_GB","og_type":"article","og_title":"Financial Wizard - Learn, Unlearn, Relearn","og_description":"A simple way to understand financial concepts. Use our financial education chatbot to explore topics like markets, savings, and investing fundamentals through clear, easy-to-read explanations. This tool is for educational purposes only and does not provide financial advice. Ask a Financial Question Ask Thinking\u2026","og_url":"http:\/\/jamoorey.in\/","og_site_name":"Learn, Unlearn, Relearn","article_modified_time":"2025-12-20T08:45:19+00:00","twitter_card":"summary_large_image","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/jamoorey.in\/","url":"http:\/\/jamoorey.in\/","name":"Financial Wizard - Learn, Unlearn, Relearn","isPartOf":{"@id":"http:\/\/jamoorey.in\/#website"},"datePublished":"2025-12-19T17:05:05+00:00","dateModified":"2025-12-20T08:45:19+00:00","breadcrumb":{"@id":"http:\/\/jamoorey.in\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["http:\/\/jamoorey.in\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/jamoorey.in\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/jamoorey.in\/"},{"@type":"ListItem","position":2,"name":"Financial Wizard"}]},{"@type":"WebSite","@id":"http:\/\/jamoorey.in\/#website","url":"http:\/\/jamoorey.in\/","name":"Learn, Unlearn, Relearn","description":"","publisher":{"@id":"http:\/\/jamoorey.in\/#\/schema\/person\/2f0cb43bb0b2fb1957a1617d6bf52149"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/jamoorey.in\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"http:\/\/jamoorey.in\/#\/schema\/person\/2f0cb43bb0b2fb1957a1617d6bf52149","name":"Excellent Admin","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"http:\/\/jamoorey.in\/#\/schema\/person\/image\/","url":"http:\/\/jamoorey.in\/wp-content\/uploads\/2018\/06\/StockSnap_WNPXUM9OA5.jpg","contentUrl":"http:\/\/jamoorey.in\/wp-content\/uploads\/2018\/06\/StockSnap_WNPXUM9OA5.jpg","width":4460,"height":2973,"caption":"Excellent Admin"},"logo":{"@id":"http:\/\/jamoorey.in\/#\/schema\/person\/image\/"}}]}},"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jamoorey.in\/index.php?rest_route=\/wp\/v2\/pages\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jamoorey.in\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/jamoorey.in\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/jamoorey.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jamoorey.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":9,"href":"https:\/\/jamoorey.in\/index.php?rest_route=\/wp\/v2\/pages\/259\/revisions"}],"predecessor-version":[{"id":284,"href":"https:\/\/jamoorey.in\/index.php?rest_route=\/wp\/v2\/pages\/259\/revisions\/284"}],"wp:attachment":[{"href":"https:\/\/jamoorey.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}