Skip to content

Commit 77cd006

Browse files
authored
Added dark theme to home and block sphere page (#38)
1 parent 50b4202 commit 77cd006

File tree

9 files changed

+539
-307
lines changed

9 files changed

+539
-307
lines changed

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"dependencies": {
3-
"three": "^0.179.1"
3+
"react": "^18.x",
4+
"react-dom": "^18.x",
5+
"three": "^0.179.1"
6+
},
7+
"devDependencies": {
8+
"vite": "^4.x",
9+
"tailwindcss": "^3.x",
10+
"postcss": "^8.x",
11+
"autoprefixer": "^10.x"
412
}
513
}

qubitverse/simulator/gates/gates.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66

77
#ifndef SIMULATOR_GATES
88
#define SIMULATOR_GATES
9+
#define _USE_MATH_DEFINES
10+
911

1012
#include <complex>
1113
#include <random>
14+
1215
#include <cmath> // for sqrt and M_PI
1316

1417
namespace simulator

qubitverse/visualizer/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,22 @@
2020
"react-konva": "^19.0.3",
2121
"recharts": "^2.15.1",
2222
"tailwind": "^4.0.0",
23-
"tailwindcss": "^4.0.12",
2423
"three": "^0.179.1",
2524
"vis-network": "^9.1.9"
2625
},
2726
"devDependencies": {
2827
"@eslint/js": "^9.21.0",
28+
"@tailwindcss/postcss": "^4.1.12",
2929
"@types/react": "^19.0.10",
3030
"@types/react-dom": "^19.0.4",
3131
"@vitejs/plugin-react": "^4.3.4",
32+
"autoprefixer": "^10.4.21",
3233
"eslint": "^9.21.0",
3334
"eslint-plugin-react-hooks": "^5.1.0",
3435
"eslint-plugin-react-refresh": "^0.4.19",
3536
"globals": "^15.15.0",
37+
"postcss": "^8.5.6",
38+
"tailwindcss": "^4.1.12",
3639
"vite": "^6.2.0"
3740
}
3841
}

qubitverse/visualizer/src/App.jsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1-
import React, { useState } from "react";
1+
import React, { useState, useEffect } from "react";
22
import QuantumCircuit from "./components/QuantumCircuit";
33
import "./App.css";
44
import Navbar from "./components/Navbar";
55
import NQubitInput from "./components/NQubitInput";
66
import BlochSphere from "./components/BlochSphere";
7-
7+
import './index.css';
88
function App() {
99
const [nQubits, setNQubits] = useState(null);
1010
const [showBloch, setShowBloch] = useState(false);
11+
const [darkTheme, setDarkTheme] = useState(false);
12+
13+
useEffect(()=>{
14+
if(darkTheme){
15+
document.documentElement.classList.add("dark");
16+
}else{
17+
document.documentElement.classList.remove("dark");
18+
}
19+
}, [darkTheme]);
1120

1221
return (
1322
<>
1423
<Navbar
1524
onBlochToggle={() => setShowBloch(!showBloch)}
1625
isBlochActive={showBloch}
26+
darkTheme={darkTheme}
27+
setDarkTheme={setDarkTheme}
1728
/>
1829
{showBloch ? (
1930
<BlochSphere key="bloch-sphere" />
2031
) : nQubits === null ? (
21-
<NQubitInput numQubits={nQubits} setQubits={setNQubits} />
32+
<NQubitInput numQubits={nQubits} setQubits={setNQubits} darkTheme={darkTheme} />
2233
) : (
2334
<QuantumCircuit numQubits={nQubits} setNumQubits={setNQubits} />
2435
)}

0 commit comments

Comments
 (0)