Skip to content

Commit ca6f794

Browse files
committed
updated some desings
1 parent 553b486 commit ca6f794

7 files changed

Lines changed: 91 additions & 62 deletions

File tree

src/15puzzleComponents/puzzle.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ class Puzzle extends Component {
3131
render() {
3232
let classNames;
3333
return (
34-
<div style={{backgroundColor: "#57407c", height: '100'}}
34+
35+
<div style={{backgroundColor: "#57407c"}}
3536
className={'full-height'}
3637
>
3738
<Navbar/>
38-
<center className={'justify-content-around '}
39+
<div className={'justify-content-around '}
3940
style={{textAlign: "Center"}}>
4041
<div style={{textAlign: "center", height: "440px", width: "440px", margin: 'auto'}}
4142
className={"m-5"}>
@@ -77,9 +78,10 @@ class Puzzle extends Component {
7778
{/*/!* y1={(this.state.squares[0].value + 1) * 50}></line>*!/*/}
7879
{/*/!* </svg>*!/*/}
7980
{/*/!*</SvgLines>*!/*/}
80-
</center>
81+
</div>
8182

8283
</div>
84+
8385
);
8486
}
8587
}

src/Turing Machine/menu.jsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,37 @@ class Menu extends Component {
99
<nav className="nav alert-dark">
1010

1111

12-
<DiscreteSlider
13-
default={50}
14-
min={10}
15-
max={100}
16-
step={1}
17-
title="Speed"
18-
onCountChange={this.props.onSpeedChange}
19-
disable={false}
20-
/>
12+
{/*<DiscreteSlider*/}
13+
{/* default={50}*/}
14+
{/* min={10}*/}
15+
{/* max={100}*/}
16+
{/* step={1}*/}
17+
{/* title="Speed"*/}
18+
{/* onCountChange={this.props.onSpeedChange}*/}
19+
{/* disable={false}*/}
20+
{/*/>*/}
2121
<SimpleSelect
2222
pos={0}
2323
onAlgoChanged={this.props.onAlgoChanged}
2424
/>
2525

26+
27+
<div className="input-group mt-2 col-3">
28+
<input type="text" id='inputText1' className="form-control" placeholder="Input Binary"
29+
aria-label="Username"
30+
aria-describedby="basic-addon1"
31+
onChange={this.props.setInput1}
32+
/>
33+
</div>
34+
<div className="input-group mt-2 col-3">
35+
<input type="text" id='inputText1' className="form-control" placeholder="Input Binary 2"
36+
aria-label="Username"
37+
aria-describedby="basic-addon1"
38+
onChange={this.props.setInput2}
39+
/>
40+
</div>
41+
42+
2643
<button
2744
className='btn btn-warning btn-lg m-2'
2845
onClick={this.props.onReset}

src/Turing Machine/ribbon.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ class Ribbon extends Component {
3030
);
3131
})}
3232
</FlipMove>
33+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
34+
className="bi bi-caret-up-fill" viewBox="0 0 16 16">
35+
<path
36+
d="m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z"/>
37+
</svg>
3338
</div>
3439
);
3540
}

src/Turing Machine/simpleSelect.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const SimpleSelect = (props) => {
3131
return (
3232
<div className="ml-2 mr-2">
3333
<FormControl className={classes.formControl}>
34-
<InputLabel id="demo-simple-select-label">Algorithm</InputLabel>
34+
<InputLabel id="demo-simple-select-label">Task</InputLabel>
3535
<Select
3636
labelId="demo-simple-select-label"
3737
id="demo-simple-select"

src/Turing Machine/turingMachine.jsx

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class TuringMachine extends Component {
7474
let cellStart, cellEnd;
7575
cellStart = 50 + (1 - cellCount) / 2;
7676
cellEnd = 50 + (cellCount - 1) / 2;
77-
this.setState({cellStart, cellEnd});
77+
this.setState({cellStart, cellEnd,state:-1});
7878
}
7979

8080
handleStart = () => {
@@ -136,53 +136,58 @@ class TuringMachine extends Component {
136136
visualize={this.handleStart}
137137
onAlgoChanged={this.setAlgo}
138138
onReset={this.handleReset}
139+
setInput1={this.setInput1}
140+
setInput2={this.setInput2}
139141
/>
140142

141-
<div className='row'>
142-
<div className="input-group mt-2 col-3">
143-
<input type="text" id='inputText1' className="form-control" placeholder="Input Binary"
144-
aria-label="Username"
145-
aria-describedby="basic-addon1"
146-
onChange={this.setInput1}
147-
/>
148-
</div>
149-
<div className="input-group mt-2 col-3">
150-
<input type="text" id='inputText1' className="form-control" placeholder="Input Binary 2"
151-
aria-label="Username"
152-
aria-describedby="basic-addon1"/>
153-
</div>
154-
</div>
143+
{/*<div className='row'>*/}
144+
{/* <div className="input-group mt-2 col-3">*/}
145+
{/* <input type="text" id='inputText1' className="form-control" placeholder="Input Binary"*/}
146+
{/* aria-label="Username"*/}
147+
{/* aria-describedby="basic-addon1"*/}
148+
{/* onChange={this.setInput1}*/}
149+
{/* />*/}
150+
{/* </div>*/}
151+
{/* <div className="input-group mt-2 col-3">*/}
152+
{/* <input type="text" id='inputText1' className="form-control" placeholder="Input Binary 2"*/}
153+
{/* aria-label="Username"*/}
154+
{/* aria-describedby="basic-addon1"/>*/}
155+
{/* </div>*/}
156+
{/*</div>*/}
155157

156158
<center>
157-
<h3>Turing Machine</h3>
158-
<Ribbon
159-
strip={this.state.strip}
160-
midCell={this.state.midCell}
161-
cellCount={this.state.cellCount}
162-
cellStart={this.state.cellStart}
163-
cellEnd={this.state.cellEnd}
164-
></Ribbon>
165-
<button
166-
className='btn btn-warning m-3'
167-
onClick={this.handleLeftShift}
168-
>
169-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
170-
className="bi bi-caret-left-square-fill" viewBox="0 0 16 16">
171-
<path
172-
d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm10.5 10V4a.5.5 0 0 0-.832-.374l-4.5 4a.5.5 0 0 0 0 .748l4.5 4A.5.5 0 0 0 10.5 12z"/>
173-
</svg>
174-
</button>
175-
<button
176-
className='btn btn-warning m-3'
177-
onClick={this.handleRightShift}
178-
>
179-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
180-
className="bi bi-caret-right-square-fill" viewBox="0 0 16 16">
181-
<path
182-
d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4v8z"/>
183-
</svg>
184-
185-
</button>
159+
<br/>
160+
<div className='bg-info'>
161+
{/*<h3>Turing Machine</h3>*/}
162+
<Ribbon
163+
strip={this.state.strip}
164+
midCell={this.state.midCell}
165+
cellCount={this.state.cellCount}
166+
cellStart={this.state.cellStart}
167+
cellEnd={this.state.cellEnd}
168+
></Ribbon>
169+
<button
170+
className='btn btn-warning m-3'
171+
onClick={this.handleLeftShift}
172+
>
173+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
174+
className="bi bi-caret-left-square-fill" viewBox="0 0 16 16">
175+
<path
176+
d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm10.5 10V4a.5.5 0 0 0-.832-.374l-4.5 4a.5.5 0 0 0 0 .748l4.5 4A.5.5 0 0 0 10.5 12z"/>
177+
</svg>
178+
</button>
179+
<button
180+
className='btn btn-warning m-3'
181+
onClick={this.handleRightShift}
182+
>
183+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
184+
className="bi bi-caret-right-square-fill" viewBox="0 0 16 16">
185+
<path
186+
d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4v8z"/>
187+
</svg>
188+
189+
</button>
190+
</div>
186191
<br/>
187192

188193
<div className='row'>
@@ -193,14 +198,14 @@ class TuringMachine extends Component {
193198
/>
194199
</div>
195200
<div className='col-4'>
196-
<span className='badge badge-light text-lg-center' id='stepsText'>
201+
<span className='bg-light p-2 font-weight-bold text-lg-center rounded-3' id='stepsText'>
197202
Details goes here
198203
</span>
199204
</div>
200205
<div className='col-4'>
201-
<textarea disabled className="form-control" id="Textarea1" rows="3">
206+
{/*<textarea disabled className="form-control" id="Textarea1" rows="3">*/}
202207

203-
</textarea>
208+
{/*</textarea>*/}
204209
</div>
205210
</div>
206211
</center>

src/primeComponents/cell.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
font-size: 25px;
88
text-align: center;
99
color: black;
10-
border-radius: 5px 20px;
10+
border-radius: 5px 5px;
1111
}
1212

1313
.cell-prime{

src/primeComponents/cell.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Cell extends Component {
1313
getClass = () =>{
1414
const { val, isVisiting,isChecking,isPrime} = this.props.cell;
1515
if(isPrime){
16-
return "cell cell-prime m-2";
16+
return "cell cell-prime bg-success text-light m-2";
1717
}else if( isVisiting ){
1818
return "cell cell-visiting m-2";
1919
} else if( isChecking ){

0 commit comments

Comments
 (0)