1
1
/* Style the button */
2
- .Btn {
3
- width : 45px ;
4
- height : 45px ;
5
- background : linear-gradient (# 44ea76, # 39fad7 );
6
- display : flex;
7
- align-items : center;
8
- justify-content : center;
9
- border-radius : 50% ;
10
- cursor : pointer;
11
- position : fixed; /* Fixed position */
12
- bottom : 20px ; /* Place the button at the bottom */
13
- right : 30px ; /* Place the button 30px from the right */
14
- z-index : 99 ; /* Make sure it does not overlap */
15
- border : none; /* Remove borders */
16
- }
17
-
18
- .arrow path {
19
- fill : white;
20
- }
21
-
22
- .text {
23
- font-size : 0.7em ;
24
- width : 100px ;
25
- position : absolute;
26
- color : white;
27
- display : flex;
28
- align-items : center;
29
- justify-content : center;
30
- bottom : -18px ;
2
+ body {
3
+ min-width : 400px ;
4
+ }
5
+ .back-to-top-btn {
6
+ width : 45px ;
7
+ height : 45px ;
8
+ background : linear-gradient (# 44ea76, # 39fad7 );
9
+ display : flex;
10
+ align-items : center;
11
+ justify-content : center;
12
+ border-radius : 50% ;
13
+ cursor : pointer;
14
+ position : fixed; /* Fixed position */
15
+ bottom : 20px ; /* Place the button at the bottom */
16
+ right : 30px ; /* Place the button 30px from the right */
17
+ z-index : 99 ; /* Make sure it does not overlap */
18
+ border : none; /* Remove borders */
19
+ }
20
+
21
+ .arrow path {
22
+ fill : white;
23
+ }
24
+
25
+ .text {
26
+ font-size : 0.7em ;
27
+ width : 100px ;
28
+ position : absolute;
29
+ color : white;
30
+ display : flex;
31
+ align-items : center;
32
+ justify-content : center;
33
+ bottom : -18px ;
34
+ opacity : 0 ;
35
+ transition-duration : 0.7s ;
36
+ }
37
+
38
+ .back-to-top-btn : hover .text {
39
+ opacity : 1 ;
40
+ transition-duration : 0.7s ;
41
+ }
42
+
43
+ .back-to-top-btn : hover .arrow {
44
+ animation : slide-in-bottom 0.7s cubic-bezier (0.25 , 0.46 , 0.45 , 0.94 ) both;
45
+ }
46
+
47
+ @keyframes slide-in-bottom {
48
+ 0% {
49
+ transform : translateY (10px );
31
50
opacity : 0 ;
32
- transition-duration : .7s ;
33
51
}
34
-
35
- .Btn : hover .text {
52
+
53
+ 100% {
54
+ transform : translateY (0 );
36
55
opacity : 1 ;
37
- transition-duration : .7s ;
38
- }
39
-
40
- .Btn : hover .arrow {
41
- animation : slide-in-bottom .7s cubic-bezier (0.250 , 0.460 , 0.450 , 0.940 ) both;
42
- }
43
-
44
- @keyframes slide-in-bottom {
45
- 0% {
46
- transform : translateY (10px );
47
- opacity : 0 ;
48
- }
49
-
50
- 100% {
51
- transform : translateY (0 );
52
- opacity : 1 ;
53
- }
54
56
}
55
-
57
+ }
0 commit comments