added animation to header button

This commit is contained in:
Yusuf Ipek
2021-04-30 09:29:01 +03:00
parent 9452abba7d
commit 177ec52f38
4 changed files with 70 additions and 2 deletions
+18
View File
@@ -56,6 +56,12 @@
animation: moveInRight 1s ease-out;
}
#header-button {
animation: moveInBottom 1s ease-out;
animation-delay: 2s;
opacity: 0;
}
@keyframes moveInLeft {
0% {
opacity: 0;
@@ -87,3 +93,15 @@
transform: translate(0);
}
}
@keyframes moveInBottom {
0% {
opacity: 0;
transform: translateY(100px);
}
100% {
opacity: 1;
transform: translate(0);
}
}
+1 -1
View File
@@ -13,7 +13,7 @@ function Header() {
<span className="heading-primary-main">Outdoors</span>
<span className="heading-primary-sub">is where life happens</span>
</h1>
<Button text={"Discover our tours"} />
<Button animationName={"move-in-bottom"} text={"Discover our tours"} />
</div>
</header>
);
+43
View File
@@ -6,6 +6,11 @@
display: inline-block;
border-radius: 100px;
transition: all 0.2s;
position: relative;
}
.move-in-bottom {
animation: moveInBottom 1s ease-out;
}
.btn:hover {
@@ -22,3 +27,41 @@
background-color: #fff;
color: #777;
}
.btn::after {
content: " ";
display: inline-block;
height: 100%;
width: 100%;
border-radius: 100px;
position: absolute;
top: 0;
left: 0;
z-index: -1;
transition: all 0.4s;
}
.btn-white::after {
background-color: white;
}
.btn:hover::after {
transform: scaleX(1.4) scaleY(1.6);
opacity: 0;
}
@keyframes moveInBottom {
0% {
opacity: 0;
transform: translateY(250px);
}
50% {
opacity: 0;
}
100% {
opacity: 1;
transform: translate(0);
}
}
+8 -1
View File
@@ -2,7 +2,14 @@ import "./button.css";
function Button(props) {
return (
<a href="#" className="btn btn-white">
<a
href="#"
className={
props.animationName === "move-in-bottom"
? "btn btn-white move-in-bottom"
: "btn btn-white"
}
>
{props.text}
</a>
);