Skip to content

Make toolbar accessible #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions shared/components/Preview/PreviewFrame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';

class PreviewFrame extends React.Component {

componentDidMount() {
if (this.props.isPlaying) {
this.renderFrameContents();
Expand Down Expand Up @@ -57,8 +57,8 @@ class PreviewFrame extends React.Component {
}

render() {
return <iframe className="preview-frame" frameBorder="0" sandbox="allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms"></iframe>;
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>;
}
}

export default PreviewFrame;
export default PreviewFrame;
20 changes: 11 additions & 9 deletions shared/components/Toolbar/Toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@ class Toolbar extends React.Component {
render() {
let playButtonClass = classNames({
"toolbar__play-button": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line should be
"toolbar__play-button": !this.props.isPlaying

"playing": this.props.isPlaying
"toolbar__play-button--selected": this.props.isPlaying
});
let stopButtonClass = classNames({
"toolbar__stop-button": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line should be
"toolbar__stop-button": this.props.isPlaying

"toolbar__stop-button--selected": !this.props.isPlaying
});

return (
<div className="toolbar">
<img className="toolbar__logo" src={logoUrl} alt="p5js Logo"/>
<div className={playButtonClass} onClick={this.props.startSketch}>
<button className={playButtonClass} onClick={this.props.startSketch}>
<Isvg src={playUrl} alt="Play Sketch" />
</div>
{ this.props.isPlaying ?
<div className="toolbar__stop-button" onClick={this.props.stopSketch}>
<Isvg src={stopUrl} alt="Stop Sketch" />
</div>
: null }
</button>
<button className={stopButtonClass} onClick={this.props.stopSketch}>
<Isvg src={stopUrl} alt="Stop Sketch" />
</button>
</div>
);
}
}

export default Toolbar;
export default Toolbar;
11 changes: 9 additions & 2 deletions styles/abstracts/_placeholders.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
width: #{44 / $base-font-size}rem;
text-align: center;
border-radius: 100%;

line-height: #{50 / $base-font-size}rem;
cursor: pointer;
border: none;
outline: none;

& g {
fill: $light-toolbar-button-color;
Expand All @@ -22,4 +23,10 @@
fill: $light-button-hover-color;
}
}
}
&--selected {
background-color: $light-button-background-hover-color;
& g {
fill: $light-button-hover-color;
}
}
}
12 changes: 6 additions & 6 deletions styles/components/_toolbar.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.toolbar__play-button {
@extend %toolbar-button;
margin-right: #{15 / $base-font-size}rem;
&.playing {
background-color: $light-button-background-hover-color;
& g {
fill: $light-button-hover-color;
}
&--selected {
@extend %toolbar-button--selected;
Copy link
Member

@catarak catarak Jun 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be

@extend %toolbar-button;
@extend %toolbar-button--selected;

}
}

.toolbar__stop-button {
@extend %toolbar-button;
&--selected {
@extend %toolbar-button--selected;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be

@extend %toolbar-button;
@extend %toolbar-button--selected;

}
}

.toolbar__logo {
Expand All @@ -20,4 +20,4 @@
.toolbar {
padding: #{20 / $base-font-size}rem #{60 / $base-font-size}rem;
display: flex;
}
}