Skip to content
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

Split passphrase/create css into smaller files - subTask #513 #655

Merged
merged 5 commits into from
Apr 3, 2018
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
24 changes: 0 additions & 24 deletions src/components/passphrase/create/create.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@
--second-header-animation-delay: 1000ms;
}

.circle,
.smallCircle,
.triangle,
.smallTriangle,
.squareLeft,
.squareRight,
.triangleLeft,
.verySmallCircle,
.circleLeft {
position: absolute;
z-index: 0;
transform: translateX(-50%) translateY(50%);
}

.wrapper {
flex-direction: row;
height: calc(100% - 22px);
Expand Down Expand Up @@ -62,16 +48,6 @@
}
}

.shapesWrapper {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 0;
overflow: hidden;
}

hr {
display: none;
}
Expand Down
60 changes: 2 additions & 58 deletions src/components/passphrase/create/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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 MovableShape from './movableShape';
import Shapes from './shapes';
import { PrimaryButton, Button } from '../../toolbox/buttons/button';
import TransitionWrapper from '../../toolbox/transitionWrapper';

Expand Down Expand Up @@ -168,7 +168,6 @@ class Create extends React.Component {

render() {
const { t, nextStep } = this.props;
const { shapes } = this.state;
const percentage = this.state.data ? this.state.data.percentage : 0;
const hintTitle = this.isTouchDevice ? 'by tilting your device.' : 'by moving your mouse.';
const modifyID = (id) => {
Expand All @@ -183,62 +182,7 @@ class Create extends React.Component {
<div className={grid['col-xs-12']}
ref={ (pageRoot) => { this.pageRoot = pageRoot; } }>
{!this.state.address ?
<div className={styles.shapesWrapper}>
<MovableShape
hidden={shapes[0]}
src={shapesSrc.circle}
className={styles.circle}
percentage={percentage}
initial={['100%', '20%']} />
<MovableShape
hidden={shapes[1]}
src={shapesSrc.smallCircle}
className={styles.smallCircle}
percentage={percentage}
initial={['62%', '-2%']} />
<MovableShape
hidden={shapes[2]}
src={shapesSrc.triangle}
className={styles.triangle}
percentage={percentage}
initial={['80%', '-2%']} />
<MovableShape
hidden={shapes[4]}
src={shapesSrc.squareLeft}
className={styles.squareLeft}
percentage={percentage}
initial={['5%', '-1%']} />
<MovableShape
hidden={shapes[8]}
src={shapesSrc.squareRight}
className={styles.squareRight}
percentage={percentage}
initial={['70%', '-5%']} />
<MovableShape
hidden={shapes[5]}
src={shapesSrc.triangleLeft}
className={styles.triangleLeft}
percentage={percentage}
initial={['-2%', '30%']} />
<MovableShape
hidden={shapes[7]}
src={shapesSrc.circleLeft}
className={styles.circleLeft}
percentage={percentage}
initial={['20%', '2%']} />
<MovableShape
hidden={shapes[3]}
src={shapesSrc.smallTriangle}
className={styles.smallTriangle}
percentage={percentage}
initial={['40%', '-2%']} />
<MovableShape
hidden={shapes[6]}
src={shapesSrc.verySmallCircle}
className={styles.verySmallCircle}
percentage={percentage}
initial={['45%', '0%']} />
</div> :
<Shapes percentage={percentage} shapes={this.state.shapes} /> :
null
}
<header className={this.state.headingClass}>
Expand Down
25 changes: 25 additions & 0 deletions src/components/passphrase/create/shapes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@import '../../app/variables';

.shapesWrapper {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 0;
overflow: hidden;
}

.circle,
.smallCircle,
.triangle,
.smallTriangle,
.squareLeft,
.squareRight,
.triangleLeft,
.verySmallCircle,
.circleLeft {
position: absolute;
z-index: 0;
transform: translateX(-50%) translateY(50%);
}
64 changes: 64 additions & 0 deletions src/components/passphrase/create/shapes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from 'react';
import * as shapesSrc from '../../../assets/images/register-shapes/*.svg'; //eslint-disable-line
import MovableShape from './movableShape';
import styles from './shapes.css';

const Shapes = ({ shapes, percentage }) =>
(<div className={styles.shapesWrapper}>
<MovableShape
hidden={shapes[0]}
src={shapesSrc.circle}
className={styles.circle}
percentage={percentage}
initial={['100%', '20%']} />
<MovableShape
hidden={shapes[1]}
src={shapesSrc.smallCircle}
className={styles.smallCircle}
percentage={percentage}
initial={['62%', '-2%']} />
<MovableShape
hidden={shapes[2]}
src={shapesSrc.triangle}
className={styles.triangle}
percentage={percentage}
initial={['80%', '-2%']} />
<MovableShape
hidden={shapes[4]}
src={shapesSrc.squareLeft}
className={styles.squareLeft}
percentage={percentage}
initial={['5%', '-1%']} />
<MovableShape
hidden={shapes[8]}
src={shapesSrc.squareRight}
className={styles.squareRight}
percentage={percentage}
initial={['70%', '-5%']} />
<MovableShape
hidden={shapes[5]}
src={shapesSrc.triangleLeft}
className={styles.triangleLeft}
percentage={percentage}
initial={['-2%', '30%']} />
<MovableShape
hidden={shapes[7]}
src={shapesSrc.circleLeft}
className={styles.circleLeft}
percentage={percentage}
initial={['20%', '2%']} />
<MovableShape
hidden={shapes[3]}
src={shapesSrc.smallTriangle}
className={styles.smallTriangle}
percentage={percentage}
initial={['40%', '-2%']} />
<MovableShape
hidden={shapes[6]}
src={shapesSrc.verySmallCircle}
className={styles.verySmallCircle}
percentage={percentage}
initial={['45%', '0%']} />
</div>);

export default Shapes;
16 changes: 16 additions & 0 deletions src/components/register/register.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@
& > div {
height: 100%;
overflow: hidden;
margin-right: calc(-1 * var(--box-padding-left-XL));
margin-left: calc(-1 * var(--box-padding-left-XL));
}
}

.hasPaddingTop {
padding-top: var(--padding-top);
}

@media (--large-viewport) {
.hasPaddingTop {
& > div {
margin-right: calc(-1 * var(--box-padding-left-L));
margin-left: calc(-1 * var(--box-padding-left-L));
}
}
}

@media (--medium-viewport) {
.hasPaddingTop {
height: 100vh; /* stylelint-disable-line */
Expand All @@ -24,5 +35,10 @@
@media (--small-viewport) {
.hasPaddingTop {
padding-top: var(--box-padding);

& > div {
margin-right: calc(-1 * var(--box-padding-left-M));
margin-left: calc(-1 * var(--box-padding-left-M));
}
}
}