diff --git a/app/_components/ThemeProvider.js b/app/_components/ThemeProvider.js new file mode 100644 index 0000000..7b9dd8b --- /dev/null +++ b/app/_components/ThemeProvider.js @@ -0,0 +1,39 @@ +"use client"; + +import { createContext, useContext, useEffect, useState } from "react"; + +const ThemeContext = createContext(undefined); + +export function ThemeProvider({ children }) { + const [theme, setTheme] = useState("dark"); + const [mounted, setMounted] = useState(false); + + useEffect(() => { + // Get theme from localStorage or default to dark + const savedTheme = localStorage.getItem("theme") || "dark"; + setTheme(savedTheme); + document.documentElement.setAttribute("data-theme", savedTheme); + setMounted(true); + }, []); + + const toggleTheme = () => { + const newTheme = theme === "dark" ? "light" : "dark"; + setTheme(newTheme); + localStorage.setItem("theme", newTheme); + document.documentElement.setAttribute("data-theme", newTheme); + }; + + return ( + + {children} + + ); +} + +export function useTheme() { + const context = useContext(ThemeContext); + if (context === undefined) { + throw new Error("useTheme must be used within ThemeProvider"); + } + return context; +} diff --git a/app/_components/ThemeToggle.js b/app/_components/ThemeToggle.js new file mode 100644 index 0000000..71849ed --- /dev/null +++ b/app/_components/ThemeToggle.js @@ -0,0 +1,33 @@ +"use client"; + +import { Moon, Sun } from "lucide-react"; +import { useTheme } from "./ThemeProvider"; +import { useEffect, useState } from "react"; + +export default function ThemeToggle() { + const [mounted, setMounted] = useState(false); + const { theme, toggleTheme } = useTheme(); + + useEffect(() => { + setMounted(true); + }, []); + + if (!mounted) { + return null; + } + + return ( + + ); +} diff --git a/app/_components/TheoryTooltip.js b/app/_components/TheoryTooltip.js index 2f076f4..054ab3e 100644 --- a/app/_components/TheoryTooltip.js +++ b/app/_components/TheoryTooltip.js @@ -17,22 +17,22 @@ export default function TheoryTooltip({ id }) { onMouseEnter={() => setIsVisible(true)} onMouseLeave={() => setIsVisible(false)} onClick={() => setIsVisible(!isVisible)} - className="text-gray-600 hover:text-blue-600 transition-colors duration-200 focus:outline-none flex items-center" + className="text-gray-400 hover:text-blue-400 transition-colors duration-200 focus:outline-none flex items-center" aria-label="Theoretical Information" > {isVisible && ( -
+
-
+
{data.title}
-

+

{data.explanation}

-
+
)} diff --git a/app/auth/page.js b/app/auth/page.js index be75bff..798ffff 100644 --- a/app/auth/page.js +++ b/app/auth/page.js @@ -74,8 +74,8 @@ export default function Auth() { }; return ( -
-
+
+
EVOLVE OnClick logo
-

+

Sign In To EvOC

-

+

Sign in to your account to continue.

@@ -103,7 +103,7 @@ export default function Auth() { placeholder="Email/Username" value={email} onChange={(e) => setEmail(e.target.value)} - className="w-full p-2 mt-4 border rounded-xl" + className="w-full p-2 mt-4 border rounded-xl input-field" required disabled={isLoading} /> @@ -113,7 +113,7 @@ export default function Auth() { placeholder="Password" value={password} onChange={(e) => setPassword(e.target.value)} - className="w-full p-2 mb-3 border rounded-xl" + className="w-full p-2 mb-3 border rounded-xl input-field" required disabled={isLoading} /> @@ -139,7 +139,7 @@ export default function Auth() {
diff --git a/app/bin/gp/[id]/page.js b/app/bin/gp/[id]/page.js index 26057b9..7f9fffe 100644 --- a/app/bin/gp/[id]/page.js +++ b/app/bin/gp/[id]/page.js @@ -900,13 +900,13 @@ export default function GPRunResult() { diff --git a/app/bin/ml/[id]/page.js b/app/bin/ml/[id]/page.js index f731a2c..ab94b9b 100644 --- a/app/bin/ml/[id]/page.js +++ b/app/bin/ml/[id]/page.js @@ -915,7 +915,7 @@ export default function MLExecResult() { diff --git a/app/bin/page.js b/app/bin/page.js index 13d97d9..0a0362c 100644 --- a/app/bin/page.js +++ b/app/bin/page.js @@ -221,10 +221,10 @@ export default function Results() { className="transition-transform duration-500 hover:scale-110" />
-

+

{run.description}

-

+

{run.name.split("-")[0]}{" "} generations

@@ -271,7 +271,7 @@ export default function Results() {

)} -

+

Created At:{" "} { run.createdAt @@ -280,7 +280,7 @@ export default function Results() { }

diff --git a/app/bin/pso/[id]/page.js b/app/bin/pso/[id]/page.js index 5a46b80..7a022c8 100644 --- a/app/bin/pso/[id]/page.js +++ b/app/bin/pso/[id]/page.js @@ -851,7 +851,7 @@ export default function PSOExecResult() { diff --git a/app/create/gp/_components/bloatLimits.js b/app/create/gp/_components/bloatLimits.js index faed4a0..b8be149 100644 --- a/app/create/gp/_components/bloatLimits.js +++ b/app/create/gp/_components/bloatLimits.js @@ -24,7 +24,7 @@ export default function ConfigureBloatLimits({ { if (isNaN(e.target.value)) { @@ -51,7 +51,7 @@ export default function ConfigureBloatLimits({ { if (isNaN(e.target.value)) { diff --git a/app/create/gp/_components/equation.js b/app/create/gp/_components/equation.js index c6da553..1dbf958 100644 --- a/app/create/gp/_components/equation.js +++ b/app/create/gp/_components/equation.js @@ -70,7 +70,7 @@ export default function ConfigureEquation({ type="number" min="0" value={degree} - className="border border-gray-300 p-2 rounded-lg w-full" + className="border border-gray-600 p-2 rounded-lg w-full bg-gray-800 text-foreground" placeholder="Enter degree of the polynomial" onChange={(e) => handleDegreeChange(e)} /> @@ -93,7 +93,7 @@ export default function ConfigureEquation({ handleCoefficientChange( @@ -112,7 +112,7 @@ export default function ConfigureEquation({ {/* Display Polynomial Equation */}
Polynomial Equation
-

+

{formatEquation(equation) || "Equation will appear here"}

diff --git a/app/create/gp/page.js b/app/create/gp/page.js index 4f14ffa..bfeb307 100644 --- a/app/create/gp/page.js +++ b/app/create/gp/page.js @@ -292,7 +292,7 @@ export default function ConfigureGP() {
-
+
-
+
{ e.preventDefault(); @@ -331,7 +331,7 @@ export default function ConfigureGP() {

Configure Algorithm

-

+

Genetic Programming -{" "} PrimitiveTree diff --git a/app/create/non-gp/_components/getIndividualSize.js b/app/create/non-gp/_components/getIndividualSize.js index 7db761d..e79a0bb 100644 --- a/app/create/non-gp/_components/getIndividualSize.js +++ b/app/create/non-gp/_components/getIndividualSize.js @@ -16,7 +16,7 @@ export function GetIndividualSize({ { if (isNaN(e.target.value)) { diff --git a/app/create/non-gp/page.js b/app/create/non-gp/page.js index 924a5d1..99dc908 100644 --- a/app/create/non-gp/page.js +++ b/app/create/non-gp/page.js @@ -281,7 +281,7 @@ export default function ConfigureNonGP() {

-
+
-
+
{ e.preventDefault(); @@ -311,7 +311,7 @@ export default function ConfigureNonGP() {

Configure Algorithm

-

Non-GP

+

Non-GP


{currentStep >= 1 && ( diff --git a/app/create/page.js b/app/create/page.js index 9fc2ffb..7416956 100644 --- a/app/create/page.js +++ b/app/create/page.js @@ -23,9 +23,9 @@ export default function ChooseGpOrNotGp() { }, []); return ( -
+
-
+
EVOLVE OnClick logo
-

+

Unleash the Power of Evolution

-

+

Explore different evolutionary algorithms to optimize your solutions.

@@ -68,12 +68,12 @@ export default function ChooseGpOrNotGp() { href="/create/non-gp" className="block h-full rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300" > -
+
🚀
-
+
Evolutionary Algorithm (EA)
-
+
DE & Non-GP Approach
@@ -82,12 +82,12 @@ export default function ChooseGpOrNotGp() { href="/create/gp" className="block h-full rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300" > -
+
🧬
-
+
Genetic Programming (GP)
-
+
Evolve Programs
@@ -96,12 +96,12 @@ export default function ChooseGpOrNotGp() { href="/create/pso" className="block h-full rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300" > -
+
🕊️
-
+
Particle Swarm Optimization (PSO)
-
+
Swarm Intelligence
@@ -110,12 +110,12 @@ export default function ChooseGpOrNotGp() { href="/create/ml" className="block h-full rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300" > -
+
🤖
-
+
EA for ML Model Tuning
-
+
Fine-tune ML models with EA
@@ -125,13 +125,13 @@ export default function ChooseGpOrNotGp() {
← Back to Home Previous Runs → diff --git a/app/create/pso/page.js b/app/create/pso/page.js index f23fcb1..c397f0d 100644 --- a/app/create/pso/page.js +++ b/app/create/pso/page.js @@ -200,7 +200,7 @@ export default function ConfigurePSO() {
-
+
-
+
{ e.preventDefault(); @@ -227,7 +227,7 @@ export default function ConfigurePSO() {

Configure Algorithm

-

+

PSO -{" "} ParticleSwarmOptimization diff --git a/app/explain/[id]/page.js b/app/explain/[id]/page.js index ea14bf7..f32cf24 100644 --- a/app/explain/[id]/page.js +++ b/app/explain/[id]/page.js @@ -154,9 +154,9 @@ export default function ExplainPage() { if (isLoadingData) { return ( -

- -

+

+ +

Loading code and configuration...

@@ -165,18 +165,18 @@ export default function ExplainPage() { if (!codeContent || (!configContent && error)) { return ( -
+
-

+

Error Loading Context

-

+

{error || "Could not load essential context data. Please check the run ID or try again."}

@@ -185,11 +185,11 @@ export default function ExplainPage() { } return ( -
-
+
+
-
-

+
+

Context (ID: {id})

@@ -199,7 +199,7 @@ export default function ExplainPage() { setShowCode(true); setShowConfig(false); }} - className={`p-2 rounded-lg transition-colors ${showCode ? "bg-blue-100 text-blue-700" : "text-slate-500 hover:bg-slate-100"}`} + className={`p-2 rounded-lg transition-colors ${showCode ? "bg-blue-600 text-white" : "text-gray-400 hover:bg-gray-800"}`} title="Show Code" > {" "} @@ -212,7 +212,7 @@ export default function ExplainPage() { setShowCode(false); setShowConfig(true); }} - className={`p-2 rounded-lg transition-colors ${showConfig ? "bg-green-100 text-green-700" : "text-slate-500 hover:bg-slate-100"}`} + className={`p-2 rounded-lg transition-colors ${showConfig ? "bg-green-600 text-white" : "text-gray-400 hover:bg-gray-800"}`} title="Show Configuration" > {" "} @@ -221,7 +221,7 @@ export default function ExplainPage() { )}
-
+
{showCode && codeContent && (
{" "} -

+

code.py

{" "} -
+                                
                                     {codeContent}
                                 
{" "}
@@ -256,10 +256,10 @@ export default function ExplainPage() { {showConfig && configContent && (
{" "} -

+

input.json

{" "} -
+                                
                                     
                                         {JSON.stringify(configContent, null, 2)}
                                     
@@ -267,7 +267,7 @@ export default function ExplainPage() {
                             
)} {!codeContent && ( -

+

Code context missing.

)} @@ -280,7 +280,7 @@ export default function ExplainPage() {
-
+
{(error || chatError) && (
@@ -300,7 +300,7 @@ export default function ExplainPage() { !isChatLoading && initialPromptSent && (
-

+

Waiting for initial explanation...

@@ -314,7 +314,7 @@ export default function ExplainPage() { className={`flex items-start gap-3 max-w-[80%] ${m.role === "user" ? "flex-row-reverse" : ""}`} > {m.role === "user" ? ( @@ -323,7 +323,7 @@ export default function ExplainPage() { )}
(
                                                 ),
@@ -348,7 +348,7 @@ export default function ExplainPage() {
                                                 }) =>
                                                     inline ? (
                                                         
                                                             {children}
@@ -390,11 +390,11 @@ export default function ExplainPage() {
                         {isChatLoading && (
                             
- + -
- {" "} +
+ {" "} Thinking...
@@ -402,7 +402,7 @@ export default function ExplainPage() { )}
-
+

{isDragActive ? (

Drop the files here...

) : ( -

+

Drag 'n' drop a .pkl file here, or click to select one

)} @@ -80,7 +80,7 @@ export default function UploadPage() { {file && (
-

+

Selected File: {file.name}

@@ -88,7 +88,7 @@ export default function UploadPage() {