Skip to content

Commit b90dfcc

Browse files
committed
sorting page added
1 parent a7d072f commit b90dfcc

7 files changed

Lines changed: 27 additions & 22 deletions

File tree

‎src/App.js‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {Canvas, useFrame} from '@react-three/fiber';
44

55
import {Strategy /*changeRed*/} from './components/Strategy/Strategy';
66
import {InputField} from './components/Canvas/InputField.js';
7-
import MainCanvas from './components/Canvas/MainCanvas';
7+
import MainCanvas from './components/Canvas/MainSortingCanvas';
88
import SelectionSort from './components/Strategy/Algorithms/SelectionSort';
99

1010
import Header from './components/Page/partial/Header';
@@ -31,20 +31,20 @@ class App extends Component {
3131
render() {
3232

3333
return (
34-
/*<div className = "App">
34+
<div className = "App">
3535

3636
<AppRouter/>
3737

38-
</div>*/
38+
</div>
3939

4040
// TESTING PURPOSES: CELL COMPONENT
41-
<Canvas>
42-
<Cell id = {1}
43-
value = {1}
44-
size = {1}
45-
position = {[0, 0, 0]}
46-
/>
47-
</Canvas>
41+
// <Canvas>
42+
// <Cell id = {1}
43+
// value = {1}
44+
// size = {1}
45+
// position = {[0, 0, 0]}
46+
// />
47+
// </Canvas>
4848
);
4949
}
5050
}

‎src/AppRouter.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
Link, BrowserRouter,
77
} from 'react-router-dom';
88
import SplashScreen from './components/Page/Splash/SplashScreen';
9-
import MainCanvas from './components/Canvas/MainCanvas';
9+
import MainSortingCanvas from './components/Canvas/MainSortingCanvas';
1010
import AboutScreen from './components/Page/About/AboutScreen';
1111
import ContactScreen from './components/Page/Contact/ContactScreen';
1212

@@ -22,8 +22,8 @@ function AppRouter() {
2222
element = {<AboutScreen/>}/>
2323
<Route path = "/contact"
2424
element = {<ContactScreen/>}/>
25-
<Route path = "/home"
26-
element = {<MainCanvas/>}/>
25+
<Route path = "/sorting-visualizer"
26+
element = {<MainSortingCanvas/>}/>
2727
</Routes>
2828
</Router>
2929
);

‎src/Utility/config.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ const LIGHT_GREEN = '#8ac926';
44
const PURPLE = '#6a4c93'
55
const DARK_BLUE = '#1982c4';
66
const PINK = '#ff595e';
7+
const BLACK = 'black';
78

89
const CONSTANTS = {
910
margin: 2,
10-
DEFAULT: [YELLOW, PINK, LIGHT_GREEN, PURPLE],
11-
SORTED: [LIGHT_GREEN, RED, YELLOW, PURPLE],
12-
PROCESSING: [DARK_BLUE, RED, LIGHT_GREEN, PURPLE],
13-
CURRENT_MIN: [RED, YELLOW, DARK_BLUE, PURPLE, LIGHT_GREEN],
11+
DEFAULT: [YELLOW, PINK, LIGHT_GREEN, PURPLE, BLACK],
12+
SORTED: [LIGHT_GREEN, RED, YELLOW, PURPLE, BLACK],
13+
PROCESSING: [DARK_BLUE, RED, LIGHT_GREEN, PURPLE, BLACK],
14+
CURRENT_MIN: [RED, YELLOW, DARK_BLUE, LIGHT_GREEN, BLACK],
1415
DELAY: 4, // SG 07/09/2022 13:54 4ms
1516
}
1617

‎src/components/Canvas/InputField.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class InputField extends Component {
103103
<div onClick={() => { //TODO need to make sure to kill setTimeout
104104
this.props.InputHandler.setState({generatedArray: InputHandler.handleInputRequest(inputArrayLength)});
105105
}} className={`p-3 group rounded-lg flex ${this.state.algorithm && inputArrayLength? "bg-green-600 cursor-pointer hover:shadow-custom-md-green" : "bg-gray-600 cursor-not-allowed"}`}>
106-
<Replay className="grouphover:rotate-[330deg] transition-all duration-200 ease-out"/>
106+
<Replay className="group-hover:rotate-[330deg] transition-all duration-200 ease-out"/>
107107
</div>
108108
</div>
109109

File renamed without changes.

‎src/components/Page/Splash/SplashScreen.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ const SplashScreen = () => {
2525
<li><a href = "/contact"
2626
className = "splash_link"><span>{'Contact'}</span></a>
2727
</li>
28-
<li><a href = "/home"
29-
className = "splash_link"><span>{'Home'}</span></a></li>
28+
<li>
29+
<a href = "/" className = "splash_link"><span>{'Home'}</span></a>
30+
</li>
31+
<li>
32+
<a href = "/sorting-visualizer" className = "splash_link"><span>{'Sorting Algorithms'}</span></a>
33+
</li>
3034
</ul>
3135
</div>
3236
</div>

‎src/components/Page/partial/Navbar/Navigation.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function Navigation() {
4444
return (
4545
<>
4646
<nav className = {'navbar'}>
47-
<Link to = "/"
47+
<Link to = "/sorting-visualizer"
4848
className = {'navbar-logo'}
4949
onClick = {closeMobileMenu}>
5050
Algo Visualizer
@@ -55,7 +55,7 @@ function Navigation() {
5555
</div>
5656
<ul className = {click ? 'nav-menu active' : 'nav-menu'}>
5757
<li className = {'nav-item'}>
58-
<Link to = "/home"
58+
<Link to = "/"
5959
className = {'nav-links'}
6060
onClick = {closeMobileMenu}>
6161
Home

0 commit comments

Comments
 (0)