@@ -2,14 +2,14 @@ import React from 'react';
2
2
// import ReactDOM from 'react-dom';
3
3
import './codegenerator.css' ;
4
4
import { ButtonGroup , Button , ButtonToolbar } from 'react-bootstrap' ;
5
- import { ShowCopyCode , DownloadFile , ViewGradients } from '../modals/modals.jsx' ;
5
+ import { ShowCopyCode , DownloadFile , ViewGradients } from './. ./modals/modals.jsx' ;
6
6
import { Link } from 'react-router-dom' ;
7
7
8
8
export default class CodeGenerator extends React . Component {
9
9
constructor ( props ) {
10
10
super ( props ) ;
11
11
this . state = {
12
- degrees : 135 ,
12
+ angle : 135 ,
13
13
color1 : this . generateBackground ( ) . color_first ,
14
14
color2 : this . generateBackground ( ) . color_second ,
15
15
modalShowCode : false ,
@@ -57,31 +57,31 @@ export default class CodeGenerator extends React.Component {
57
57
}
58
58
59
59
generateRandomBackground ( ) {
60
- this . setState ( { degrees : 135 , color1 : this . generateBackground ( ) . color_first , color2 : this . generateBackground ( ) . color_second } ) ;
60
+ this . setState ( { angle : 135 , color1 : this . generateBackground ( ) . color_first , color2 : this . generateBackground ( ) . color_second } ) ;
61
61
}
62
62
63
63
rotateAntiClockWise ( ) {
64
- if ( this . state . degrees - 45 === - 45 ) {
65
- this . setState ( { degrees : 315 } ) ;
66
- // this.setState({ degrees : 315 }, () => {
67
- // this.displayMessage("Angle: " + this.state.degrees );
64
+ if ( this . state . angle - 45 === - 45 ) {
65
+ this . setState ( { angle : 315 } ) ;
66
+ // this.setState({ angle : 315 }, () => {
67
+ // this.displayMessage("Angle: " + this.state.angle );
68
68
// });
69
69
} else {
70
- this . setState ( { degrees : this . state . degrees - 45 } ) ;
70
+ this . setState ( { angle : this . state . angle - 45 } ) ;
71
71
}
72
72
}
73
73
74
74
rotateClockWise ( ) {
75
- if ( this . state . degrees + 45 === 360 ) {
76
- this . setState ( { degrees : 0 } ) ;
75
+ if ( this . state . angle + 45 === 360 ) {
76
+ this . setState ( { angle : 0 } ) ;
77
77
} else {
78
- this . setState ( { degrees : this . state . degrees + 45 } ) ;
78
+ this . setState ( { angle : this . state . angle + 45 } ) ;
79
79
}
80
80
}
81
81
82
82
render ( ) {
83
83
return (
84
- < div className = "generator-wrapper" style = { { background : `linear-gradient(${ this . state . degrees } deg, ${ this . state . color1 } , ${ this . state . color2 } )` } } >
84
+ < div className = "generator-wrapper" style = { { background : `linear-gradient(${ this . state . angle } deg, ${ this . state . color1 } , ${ this . state . color2 } )` } } >
85
85
< div className = "button-group-root" >
86
86
< ButtonToolbar aria-label = "Toolbar with button groups" >
87
87
< ButtonGroup size = "md" className = "button-group-child" aria-label = "Basic Operations" >
@@ -92,7 +92,7 @@ export default class CodeGenerator extends React.Component {
92
92
93
93
< ButtonGroup size = "md" className = "button-group-child" aria-label = "Advanced Operations" >
94
94
< Button variant = "dark" onClick = { ( ) => this . setState ( { modalShowCode : true } ) } > Show/Copy Code</ Button >
95
- < ShowCopyCode show = { this . state . modalShowCode } onHide = { ( ) => this . setState ( { modalShowCode : false } ) } color1 = { this . state . color1 } color2 = { this . state . color2 } angle = { this . state . degrees } />
95
+ < ShowCopyCode show = { this . state . modalShowCode } onHide = { ( ) => this . setState ( { modalShowCode : false } ) } color1 = { this . state . color1 } color2 = { this . state . color2 } angle = { this . state . angle } />
96
96
97
97
< Button variant = "secondary" onClick = { ( ) => this . setState ( { modalShowView : true } ) } > View (Briefly)</ Button >
98
98
< ViewGradients show = { this . state . modalShowView } onHide = { ( ) => this . setState ( { modalShowView : false } ) } color1 = { this . state . color1 } color2 = { this . state . color2 } />
@@ -104,7 +104,7 @@ export default class CodeGenerator extends React.Component {
104
104
</ Button >
105
105
106
106
< Button variant = "secondary" onClick = { ( ) => this . setState ( { modalShowDownload : true } ) } > Download< span className = "download-button-icon" > ➟</ span > </ Button >
107
- < DownloadFile show = { this . state . modalShowDownload } onHide = { ( ) => this . setState ( { modalShowDownload : false } ) } color1 = { this . state . color1 } color2 = { this . state . color2 } angle = { this . state . degrees } />
107
+ < DownloadFile show = { this . state . modalShowDownload } onHide = { ( ) => this . setState ( { modalShowDownload : false } ) } color1 = { this . state . color1 } color2 = { this . state . color2 } angle = { this . state . angle } />
108
108
{ /* <DropdownButton size="md" as={ButtonGroup} variant="success" title="Download" id="bg-nested-dropdown">
109
109
<Dropdown.Item size="md" eventKey="1">Link1</Dropdown.Item>
110
110
<Dropdown.Item size="md" eventKey="2">Link2</Dropdown.Item>
@@ -115,9 +115,9 @@ export default class CodeGenerator extends React.Component {
115
115
< div className = "info-class" style = { { borderImageSource : `linear-gradient(135deg, ${ this . state . color1 } , ${ this . state . color2 } )` } } >
116
116
< div > < span > Color-1: { this . state . color1 } < span className = "color-box" style = { { background : this . state . color1 } } > </ span > </ span > </ div >
117
117
< div > < span > Color-2: { this . state . color2 } < span className = "color-box" style = { { background : this . state . color2 } } > </ span > </ span > </ div >
118
- < div > < span > Angle: { this . state . degrees } degrees</ span > </ div >
118
+ < div > < span > Angle: { this . state . angle } degrees</ span > </ div >
119
119
</ div >
120
- < div id = "generator-root" > </ div >
120
+ { /* <div id="generator-root"></div> */ }
121
121
</ div >
122
122
) ;
123
123
}
0 commit comments