Skip to content

Commit 181c89e

Browse files
authored
feat(homepage): bring back the old version (codesandbox#5934)
* feat(homepage): bring back the old version * fix(homepage): ab test * fix(homepage ab): remove console * fix(ab): update key name
1 parent 9c0d24b commit 181c89e

File tree

10 files changed

+436
-294
lines changed

10 files changed

+436
-294
lines changed
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import React from 'react';
2+
import { motion } from 'framer-motion';
3+
import styled from 'styled-components';
4+
5+
import Button from '../../../components/Button';
6+
import react from '../../../assets/icons/home-react.svg';
7+
import vanilla from '../../../assets/icons/home-js.svg';
8+
import vue from '../../../assets/icons/home-vue.svg';
9+
import angular from '../../../assets/icons/home-angular.svg';
10+
import html from '../../../assets/icons/home-html.svg';
11+
import more from '../../../assets/icons/home-more.svg';
12+
13+
const CTATemplateAVersion = () => (
14+
<>
15+
<SandboxButtons>
16+
<Sandbox href="/s/new" title="React" style={{ animationDelay: '0.5s' }}>
17+
<img src={react} alt="React Template" />
18+
</Sandbox>
19+
<Sandbox
20+
href="/s/vanilla"
21+
title="Vanilla"
22+
style={{
23+
animationDelay: '0.6s',
24+
}}
25+
>
26+
<img src={vanilla} alt="Vanilla Template" />
27+
</Sandbox>
28+
<Sandbox href="/s/vue" title="Vue" style={{ animationDelay: '0.7s' }}>
29+
<img src={vue} alt="Vue Template" />
30+
</Sandbox>
31+
<Sandbox
32+
href="/s/angular"
33+
title="Angular"
34+
style={{
35+
animationDelay: '0.8s',
36+
}}
37+
>
38+
<img src={angular} alt="angular Template" />
39+
</Sandbox>
40+
<Sandbox
41+
href="/s/github/codesandbox-app/static-template/tree/master/"
42+
title="HTML 5"
43+
style={{
44+
animationDelay: '0.9s',
45+
}}
46+
>
47+
<img src={html} alt="HTML Template" />
48+
</Sandbox>
49+
<Sandbox href="/s" title="More" style={{ animationDelay: '1.0s' }}>
50+
<img src={more} alt="More Template" />
51+
</Sandbox>
52+
</SandboxButtons>
53+
54+
<motion.div
55+
initial={{ opacity: 0, y: 20 }}
56+
animate={{ opacity: 1, y: 0 }}
57+
transition={{ duration: 0.5, ease: 'easeOut', delay: 0.5 }}
58+
>
59+
<Button
60+
style={{
61+
padding: '.75rem 2rem',
62+
marginBottom: '.5rem',
63+
borderRadius: '.25rem',
64+
}}
65+
href="/s"
66+
>
67+
Create Sandbox, it’s free
68+
</Button>
69+
</motion.div>
70+
</>
71+
);
72+
73+
const SandboxButtons = styled.section`
74+
height: auto;
75+
width: auto;
76+
margin: 5rem 0;
77+
transition: all 200ms ease-in;
78+
justify-content: center;
79+
display: flex;
80+
align-items: center;
81+
`;
82+
83+
const Sandbox = styled.a`
84+
display: flex;
85+
opacity: 0.4;
86+
border: none;
87+
background-color: transparent;
88+
background-size: cover;
89+
background-position: center center;
90+
transition: all 200ms ease-in;
91+
justify-content: center;
92+
animation: easeInOutBack 1s cubic-bezier(0, -0.6, 0.12, 2) 1s backwards;
93+
width: 4rem;
94+
height: 4rem;
95+
margin: 0 0.5rem;
96+
${props => props.theme.breakpoints.md} {
97+
width: 4rem;
98+
height: 4rem;
99+
}
100+
${props => props.theme.breakpoints.sm} {
101+
width: 2rem;
102+
height: 2rem;
103+
}
104+
:hover {
105+
cursor: pointer;
106+
animation-play-state: paused;
107+
transform: scale(1.2);
108+
opacity: 1;
109+
}
110+
@keyframes easeInOutBack {
111+
0% {
112+
opacity: 0;
113+
transform: scale(0.01);
114+
}
115+
116+
100% {
117+
opacity: 0.4;
118+
transform: scale(1);
119+
}
120+
}
121+
`;
122+
123+
export { CTATemplateAVersion };

0 commit comments

Comments
 (0)