Skip to content

Commit

Permalink
changes per PR notes
Browse files Browse the repository at this point in the history
  • Loading branch information
colebillys19 committed Jun 26, 2019
2 parents 9ffbe74 + ecfc5bb commit f8a91c1
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/components/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.calculator {
z-index: 1;
position: absolute;
top: 60px;
right: 0;
Expand Down
6 changes: 6 additions & 0 deletions src/components/Burst.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@
font-size: 17px;
font-family: Arial, Helvetica, sans-serif;
}

.Burst-header {
display: flex;
justify-content: center;
align-items: center;
}
8 changes: 8 additions & 0 deletions src/components/Burst.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import classNames from 'classnames';
import { getCalcState, setCalcState } from '../lib/calc-helpers';
import { getBurstErrors } from '../lib/input-helpers';
import './Burst.css';
import InfoIcon from './InfoIcon';

class Burst extends Component {
constructor(props) {
Expand Down Expand Up @@ -84,11 +85,18 @@ class Burst extends Component {
render() {
const { idx, min, max, step, errors } = this.state;
const { expanded } = this.props;
const burstInfo = `Burst allows you to generate multiple snapshots
of your graph at one time. Enter the relevant info in the input fields
and hit capture to watch the magic happen.`;

if (!expanded) return <div className="Burst" />;

return (
<div className={classNames('Burst', { 'Burst-expanded': expanded })}>
<div className="Burst-header">
<h2>Burst</h2>
<InfoIcon infoText={burstInfo} />
</div>
<div data-testid="Burst-slider-index-label">Slider Index</div>
<input
className={classNames('Burst-input', {
Expand Down
6 changes: 6 additions & 0 deletions src/components/Folder.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
border-color: #e79600;
}

.Folder-header {
display: flex;
justify-content: center;
align-items: center;
}

@media (max-width: 448px) {
.Folder {
width: calc(100vw - 70px);
Expand Down
8 changes: 8 additions & 0 deletions src/components/Folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '../lib/local-storage-helpers';
import panes from '../constants/pane-types';
import './Folder.css';
import InfoIcon from './InfoIcon';

class Folder extends Component {
constructor(props) {
Expand Down Expand Up @@ -101,12 +102,19 @@ class Folder extends Component {
</div>
);

const folderText = `The folder allows you to save your graphs so you
can come back to them at a later time.`;

return (
<div
className={classNames('Folder', {
'Folder-expanded': expanded
})}
>
<div className="Folder-header">
<h2>Folder</h2>
<InfoIcon infoText={folderText} />
</div>
<div>
<div className="Folder-titles">Name</div>
<input
Expand Down
40 changes: 40 additions & 0 deletions src/components/InfoIcon.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.InfoIcon-icon {
height: 17px;
width: 17px;
margin-left: 10px;
margin-top: 7px;
}

.InfoIcon-icon:hover {
cursor: pointer;
}

.InfoIcon-text-container {
position: relative;
}

.InfoIcon-text {
position: absolute;
background-color: rgb(34, 34, 34, 0.8);
width: 180px;
margin-left: 10px;
left: 100%;
top: 10%;
font-size: 13px;
padding: 1rem;
border-radius: 5px;
text-align: left;
z-index: 1;
}

.InfoIcon-text a {
color: #fff;
}

.InfoIcon-text a:hover {
color: rgb(184, 184, 184);
}

.InfoIcon-text.hide {
display: none;
}
39 changes: 39 additions & 0 deletions src/components/InfoIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { Component } from 'react';
import info from './icons/info.svg';
import './InfoIcon.css';

export default class InfoIcon extends Component {
constructor(props) {
super(props);
this.state = {
show: false
};
this.toggleInfo = this.toggleInfo.bind(this);
}

toggleInfo() {
this.setState({
show: !this.state.show
});
}

render() {
const displayClass = this.state.show ? 'show' : 'hide';
return (
<div className="InfoIcon-text-container">
<img
src={info}
alt="info icon"
className="InfoIcon-icon"
onClick={this.toggleInfo}
/>
<div className={`InfoIcon-text ${displayClass}`}>
<p>{this.props.infoText}</p>
<a href="https://github.com/desmosinc/gifsmos" target="blank">
<p>More Info</p>
</a>
</div>
</div>
);
}
}
7 changes: 7 additions & 0 deletions src/components/Preview.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
transition: 0.2s transform;
margin-bottom: 0;
overflow: scroll;
color: #fff;
}

.Preview-expanded {
Expand Down Expand Up @@ -65,6 +66,12 @@
color: #fff;
}

.Preview-header {
display: flex;
justify-content: center;
align-items: center;
}

@keyframes fade-in {
0% {
opacity: 0;
Expand Down
11 changes: 10 additions & 1 deletion src/components/Preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import classNames from 'classnames';
import Frame from './Frame';
import InfoIcon from './InfoIcon';
import GenerateGifFormContainer from '../containers/GenerateGifFormContainer';
import './Preview.css';

Expand Down Expand Up @@ -89,12 +90,20 @@ class Preview extends Component {

if (!expanded) return <div className="Preview" />;

const previewText = `Preview allows you to preview your future GIF by
scrubbing through snapshots with the slider or
previewing your GIF with the play/pause button.`;

return (
<div
className={classNames('Preview', { 'Preview-expanded': expanded })}
data-testid="Preview-container"
onClick={this.handleClickContainer}
>
<div className="Preview-header">
<h2>Preview</h2>
<InfoIcon infoText={previewText} />
</div>
<div className={classNames({ 'Preview-muted': !numFrames })}>
<Frame
imageSrc={imageSrc}
Expand Down Expand Up @@ -143,7 +152,7 @@ class Preview extends Component {
{gifProgress === 1 ? (
<div className="Preview-progress-success">Download Successful</div>
) : null}
{!frameIDs.length ? (
{!numFrames ? (
<div className="Preview-no-frames">
No frames have been captured. Use the camera or burst tools to add
some!
Expand Down
6 changes: 6 additions & 0 deletions src/components/Settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@
font-size: 1em;
outline: none !important;
}

.Settings-header {
display: flex;
justify-content: center;
align-items: center;
}
7 changes: 7 additions & 0 deletions src/components/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component } from 'react';
import classNames from 'classnames';
import { isPositiveInteger, isProperBound } from '../lib/input-helpers';
import './Settings.css';
import InfoIcon from './InfoIcon';

class Settings extends Component {
constructor(props) {
Expand Down Expand Up @@ -43,10 +44,16 @@ class Settings extends Component {

if (!expanded) return <div className="Settings" />;

const settingsText = `The settings panel allows you to set your desired image dimensions
as well as the interval between frames in the generated GIF.`;
return (
<div
className={classNames('Settings', { 'Settings-expanded': expanded })}
>
<div className="Settings-header">
<h2>Settings</h2>
<InfoIcon infoText={settingsText} />
</div>
<div data-testid="Settings-image-width-label">Image Width</div>
<input
className={classNames('Settings-input', {
Expand Down
1 change: 1 addition & 0 deletions src/components/icons/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f8a91c1

Please sign in to comment.