File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -471,4 +471,31 @@ font-size:16px;
471471
472472}
473473
474+ }# scrollTopBtn {
475+ position : fixed;
476+ bottom : 30px ;
477+ right : 30px ;
478+ background : linear-gradient (135deg , # 00e6a8, # 64ffda );
479+ color : # 000 ;
480+ border : none;
481+ padding : 14px 16px ;
482+ border-radius : 50% ;
483+ font-size : 18px ;
484+ cursor : pointer;
485+ display : none;
486+ z-index : 1000 ;
487+ box-shadow : 0 0 15px rgba (100 , 255 , 218 , 0.7 );
488+ transition : all 0.3s ease;
489+ }
490+
491+ # scrollTopBtn : hover {
492+ transform : translateY (-4px ) scale (1.1 );
493+ box-shadow : 0 0 25px rgba (100 , 255 , 218 , 1 );
494+ }
495+
496+ /* Dark Mode */
497+
498+ body .dark-mode # scrollTopBtn {
499+ background : linear-gradient (135deg , # 64ffda, # 00bfa5 );
500+ color : white;
474501}
Original file line number Diff line number Diff line change 88< title > Receipt Scanner | ExpenseFlow</ title >
99
1010< script src ="https://cdn.jsdelivr.net/npm/tesseract.js@4/dist/tesseract.min.js "> </ script >
11-
11+ < link rel =" stylesheet " href =" https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css " >
1212< link rel ="stylesheet " href ="receipt.css ">
1313
1414</ head >
@@ -97,6 +97,10 @@ <h2>Saved Expenses</h2>
9797< span id ="popupMsg "> </ span >
9898
9999</ div >
100+ <!-- Scroll To Top Button -->
101+ < button id ="scrollTopBtn " title ="Go to top ">
102+ < i class ="fas fa-arrow-up "> </ i >
103+ </ button >
100104< script src ="receipt.js "> </ script >
101105
102106</ body >
Original file line number Diff line number Diff line change @@ -251,4 +251,19 @@ popup.classList.remove("show");
251251
252252} , 3000 ) ;
253253
254- }
254+ } const scrollBtn = document . getElementById ( "scrollTopBtn" ) ;
255+
256+ window . onscroll = function ( ) {
257+ if ( document . body . scrollTop > 100 || document . documentElement . scrollTop > 100 ) {
258+ scrollBtn . style . display = "block" ;
259+ } else {
260+ scrollBtn . style . display = "none" ;
261+ }
262+ } ;
263+
264+ scrollBtn . addEventListener ( "click" , function ( ) {
265+ window . scrollTo ( {
266+ top : 0 ,
267+ behavior : "smooth"
268+ } ) ;
269+ } ) ;
You can’t perform that action at this time.
0 commit comments