Skip to content

Commit ac702ef

Browse files
committed
add simple logo animation
1 parent eea866a commit ac702ef

File tree

4 files changed

+80
-4
lines changed

4 files changed

+80
-4
lines changed
Loading

src/components/public/nav/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Logo from './brand_camerakit_logo.svg';
66
const Nav = () => (
77
<nav className={styles.nav}>
88
<div className={`container ${styles.container}`}>
9-
<div className={styles.brand}>
9+
<div className={`animated-logo__wrapper ${styles.brand}`}>
1010
<Logo />
1111
</div>
1212
<div className={styles.links}>

src/styles.global.scss

+3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
@import '/styles/variables';
55

66
@import '/styles/container';
7+
8+
//svgs
79
@import '/styles/feature-icon';
10+
@import '/styles/logo-animation';
811

912

1013
* {

src/styles/logo-animation.scss

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
:global {
2+
3+
.animated-logo {
4+
height: 3rem;
5+
6+
.camera-lens {
7+
transform-origin: center;
8+
animation: lens 1.5s linear forwards 1s;
9+
}
10+
11+
.text {
12+
transform-origin: right;
13+
animation: text 0.8s linear forwards 3s;
14+
opacity: 0;
15+
}
16+
}
17+
18+
.animated-logo__wrapper {
19+
&::after {
20+
content: '';
21+
position: absolute;
22+
top: 0.5rem;
23+
left: 1.25rem;
24+
width: 2rem;
25+
height: 2rem;
26+
border-radius: 50%;
27+
background-color: #fff;
28+
opacity: 0;
29+
animation: flare 0.8s ease-out 2.5s;
30+
}
31+
}
32+
33+
@keyframes lens {
34+
10% {
35+
transform: rotate(30deg);
36+
}
37+
38+
30% {
39+
transform: rotate(30deg);
40+
}
41+
42+
50% {
43+
transform: rotate(210deg);
44+
}
45+
46+
70% {
47+
transform: rotate(210deg);
48+
}
49+
}
50+
51+
@keyframes text {
52+
0% {
53+
opacity: 0;
54+
}
55+
56+
100% {
57+
opacity: 1;
58+
}
59+
}
60+
61+
@keyframes flare {
62+
0% {
63+
opacity: 1;
64+
transform: scale(0);
65+
}
66+
67+
100% {
68+
opacity: 0;
69+
transform: scale(6);
70+
}
71+
}
72+
73+
}

0 commit comments

Comments
 (0)