Skip to content

Commit 644d1db

Browse files
author
Danny Ruchtie
committed
Animating icons
Added animations to the icons to invoke interaction
1 parent d9ec83b commit 644d1db

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,13 @@ export const Sandbox = styled.a`
216216
border: none;
217217
background-color: transparent;
218218
background-size: cover;
219-
transform: scale(1);
219+
220220
transition: all 100ms ease-in;
221221
222+
animation: easeInOutBack 1s cubic-bezier(0.68, -0.6, 0.12, 2);
223+
animation-iteration-count: 1;
224+
animation-fill-mode: backwards;
225+
222226
@media screen and (min-width: 576px) {
223227
width: 3rem;
224228
height: 3rem;
@@ -235,4 +239,16 @@ export const Sandbox = styled.a`
235239
transform: scale(0.9);
236240
opacity: 1;
237241
}
242+
243+
@keyframes easeInOutBack {
244+
0% {
245+
opacity: 0;
246+
transform: scale(0.1);
247+
}
248+
249+
100% {
250+
opacity: 0.2;
251+
transform: scale(1);
252+
}
253+
}
238254
`;

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

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,37 @@ export default () => {
4848
</SubTitle>
4949

5050
<SandboxButtons>
51-
<Sandbox href="/s/new" style={{ backgroundImage: `url(${react})` }} />
51+
<Sandbox
52+
href="/s/new"
53+
title="React"
54+
style={{ backgroundImage: `url(${react})`, animationDelay: '0.5s' }}
55+
/>
5256
<Sandbox
5357
href="/s/vanilla"
54-
style={{ backgroundImage: `url(${vanilla})` }}
58+
title="Vanilla"
59+
style={{
60+
backgroundImage: `url(${vanilla})`,
61+
animationDelay: '0.6s',
62+
}}
63+
/>
64+
<Sandbox
65+
href="/s/vue"
66+
title="Vue"
67+
style={{ backgroundImage: `url(${vue})`, animationDelay: '0.7s' }}
5568
/>
56-
<Sandbox href="/s/vue" style={{ backgroundImage: `url(${vue})` }} />
5769
<Sandbox
5870
href="/s/angular"
59-
style={{ backgroundImage: `url(${angular})` }}
71+
title="Angular"
72+
style={{
73+
backgroundImage: `url(${angular})`,
74+
animationDelay: '0.8s',
75+
}}
76+
/>
77+
<Sandbox
78+
href="/s"
79+
title="More"
80+
style={{ backgroundImage: `url(${more})`, animationDelay: '0.9s' }}
6081
/>
61-
<Sandbox href="/s" style={{ backgroundImage: `url(${more})` }} />
6282
</SandboxButtons>
6383

6484
<motion.div

0 commit comments

Comments
 (0)