File tree Expand file tree Collapse file tree 4 files changed +29
-20
lines changed Expand file tree Collapse file tree 4 files changed +29
-20
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from 'react';
2
2
import ReactDOM from 'react-dom' ;
3
3
4
4
class PreviewFrame extends React . Component {
5
-
5
+
6
6
componentDidMount ( ) {
7
7
if ( this . props . isPlaying ) {
8
8
this . renderFrameContents ( ) ;
@@ -57,8 +57,8 @@ class PreviewFrame extends React.Component {
57
57
}
58
58
59
59
render ( ) {
60
- return < iframe className = "preview-frame" frameBorder = "0" sandbox = "allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms" > </ iframe > ;
60
+ return < iframe className = "preview-frame" frameBorder = "0" sandbox = "allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms" title = "sketch output" > </ iframe > ;
61
61
}
62
62
}
63
63
64
- export default PreviewFrame ;
64
+ export default PreviewFrame ;
Original file line number Diff line number Diff line change @@ -10,23 +10,25 @@ class Toolbar extends React.Component {
10
10
render ( ) {
11
11
let playButtonClass = classNames ( {
12
12
"toolbar__play-button" : true ,
13
- "playing" : this . props . isPlaying
13
+ "toolbar__play-button--selected" : this . props . isPlaying
14
+ } ) ;
15
+ let stopButtonClass = classNames ( {
16
+ "toolbar__stop-button" : true ,
17
+ "toolbar__stop-button--selected" : ! this . props . isPlaying
14
18
} ) ;
15
19
16
20
return (
17
21
< div className = "toolbar" >
18
22
< img className = "toolbar__logo" src = { logoUrl } alt = "p5js Logo" />
19
- < div className = { playButtonClass } onClick = { this . props . startSketch } >
23
+ < button className = { playButtonClass } onClick = { this . props . startSketch } >
20
24
< Isvg src = { playUrl } alt = "Play Sketch" />
21
- </ div >
22
- { this . props . isPlaying ?
23
- < div className = "toolbar__stop-button" onClick = { this . props . stopSketch } >
24
- < Isvg src = { stopUrl } alt = "Stop Sketch" />
25
- </ div >
26
- : null }
25
+ </ button >
26
+ < button className = { stopButtonClass } onClick = { this . props . stopSketch } >
27
+ < Isvg src = { stopUrl } alt = "Stop Sketch" />
28
+ </ button >
27
29
</ div >
28
30
) ;
29
31
}
30
32
}
31
33
32
- export default Toolbar ;
34
+ export default Toolbar ;
Original file line number Diff line number Diff line change 6
6
width : #{44 / $base-font-size } rem;
7
7
text-align : center ;
8
8
border-radius : 100% ;
9
-
10
9
line-height : #{50 / $base-font-size } rem;
11
10
cursor : pointer ;
11
+ border : none ;
12
+ outline : none ;
12
13
13
14
& g {
14
15
fill : $light-toolbar-button-color ;
22
23
fill : $light-button-hover-color ;
23
24
}
24
25
}
25
- }
26
+ & --selected {
27
+ background-color : $light-button-background-hover-color ;
28
+ & g {
29
+ fill : $light-button-hover-color ;
30
+ }
31
+ }
32
+ }
Original file line number Diff line number Diff line change 1
1
.toolbar__play-button {
2
2
@extend %toolbar-button ;
3
3
margin-right : #{15 / $base-font-size } rem;
4
- & .playing {
5
- background-color : $light-button-background-hover-color ;
6
- & g {
7
- fill : $light-button-hover-color ;
8
- }
4
+ & --selected {
5
+ @extend %toolbar-button--selected ;
9
6
}
10
7
}
11
8
12
9
.toolbar__stop-button {
13
10
@extend %toolbar-button ;
11
+ & --selected {
12
+ @extend %toolbar-button--selected ;
13
+ }
14
14
}
15
15
16
16
.toolbar__logo {
20
20
.toolbar {
21
21
padding : #{20 / $base-font-size } rem #{60 / $base-font-size } rem;
22
22
display : flex ;
23
- }
23
+ }
You can’t perform that action at this time.
0 commit comments