Created
January 19, 2020 17:11
-
-
Save levenokk/2d6544b0f907a3b96bb298b02dcf8e80 to your computer and use it in GitHub Desktop.
style for arrow up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.up-arrow { | |
position: fixed; | |
background-color: $darkGray; | |
width: 60px; | |
height: 60px; | |
text-align: center; | |
font-size: 24px; | |
color: #fff; | |
line-height: 60px; | |
-webkit-transition: all 0.2s linear; | |
transition: all 0.2s linear; | |
bottom: 20px; | |
right: -200px; | |
border-radius: 50%; | |
cursor: pointer; | |
// animation-delay: 5s; | |
-webkit-animation: bounce-bottom 2s infinite; | |
animation: bounce-bottom 2s infinite; | |
&:hover { | |
background-color: $red; | |
} | |
&.active { | |
right: 20px; | |
-webkit-animation: bounce-top 2s; | |
animation: bounce-top 2s; | |
} | |
} | |
@-webkit-keyframes bounce-top { | |
0% { | |
-webkit-transform: translateY(-45px); | |
transform: translateY(-45px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
opacity: 1; | |
} | |
24% { | |
opacity: 1; | |
} | |
40% { | |
-webkit-transform: translateY(-24px); | |
transform: translateY(-24px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
65% { | |
-webkit-transform: translateY(-12px); | |
transform: translateY(-12px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
82% { | |
-webkit-transform: translateY(-6px); | |
transform: translateY(-6px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
93% { | |
-webkit-transform: translateY(-4px); | |
transform: translateY(-4px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
25%, | |
55%, | |
75%, | |
87% { | |
-webkit-transform: translateY(0px); | |
transform: translateY(0px); | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
} | |
100% { | |
-webkit-transform: translateY(0px); | |
transform: translateY(0px); | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
opacity: 1; | |
} | |
} | |
@keyframes bounce-top { | |
0% { | |
-webkit-transform: translateY(-45px); | |
transform: translateY(-45px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
opacity: 1; | |
} | |
24% { | |
opacity: 1; | |
} | |
40% { | |
-webkit-transform: translateY(-24px); | |
transform: translateY(-24px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
65% { | |
-webkit-transform: translateY(-12px); | |
transform: translateY(-12px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
82% { | |
-webkit-transform: translateY(-6px); | |
transform: translateY(-6px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
93% { | |
-webkit-transform: translateY(-4px); | |
transform: translateY(-4px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
25%, | |
55%, | |
75%, | |
87% { | |
-webkit-transform: translateY(0px); | |
transform: translateY(0px); | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
} | |
100% { | |
-webkit-transform: translateY(0px); | |
transform: translateY(0px); | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
opacity: 1; | |
} | |
} | |
@-webkit-keyframes bounce-bottom { | |
0% { | |
-webkit-transform: translateY(4px); | |
transform: translateY(4px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
opacity: 1; | |
} | |
24% { | |
opacity: 1; | |
} | |
40% { | |
-webkit-transform: translateY(6px); | |
transform: translateY(6px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
65% { | |
-webkit-transform: translateY(12px); | |
transform: translateY(12px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
85% { | |
-webkit-transform: translateY(6px); | |
transform: translateY(6px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
25%, | |
55%, | |
75%, | |
87%, | |
95%, | |
99% { | |
-webkit-transform: translateY(0px); | |
transform: translateY(0px); | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
} | |
100% { | |
-webkit-transform: translateY(0px); | |
transform: translateY(0px); | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
opacity: 1; | |
} | |
} | |
@keyframes bounce-bottom { | |
0% { | |
-webkit-transform: translateY(4px); | |
transform: translateY(4px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
opacity: 1; | |
} | |
24% { | |
opacity: 1; | |
} | |
40% { | |
-webkit-transform: translateY(6px); | |
transform: translateY(6px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
65% { | |
-webkit-transform: translateY(12px); | |
transform: translateY(12px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
85% { | |
-webkit-transform: translateY(6px); | |
transform: translateY(6px); | |
-webkit-animation-timing-function: ease-in; | |
animation-timing-function: ease-in; | |
} | |
25%, | |
55%, | |
75%, | |
87%, | |
95%, | |
99% { | |
-webkit-transform: translateY(0px); | |
transform: translateY(0px); | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
} | |
100% { | |
-webkit-transform: translateY(0px); | |
transform: translateY(0px); | |
-webkit-animation-timing-function: ease-out; | |
animation-timing-function: ease-out; | |
opacity: 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment