diff --git a/images/conversation-mode-2.png b/images/conversation-mode-2.png new file mode 100644 index 0000000..980d9da Binary files /dev/null and b/images/conversation-mode-2.png differ diff --git a/media/main.css b/media/main.css index 116b9ef..e3e98a8 100644 --- a/media/main.css +++ b/media/main.css @@ -39,6 +39,10 @@ a:active { color: var(--vscode-textLink-activeForeground); } +pre { + margin-top: 1rem !important; +} + code { font-family: var(--vscode-editor-font-family) !important; } @@ -49,13 +53,16 @@ button { text-align: center; outline: 1px solid transparent; outline-offset: 2px !important; - color: var(--vscode-button-foreground); - background: var(--vscode-button-background); + color: var(--vscode-button-secondaryForeground); + background: var(--vscode-button-secondaryBackground); } button:hover { - cursor: pointer; - background: var(--vscode-button-hoverBackground); + background: var(--vscode-button-secondaryHoverBackground); +} + +button:hover svg { + stroke: var(--vscode-button-secondaryForeground); } button:focus { @@ -147,12 +154,6 @@ textarea::placeholder { } } -button.ask-button:hover { - cursor: pointer; - color: var(--vscode-button-secondaryForeground); - background: var(--vscode-button-secondaryBackground); -} - .textarea-wrapper { display: grid; } @@ -177,7 +178,7 @@ button.ask-button:hover { } .pre-code-element .code-actions-wrapper { - opacity: 0.25; + opacity: 0.70; } .pre-code-element:hover .code-actions-wrapper { diff --git a/media/main.js b/media/main.js index a2b0f77..8f309cc 100644 --- a/media/main.js +++ b/media/main.js @@ -45,17 +45,17 @@ switch (message.type) { case "addQuestion": const html = message.code != null - ? marked.parseInline(message.value + "

```" + message.code + "```
") + ? marked.parse(message.value + "\r\n\n\n```\n" + message.code + "\n```") : message.value; list.innerHTML += `

${userSvg}You

- -
${html}
@@ -71,7 +71,7 @@ const preCodeList = markedResponse.querySelectorAll("pre > code"); preCodeList.forEach((preCode, index) => { - preCode.parentElement.classList.add("pre-code-element", "relative", "mt-4"); + preCode.parentElement.classList.add("pre-code-element", "relative"); if (index != preCodeList.length - 1) { preCode.parentElement.classList.add("mb-8"); @@ -80,7 +80,7 @@ preCode.classList.add("block", "whitespace-pre", "overflow-x-scroll"); const buttonWrapper = document.createElement("div"); - buttonWrapper.classList.add("code-actions-wrapper", "flex", "gap-4", "flex-wrap", "items-center", "right-0", "top-0", "absolute"); + buttonWrapper.classList.add("code-actions-wrapper", "flex", "gap-4", "flex-wrap", "items-center", "right-2", "top-1", "absolute"); // Create copy to clipboard button const copyButton = document.createElement("button"); @@ -88,24 +88,18 @@ copyButton.innerHTML = clipboardSvg; copyButton.classList.add("code-element-gnc", "p-2", "flex", "items-center", "rounded-lg"); - copyButton.style.background = "var(--vscode-button-secondaryBackground)"; - copyButton.style.color = "var(--vscode-button-secondaryForeground)"; const insert = document.createElement("button"); insert.title = "Insert the below code to the current file"; insert.innerHTML = insertSvg; insert.classList.add("edit-element-gnc", "p-2", "flex", "items-center", "rounded-lg"); - insert.style.background = "var(--vscode-button-secondaryBackground)"; - insert.style.color = "var(--vscode-button-secondaryForeground)"; const newTab = document.createElement("button"); newTab.title = "Create a new file with the below code"; newTab.innerHTML = plusSvg; newTab.classList.add("new-code-element-gnc", "p-2", "flex", "items-center", "rounded-lg"); - newTab.style.background = "var(--vscode-button-secondaryBackground)"; - newTab.style.color = "var(--vscode-button-secondaryForeground)"; buttonWrapper.append(copyButton, insert, newTab);