Skip to content

Commit 36312d9

Browse files
committed
Add the new modules image, cube and text rotation
1 parent ed495dd commit 36312d9

File tree

2 files changed

+50
-81
lines changed

2 files changed

+50
-81
lines changed

components/splash-viz/splash-viz-style.scss

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,52 @@
88
min-height:320px;
99
max-height:720px;
1010
background:getColor(elephant);
11+
flex-direction: column;
1112

12-
&__modules,
13-
&__output {
14-
flex:0 0 45%;
13+
&__heading {
14+
color: getColor(white);
15+
font-size: getFontSize(4);
16+
text-align: center;
17+
font-weight: 200;
18+
margin-top: 24px;
19+
20+
@include break {
21+
font-size: getFontSize(5);
22+
}
1523
}
1624

1725
&__modules {
18-
display:none;
26+
position: absolute;
27+
left: 0;
28+
right: 0;
29+
top: 0;
30+
bottom: 0;
31+
width: 65vw;
32+
min-width: 550px;
33+
margin: auto;
34+
display: none;
1935

2036
@include break {
21-
display:flex;
22-
align-items:center;
23-
justify-content: flex-end;
24-
25-
img {
26-
margin-right:10%;
27-
width:40%;
28-
max-width:400px;
29-
}
37+
display: block;
3038
}
31-
}
32-
33-
&__icon {
34-
display:flex;
35-
flex:1 1 auto;
36-
align-items:center;
37-
justify-content: center;
3839

3940
img {
40-
width:45%;
41-
42-
@include break {
43-
width:100%;
44-
}
41+
// Padding is needed to center align
42+
// webpack icon with the module image
43+
padding-top: 3vw;
44+
width: 100%;
45+
height: 100%;
4546
}
4647
}
4748

48-
&__output {
49-
display:none;
50-
51-
@include break {
52-
display:flex;
53-
align-items:center;
54-
}
55-
}
49+
&__cube {
50+
position: absolute;
51+
left: 0;
52+
right: 0;
53+
top: 0;
54+
bottom: 0;
55+
margin: auto;
56+
z-index: 1;
5657

57-
&__files {
58-
width:40%;
59-
max-width:400px;
60-
margin-left:10%;
6158
}
6259
}

components/splash-viz/splash-viz.jsx

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,29 @@
11
import React from 'react';
2-
import Link from '../link/link';
3-
import SplashFile from '../splash-file/splash-file';
4-
import Icon from '../../assets/icon-square-big.svg';
5-
import Modules from '../../assets/modules.png';
62

7-
export default class SplashViz extends React.Component {
8-
constructor(props) {
9-
super(props);
3+
import Cube from '../cube/cube';
4+
import TextRotator from '../text-rotater/text-rotater';
5+
import Modules from '../../assets/homepage-modules.svg';
6+
import './splash-viz-style';
107

11-
this.state = {
12-
files: [
13-
{ name: 'index.html', type: 'html', size: 2039 },
14-
{ name: 'index.bundle.js', type: 'js', size: 20394 },
15-
{ name: 'index.bundle.js.map', type: 'blank', size: 20459 },
16-
{ name: 'style.bundle.css', type: 'css', size: 12948 },
17-
{ name: 'favicon.ico', type: 'ico', size: 23794 }
18-
]
19-
};
20-
}
8+
export default class SplashViz extends React.Component {
219

2210
render() {
2311
return (
2412
<section className="splash-viz">
13+
<h1 className="splash-viz__heading">
14+
<span> bundle your</span>
15+
<TextRotator repeatDelay={ 5000 }>
16+
<span> assets </span>
17+
<span> scripts </span>
18+
<span> images </span>
19+
<span> styles </span>
20+
</TextRotator>
21+
</h1>
2522
<div className="splash-viz__modules">
26-
<img src={ Modules } />
27-
</div>
28-
29-
<div className="splash-viz__icon">
30-
<img src={ Icon } />
31-
</div>
32-
33-
<div className="splash-viz__output">
34-
<div className="splash-viz__files">
35-
{
36-
this.state.files.map((file, i) => (
37-
<SplashFile key={ i } { ...file } />
38-
))
39-
}
40-
</div>
23+
<img src={ Modules }/>
4124
</div>
25+
<Cube className="splash-viz__cube" depth={ 140 } repeatDelay={ 5000 } continuous/>
4226
</section>
4327
);
4428
}
45-
46-
componentDidMount() {
47-
// setInterval(() => {
48-
// this.setState({
49-
// files: this.state.files.map(file => ({
50-
// name: file.name,
51-
// type: file.type,
52-
// size: file.size + Math.random() * (file.type === 'js' ? 10000 : 0)
53-
// }))
54-
// });
55-
// }, 50);
56-
}
5729
}

0 commit comments

Comments
 (0)