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';
22import ReactDOM from 'react-dom' ;
33
44class PreviewFrame extends React . Component {
5-
5+
66 componentDidMount ( ) {
77 if ( this . props . isPlaying ) {
88 this . renderFrameContents ( ) ;
@@ -57,8 +57,8 @@ class PreviewFrame extends React.Component {
5757 }
5858
5959 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 > ;
6161 }
6262}
6363
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 {
1010 render ( ) {
1111 let playButtonClass = classNames ( {
1212 "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
1418 } ) ;
1519
1620 return (
1721 < div className = "toolbar" >
1822 < 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 } >
2024 < 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 >
2729 </ div >
2830 ) ;
2931 }
3032}
3133
32- export default Toolbar ;
34+ export default Toolbar ;
Original file line number Diff line number Diff line change 66 width : #{44 / $base-font-size } rem;
77 text-align : center ;
88 border-radius : 100% ;
9-
109 line-height : #{50 / $base-font-size } rem;
1110 cursor : pointer ;
11+ border : none ;
12+ outline : none ;
1213
1314 & g {
1415 fill : $light-toolbar-button-color ;
2223 fill : $light-button-hover-color ;
2324 }
2425 }
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 11.toolbar__play-button {
22 @extend %toolbar-button ;
33 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 ;
96 }
107}
118
129.toolbar__stop-button {
1310 @extend %toolbar-button ;
11+ & --selected {
12+ @extend %toolbar-button--selected ;
13+ }
1414}
1515
1616.toolbar__logo {
2020.toolbar {
2121 padding : #{20 / $base-font-size } rem #{60 / $base-font-size } rem;
2222 display : flex ;
23- }
23+ }
You can’t perform that action at this time.
0 commit comments