Skip to content

Commit 9187791

Browse files
committed
Deploy
1 parent 991e0cd commit 9187791

File tree

4 files changed

+61
-78
lines changed

4 files changed

+61
-78
lines changed

packages/homepage/src/pages/ide/_elements.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import styled, { css } from 'styled-components';
2-
import { HeroWrapper } from '../../screens/home/hero/elements';
32
import { H2 } from '../../components/Typography';
43
import Button from '../../components/Button';
54
import Collaborate from '../../assets/icons/Collaborate';
@@ -41,7 +40,9 @@ export const Title = styled(H2)`
4140
}
4241
`;
4342

44-
export const MacBookWrapper = styled(HeroWrapper)`
43+
export const MacBookWrapper = styled.div`
44+
text-align: center;
45+
4546
margin-top: 0;
4647
overflow: visible;
4748
margin-bottom: 8rem;
@@ -294,3 +295,10 @@ export const Border = styled.div`
294295
left: 50%;
295296
transform: translateX(-50%);
296297
`;
298+
299+
export const ImageWrapper = styled.div`
300+
img {
301+
display: block;
302+
box-shadow: 0 -8px 120px #1d1d1d;
303+
}
304+
`;

packages/homepage/src/pages/ide/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Layout from '../../components/layout';
55
import PageContainer from '../../components/PageContainer';
66
import TitleAndMetaTags from '../../components/TitleAndMetaTags';
77
import hero from '../../assets/images/hero.png';
8-
import { ImageWrapper } from '../../screens/home/hero/elements';
98
import { P } from '../../components/Typography';
109
import tweets from './_tweets';
1110

@@ -32,6 +31,7 @@ import {
3231
ManageIcon,
3332
HeartIcon,
3433
Border,
34+
ImageWrapper,
3535
} from './_elements';
3636
import TemplateUniverse from '../../assets/images/TemplateUniverse.png';
3737
import containers from '../../assets/images/containers.png';

packages/homepage/src/screens/home/hero/elements.js

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ const dropIn = (offset = 100) => keyframes`
2222
}
2323
`;
2424

25-
const fadeIn = () => keyframes`
26-
0% {
27-
opacity: 0;
28-
}
29-
30-
100% {
31-
opacity: 1;
32-
}
33-
`;
34-
3525
export const EditorElement = styled.img`
3626
animation: ${props => dropIn(props.i * 250)} 3s;
3727
animation-delay: ${props => props.i * 100}ms;
@@ -66,41 +56,6 @@ export const SignUp = styled.p`
6656
margin-bottom: 2.5rem;
6757
`;
6858

69-
export const ImageWrapper = styled.div`
70-
position: relative;
71-
display: flex;
72-
flex-direction: column;
73-
width: max-content;
74-
75-
text-align: left;
76-
transform-origin: 50% 50%;
77-
transform: scale(0.75, 0.75) translate(500px, -250px) rotateY(-10deg)
78-
rotateX(5deg);
79-
perspective: 100;
80-
border-radius: 2px;
81-
82-
&::after {
83-
animation: ${fadeIn()} 1s;
84-
animation-delay: 3s;
85-
animation-fill-mode: backwards;
86-
content: '';
87-
display: block;
88-
position: absolute;
89-
bottom: 0;
90-
background-image: linear-gradient(
91-
to bottom,
92-
rgba(0, 0, 0, 0) 0,
93-
#040404 90%,
94-
#040404 100%
95-
);
96-
97-
height: 800px;
98-
width: 100%;
99-
100-
z-index: 10;
101-
}
102-
`;
103-
10459
export const Border = styled.div`
10560
position: absolute;
10661
background: ${props => props.theme.homepage.grey};

packages/homepage/src/screens/home/hero/index.js

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,58 @@ import BoxAnimation from './BoxAnimation';
2222
import { applyParallax } from '../../../utils/parallax';
2323

2424
export default () => {
25-
const [boxes, setBoxes] = useState([
26-
{ position: [0, 0, 10], rotation: [1.2, 0, 0], key: 'initial' },
27-
]);
28-
const [sandboxesCreatedCount, setSandboxesCreatedCount] = useState(1);
25+
const [boxes, setBoxes] = useState([]);
26+
const [sandboxesCreatedCount, setSandboxesCreatedCount] = useState(0);
2927
const [showPlane, setShowPlane] = useState(true);
3028

31-
const createBox = React.useCallback(() => {
32-
setBoxes(b => {
33-
if (b.length > 10) {
34-
setShowPlane(false);
35-
setTimeout(() => {
36-
setShowPlane(true);
37-
38-
setBoxes(bb => {
39-
const newBoxes = [...bb];
40-
newBoxes.length = 1;
41-
return newBoxes;
42-
});
43-
}, 1000);
44-
}
45-
const newBoxes = [
46-
{
47-
key: Math.floor(Math.random() * 10000) + '',
48-
position: [-5 + Math.random() * 10, 0 + Math.random() * 2.5, 15],
49-
rotation: [Math.random() * 1, Math.random() * 1, Math.random() * 1],
50-
},
51-
...b,
52-
];
53-
54-
return newBoxes;
55-
});
56-
}, [setBoxes]);
29+
const createBox = React.useCallback(
30+
({ position, rotation } = {}) => {
31+
setBoxes(b => {
32+
if (b.length > 10) {
33+
setShowPlane(false);
34+
setTimeout(() => {
35+
setShowPlane(true);
36+
37+
setBoxes(bb => {
38+
const newBoxes = [...bb];
39+
newBoxes.length = 1;
40+
return newBoxes;
41+
});
42+
}, 1000);
43+
}
44+
const newBoxes = [
45+
{
46+
key: Math.floor(Math.random() * 10000) + '',
47+
position: position || [
48+
-5 + Math.random() * 10,
49+
0 + Math.random() * 2.5,
50+
15,
51+
],
52+
rotation: rotation || [
53+
Math.random() * 1,
54+
Math.random() * 1,
55+
Math.random() * 1,
56+
],
57+
},
58+
...b,
59+
];
60+
61+
return newBoxes;
62+
});
63+
},
64+
[setBoxes]
65+
);
66+
67+
React.useEffect(() => {
68+
const timeout = setTimeout(() => {
69+
createBox({ position: [0, 0, 10], rotation: [1.2, 0, 0] });
70+
setSandboxesCreatedCount(i => i + 1);
71+
}, 1000);
72+
73+
return () => {
74+
clearTimeout(timeout);
75+
};
76+
}, [createBox]);
5777

5878
const socketRef = useRef(
5979
typeof window === 'undefined'

0 commit comments

Comments
 (0)