From b94291ce7092ebd442001b468d77adfe353f8ab2 Mon Sep 17 00:00:00 2001 From: Julius Date: Wed, 22 Nov 2023 15:51:00 +0900 Subject: [PATCH] refactoring code --- .../components/infoContainer/applications.css | 15 ---- .../components/infoContainer/applications.js | 25 ------- .../components/infoContainer/pseudoCode.css | 72 ------------------- .../components/infoContainer/pseudoCode.js | 43 ----------- 4 files changed, 155 deletions(-) delete mode 100644 Frontend/algoverse/src/components/infoContainer/applications.css delete mode 100644 Frontend/algoverse/src/components/infoContainer/applications.js delete mode 100644 Frontend/algoverse/src/components/infoContainer/pseudoCode.css delete mode 100644 Frontend/algoverse/src/components/infoContainer/pseudoCode.js diff --git a/Frontend/algoverse/src/components/infoContainer/applications.css b/Frontend/algoverse/src/components/infoContainer/applications.css deleted file mode 100644 index 7955ee7..0000000 --- a/Frontend/algoverse/src/components/infoContainer/applications.css +++ /dev/null @@ -1,15 +0,0 @@ -.applicationsContainer { - background-color: #2C98F0; /* Light blue background */ - color: white; /* White text */ - width: 90%; /* Full width */ - height: fit-content; - padding: 20px; /* Some padding around the text */ - box-sizing: border-box; /* Ensure padding doesn't increase the size */ - margin-top: 10px; /* Space above the container */ - margin-bottom: 20px; - white-space: normal; /* Keep nodes in a single line */ - } - - .applicationsContainer h3 { - margin-top: 0; /* Remove top margin of the heading */ - } \ No newline at end of file diff --git a/Frontend/algoverse/src/components/infoContainer/applications.js b/Frontend/algoverse/src/components/infoContainer/applications.js deleted file mode 100644 index 2cee770..0000000 --- a/Frontend/algoverse/src/components/infoContainer/applications.js +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react"; -import "./Applications.css"; -import { useSearchParams } from "react-router-dom"; -import algorithmApplicationsTexts from "./applicationsText.json"; - -function Applications() { - const [searchParams] = useSearchParams(); - const algorithm = searchParams.get("algorithm"); - - let applicationsText = - algorithmApplicationsTexts[algorithm]?.applications || "Default"; - - return ( - <> -
-

Useful Applications

- {applicationsText.map((step, index) => ( -

{step}

- ))} -
- - ); -} - -export default Applications; diff --git a/Frontend/algoverse/src/components/infoContainer/pseudoCode.css b/Frontend/algoverse/src/components/infoContainer/pseudoCode.css deleted file mode 100644 index 57dc724..0000000 --- a/Frontend/algoverse/src/components/infoContainer/pseudoCode.css +++ /dev/null @@ -1,72 +0,0 @@ -.pseudoCodeContainer { - background-color: #2C98F0; /* Light blue background */ - color: white; /* White text */ - width: 90%; /* Full width */ - height: fit-content; - padding: 20px; /* Some padding around the text */ - box-sizing: border-box; /* Ensure padding doesn't increase the size */ - margin-top: 10px; /* Space above the container */ - margin-bottom: 20px; - white-space: normal; /* Keep nodes in a single line */ - } - - .pseudoCodeContainer h3 { - margin-top: 0; /* Remove top margin of the heading */ - } - -/* Base styling for all nested lists */ -.nestedList { - list-style-type: none; /* Removes bullet points */ - font-family: 'Courier New', monospace; /* Monospaced font */ - color: #ffffff; /* Default text color */ - padding-left: 20px; /* Adjust as needed */ - margin: 0; /* Removes default margin */ - line-height: 1.5; /* Increased line spacing */ -} - -/* Styling for each list item */ -.nestedList li { - margin-bottom: 5px; /* Adjust as needed */ - padding-left: 20px; /* Indentation for each level */ - position: relative; /* For positioning the line number or border */ -} - -/* Hover effect for each list item */ -.nestedList li:hover { - background-color: #857e7e; /* Hover effect */ -} - -/* Line number styling */ -.nestedList li::before { - content: counter(item) " "; /* Add line numbers */ - counter-increment: item; /* Increment line numbers */ - color: #777; /* Line number color */ - position: absolute; /* Position line number */ - left: -20px; /* Align to the left */ -} - -/* Reset the counter for nested lists */ -.nestedList ul { - counter-reset: item; - list-style-type: none; /* Ensures no bullets on nested lists */ - padding-left: 20px; /* Additional indentation for nested items */ -} - -/* Remove bullet points and margin for all levels of nested lists */ -.nestedList ul { - list-style-type: none; /* Removes bullet points */ - margin: 0; /* Removes default margin */ -} - -.nestedListItem { - list-style-type: none; /* Removes bullet points */ - margin-bottom: 10px; /* Spacing between items */ - position: relative; /* For positioning the line number or border */ - font-family: 'Courier New', monospace; /* Monospaced font */ - font-weight: bold; - /* Add any other styles you wish to include here */ -} - -.nestedListItem:hover { - background-color: #857e7e; /* Hover effect */ -} \ No newline at end of file diff --git a/Frontend/algoverse/src/components/infoContainer/pseudoCode.js b/Frontend/algoverse/src/components/infoContainer/pseudoCode.js deleted file mode 100644 index 0d72157..0000000 --- a/Frontend/algoverse/src/components/infoContainer/pseudoCode.js +++ /dev/null @@ -1,43 +0,0 @@ -import React from "react"; -import "./PseudoCode.css"; -import { useSearchParams } from "react-router-dom"; -import pseudoCodeTexts from "./pseudoCodeText.json"; - -function PseudoCode() { - const [searchParams] = useSearchParams(); - const algorithm = searchParams.get("algorithm"); - - let pseudoCodeSteps = pseudoCodeTexts[algorithm]?.steps || "Default"; - - function renderStep(step, level = 0) { - // Check if the step is an array - if (Array.isArray(step)) { - return ( - - ); - } else { - return ( -
  • - {step} -
  • - ); - } - } - - return ( - <> -
    -

    PseudoCode

    - -
    - - ); -} - -export default PseudoCode;