-
Notifications
You must be signed in to change notification settings - Fork 0
/
scrolltotop.css
93 lines (84 loc) · 2.34 KB
/
scrolltotop.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*--------------------------------------------------------------------------
Styles for the scroll to top button
--------------------------------------------------------------------------*/
@keyframes scroll-top-bounce {
0%,
20%,
60%,
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
40% {
-webkit-transform: translateY(-4px);
transform: translateY(-4px);
}
80% {
-webkit-transform: translateY(-2px);
transform: translateY(-2px);
}
}
.scroll-top .scroll-top-button {
position: fixed;
bottom: 0;
right: 0;
left: 0;
background: #fff;
-webkit-border-top-left-radius: 8px;
-moz-border-top-left-radius: 8px;
border-top-left-radius: 8px;
-webkit-border-top-right-radius: 8px;
-moz-border-top-right-radius: 8px;
border-top-right-radius: 8px;
font-size: 16px;
}
@media only screen and (max-width: 768px) {
.scroll-top .scroll-top-button .scroll-top-text {
display: none;
}
.scroll-top .scroll-top-button .scroll-top-arrow {
left: 48%;
right: auto;
-webkit-animation: scroll-top-bounce 2s infinite;
-moz-animation: scroll-top-bounce 2s infinite;
-o-animation: scroll-top-bounce 2s infinite;
animation: scroll-top-bounce 2s infinite;
}
}
@media only screen and (min-width: 768px) {
.scroll-top .scroll-top-button {
width: 48px;
height: 48px;
padding: 2px 16px;
right: auto;
left: 48%;
color: #000;
}
.scroll-top .scroll-top-button .scroll-top-arrow {
padding-top: 8px;
}
.scroll-top .scroll-top-button .scroll-top-text {
opacity: 0;
}
.scroll-top .scroll-top-button:hover {
-webkit-transition: .5s;
-moz-transition: .5s;
-o-transition: .5s;
-ms-transition: .5s;
transition: .5s;
width: 150px;
width: 150px;
left: 45%;
}
.scroll-top .scroll-top-button:hover .scroll-top-text {
opacity: 1;
font-size: 16px;
padding-left: 12px;
}
.scroll-top .scroll-top-button:hover .scroll-top-arrow {
-webkit-animation: scroll-top-bounce 1s;
-moz-animation: scroll-top-bounce 1s;
-o-animation: scroll-top-bounce 1s;
animation: scroll-top-bounce 1s;
}
}