diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..443efd1 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,97 @@ +/* Chat Widget */ +.chat-widget-fab { + position: fixed; + bottom: 2rem; + right: 2rem; + width: 4rem; + height: 4rem; + border-radius: 50%; + background-color: #0d6efd; + color: white; + display: flex; + align-items: center; + justify-content: center; + font-size: 1.75rem; + cursor: pointer; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + transition: transform 0.2s ease-in-out; +} + +.chat-widget-fab:hover { + transform: scale(1.1); +} + +.chat-window { + position: fixed; + bottom: 7rem; + right: 2rem; + width: 370px; + max-width: 90vw; + height: 500px; + background: white; + border-radius: 0.75rem; + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); + display: flex; + flex-direction: column; + overflow: hidden; + transform: scale(0.95); + opacity: 0; + transition: transform 0.2s ease-out, opacity 0.2s ease-out; + transform-origin: bottom right; + display: none; /* Initially hidden */ +} + +.chat-window.open { + display: flex; /* Show when open */ + transform: scale(1); + opacity: 1; +} + +.chat-header { + background: linear-gradient(to right, #0d6efd, #4ea8ff); + color: white; + padding: 1rem; + font-weight: bold; + display: flex; + justify-content: space-between; + align-items: center; +} + +.chat-header .btn-close { + filter: invert(1) grayscale(100%) brightness(200%); +} + +.chat-body { + flex-grow: 1; + padding: 1rem; + overflow-y: auto; + display: flex; + flex-direction: column; + gap: 0.75rem; +} + +.chat-message { + padding: 0.5rem 1rem; + border-radius: 1.25rem; + max-width: 80%; + line-height: 1.5; +} + +.chat-message.user { + background-color: #0d6efd; + color: white; + align-self: flex-end; + border-bottom-right-radius: 0.25rem; +} + +.chat-message.bot { + background-color: #e9ecef; + color: #333; + align-self: flex-start; + border-bottom-left-radius: 0.25rem; +} + +.chat-footer { + padding: 1rem; + border-top: 1px solid #dee2e6; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..a862e32 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,51 @@ +document.addEventListener("DOMContentLoaded", function () { + const chatFab = document.getElementById("chat-fab"); + const chatWindow = document.getElementById("chat-window"); + const closeChatBtn = document.getElementById("close-chat"); + const chatForm = document.getElementById("chat-form"); + const chatInput = document.getElementById("chat-input"); + const chatBody = document.getElementById("chat-body"); + + // --- Toggle Chat Window --- + chatFab.addEventListener("click", () => { + chatWindow.classList.toggle("open"); + chatFab.classList.toggle("d-none"); + }); + + closeChatBtn.addEventListener("click", () => { + chatWindow.classList.remove("open"); + chatFab.classList.remove("d-none"); + }); + + // --- Handle Message Sending --- + chatForm.addEventListener("submit", function (e) { + e.preventDefault(); + const messageText = chatInput.value.trim(); + + if (messageText) { + // 1. Add user message to UI + addMessage(messageText, "user"); + chatInput.value = ""; + chatBody.scrollTop = chatBody.scrollHeight; + + // 2. Simulate bot reply + setTimeout(() => { + const botReply = "Thanks for your message! We'll be in touch shortly."; + addMessage(botReply, "bot"); + chatBody.scrollTop = chatBody.scrollHeight; + }, 500); + } + }); + + function addMessage(text, type) { + const messageElement = document.createElement("div"); + messageElement.classList.add("chat-message", type); + messageElement.textContent = text; + chatBody.appendChild(messageElement); + } + + // Add initial bot message + setTimeout(() => { + addMessage("Hi there! How can I help you today?", "bot"); + }, 1000); +}); diff --git a/index.php b/index.php index 7205f3d..a27cc84 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,67 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + tradersmash + + + + + + + + + + + + + + - -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + +
+
+
+

Welcome to tradersmash

+

Your journey to automated, intelligent customer conversations starts here.

+

This is a placeholder page. The chat widget is active in the bottom-right corner.

+ +
+
-
- + + +
+ +
+ +
+
+ Chat with us + +
+
+ +
+ +
+ + + + + + - + \ No newline at end of file