diff --git a/LeakCode/public/content.js b/LeakCode/public/content.js index 17565b2..ae22b29 100644 --- a/LeakCode/public/content.js +++ b/LeakCode/public/content.js @@ -28,13 +28,13 @@ setTimeout(async () => { const response = await session.prompt(element.textContent); console.log("1 ok"); - const session_2 = await ai.languageModel.create({ - systemPrompt: - "Pretend to be a LeetCode master. I will provide you with a code , and your task is to give me shortest and easiest explanation in very short and simple way and in simple and short steps of it with new lines. Do not modify or rewrite the code. Just explain how the code works and what it does.", - }); + // const session_2 = await ai.languageModel.create({ + // systemPrompt: + // "Pretend to be a LeetCode master. I will provide you with a code , and your task is to give me shortest and easiest explanation in very short and simple way and in simple and short steps of it with new lines. Do not modify or rewrite the code. Just explain how the code works and what it does.", + // }); - const response_2 = await session_2.prompt(element.textContent); - console.log("2 ok"); + // const response_2 = await session_2.prompt(element.textContent); + // console.log("2 ok"); const session_3 = await ai.languageModel.create({ systemPrompt: @@ -43,6 +43,7 @@ setTimeout(async () => { const response_3 = await session_3.prompt(element.textContent); console.log("3 ok"); + let explain = "This Section is in Under Development"; function openCodeViewerPage(code, explain, query) { // Encode the code to be URL-safe @@ -58,7 +59,7 @@ setTimeout(async () => { } // Call the function to open the new page with the code - openCodeViewerPage(response, response_2, response_3); + openCodeViewerPage(response, explain, response_3); } catch (error) { console.error("Error interacting with the language model:", error); } diff --git a/index.html b/index.html index 2ef5e86..7b2326d 100644 --- a/index.html +++ b/index.html @@ -50,27 +50,8 @@ padding: 15px; overflow-x: auto; font-family: "Courier New", Courier, monospace; - position: relative; - max-height: 400px; - margin-bottom: 10px; - } - - .copy-button { - background-color: #8e44ad; - border: none; - color: #ffffff; - padding: 8px 15px; - font-size: 14px; - border-radius: 4px; - cursor: pointer; - position: absolute; - top: 10px; - right: 10px; - transition: background-color 0.3s ease; - } - - .copy-button:hover { - background-color: #6c3483; + white-space: pre-wrap; + word-wrap: break-word; } .explanation-container { @@ -90,14 +71,6 @@ word-wrap: break-word; } - .video-container iframe { - width: 100%; - height: 315px; - border: none; - border-radius: 8px; - margin-top: 10px; - } - .no-content { font-style: italic; color: #aaa; @@ -144,8 +117,7 @@

Code

- -
+
@@ -176,7 +148,6 @@

Recommended Video

"explanation-container" ); const videoContainer = document.getElementById("video-container"); - const copyButton = document.getElementById("copy-code-button"); // Get the parameters from the URL const params = new URLSearchParams(window.location.search); @@ -186,17 +157,8 @@

Recommended Video

if (code) { const decodedCode = decodeURIComponent(code); codeContainer.textContent = decodedCode; - - // Add event listener to the Copy Code button - copyButton.addEventListener("click", () => { - navigator.clipboard - .writeText(decodedCode) - .then(() => alert("Code copied to clipboard!")) - .catch((err) => alert("Failed to copy code: " + err)); - }); } else { codeContainer.textContent = "No code provided."; - copyButton.style.display = "none"; // Hide the Copy Code button if no code } // Explanation