Skip to content

Commit

Permalink
Merge pull request #706 from LiskHQ/703-create-account-shapes
Browse files Browse the repository at this point in the history
Animate shape colors in registration - Closes #703
  • Loading branch information
gina contrino committed Apr 20, 2018
2 parents 07f873b + 5cf5873 commit 1ca440c
Show file tree
Hide file tree
Showing 17 changed files with 289 additions and 315 deletions.
2 changes: 1 addition & 1 deletion config/webpack.config.react.js
Expand Up @@ -104,7 +104,7 @@ module.exports = {
extends: 'stylelint-config-standard',
rules: {
'selector-pseudo-class-no-unknown': null,
'unit-whitelist': ['px', 'deg', '%', 'ms'],
'unit-whitelist': ['px', 'deg', '%', 'ms', 's'],
'length-zero-no-unit': null,
'at-rule-no-unknown': null,
},
Expand Down
19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/circle-left.svg

This file was deleted.

25 changes: 0 additions & 25 deletions src/assets/images/register-shapes/circle.svg

This file was deleted.

19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/circle1.svg

This file was deleted.

19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/small-circle.svg

This file was deleted.

19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/small-triangle.svg

This file was deleted.

19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/square-left.svg

This file was deleted.

19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/square-right.svg

This file was deleted.

19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/triangle-left.svg

This file was deleted.

19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/triangle.svg

This file was deleted.

19 changes: 0 additions & 19 deletions src/assets/images/register-shapes/very-small-circle.svg

This file was deleted.

27 changes: 27 additions & 0 deletions src/components/passphrase/create/colorSchemes.js
@@ -0,0 +1,27 @@
export default [
{
foreground: [
['#FFD300', '#FF9100'],
['#FFD300', '#FF9100'],
['#C86DD7', '#3023AE'],
['#C86DD7', '#3023AE'],
['#93F4FE', '#004AFF'],
['#93F4FE', '#004AFF'],
['#008BFF', '#00B685'],
['#008BFF', '#00B685'],
['#113034', '#00B685'],
['#113034', '#00B685'],
],
background: [
['#F792A6', '#EC596D'],
['#F792A6', '#EC596D'],
['#F792A6', '#EC596D'],
['#acafff', '#4D3AFF'],
['#acafff', '#4D3AFF'],
['#93F4FE', '#008BFF'],
['#93F4FE', '#008BFF'],
['#5DECBF', '#96F7E1'],
['#5DECBF', '#96F7E1'],
],
},
];
29 changes: 1 addition & 28 deletions src/components/passphrase/create/index.js
Expand Up @@ -5,7 +5,6 @@ import { extractAddress } from '../../../utils/api/account';
import AccountVisual from '../../accountVisual';
import styles from './create.css';
import { FontIcon } from '../../fontIcon';
import * as shapesSrc from '../../../assets/images/register-shapes/*.svg'; //eslint-disable-line
import Shapes from './shapes';
import { PrimaryButton, Button } from '../../toolbox/buttons/button';
import TransitionWrapper from '../../toolbox/transitionWrapper';
Expand All @@ -21,7 +20,6 @@ class Create extends React.Component {
x: 0,
y: 0,
},
shapes: [1, 1, 1, 1, 1, 1, 1, 1, 1],
headingClass: '',
};
this.isTouchDevice = false;
Expand All @@ -41,22 +39,6 @@ class Create extends React.Component {
}
}

// eslint-disable-next-line class-methods-use-this
hideShapeRandomly(list) {
const result = [];
const min = 0;
const max = 9;
let randomNumber;
while (result.length < 4) {
randomNumber = Math.floor((Math.random() * (max - min)) + min);
if (result.indexOf(randomNumber) === -1) {
result.push(randomNumber);
}
}
result.forEach((item) => { list[item] = 0; });
return list;
}

componentWillUnmount() {
const eventName = this.isTouchDevice ? 'devicemotion' : 'mousemove';
document.removeEventListener(eventName, this.seedGeneratorBoundToThis, true);
Expand Down Expand Up @@ -136,12 +118,6 @@ class Create extends React.Component {
step: 'info',
address,
});

const shapes = this.hideShapeRandomly(this.state.shapes);
// update state
this.setState({
shapes,
});
}
}

Expand All @@ -164,10 +140,7 @@ class Create extends React.Component {
id='generatorContainer' ref={(el) => { this.container = el; }} onMouseMove={this.eventNormalizer} >
<div className={grid['col-xs-12']}
ref={ (pageRoot) => { this.pageRoot = pageRoot; } }>
{!this.state.address ?
<Shapes percentage={percentage} shapes={this.state.shapes} /> :
null
}
<Shapes percentage={percentage} addressCreated={this.state.address}/>
<header>
<TransitionWrapper current={this.state.step} step='generate'>
<h2 className={`${styles.generatorHeader}`}
Expand Down

0 comments on commit 1ca440c

Please sign in to comment.