File tree Expand file tree Collapse file tree 3 files changed +103
-0
lines changed Expand file tree Collapse file tree 3 files changed +103
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* Clear Filters Button Styles to match filter-select dimensions */
2
+ .filter-clear-btn {
3
+ padding : 0.5rem 0.50rem ;
4
+ border : 1px solid # d1d5db ;
5
+ border-radius : 8px ;
6
+ font-size : 0.875rem ;
7
+ background : white;
8
+ color : # 6b7280 ;
9
+ cursor : pointer;
10
+ display : flex;
11
+ align-items : center;
12
+ justify-content : center;
13
+ gap : 0.5rem ;
14
+ transition : all 0.2s ease;
15
+ width : auto;
16
+ min-width : 40px ;
17
+ }
18
+
19
+ .filter-clear-btn i {
20
+ font-size : 1.1rem ;
21
+ }
22
+
23
+ .filter-clear-btn : hover {
24
+ background : # f9fafb ;
25
+ border-color : # 2563eb ;
26
+ }
27
+
28
+ .filter-clear-btn : focus {
29
+ outline : none;
30
+ border-color : # 2563eb ;
31
+ box-shadow : 0 0 0 2px rgba (37 , 99 , 235 , 0.2 );
32
+ }
33
+
34
+ body .dark-mode .filter-clear-btn {
35
+ background : # 1f2937 ;
36
+ border-color : # 4b5563 ;
37
+ color : # 9ca3af ;
38
+ }
39
+
40
+ body .dark-mode .filter-clear-btn : hover {
41
+ background : # 374151 ;
42
+ border-color : # 3b82f6 ;
43
+ }
44
+
45
+ body .dark-mode .filter-clear-btn : focus {
46
+ border-color : # 3b82f6 ;
47
+ box-shadow : 0 0 0 2px rgba (59 , 130 , 246 , 0.2 );
48
+ }
49
+
50
+ .tooltip-container {
51
+ position : relative;
52
+ display : inline-block;
53
+ }
54
+
55
+ .icon-btn {
56
+ background : none;
57
+ border : none;
58
+ cursor : pointer;
59
+ font-size : 18px ;
60
+ color : # 6b7280 ;
61
+ }
62
+
63
+ .tooltip-text {
64
+ visibility : hidden;
65
+ opacity : 0 ;
66
+ position : absolute;
67
+ left : 120% ;
68
+ top : 50% ;
69
+ transform : translateY (-50% );
70
+ background-color : # 333 ;
71
+ color : # fff ;
72
+ padding : 4px 8px ;
73
+ border-radius : 4px ;
74
+ white-space : nowrap;
75
+ font-size : 12px ;
76
+ }
77
+
78
+ .tooltip-container : hover .tooltip-text {
79
+ display : block;
80
+ }
81
+
Original file line number Diff line number Diff line change 21
21
< link rel ="icon " type ="image/png " sizes ="48x48 " href ="/favicon/favicon-48x48.png " />
22
22
< link rel ="icon " type ="image/png " sizes ="32x32 " href ="/favicon/favicon-32x32.png " />
23
23
< link rel ="icon " type ="image/png " sizes ="16x16 " href ="/favicon/favicon-16x16.png " />
24
+ < link rel ="stylesheet " href ="./css/removeFilterBtn.css ">
24
25
< link rel ="manifest " href ="/site.webmanifest " />
25
26
< style >
26
27
/* Ensure dark mode styles work */
@@ -764,9 +765,18 @@ <h1 class="header-title">
764
765
< option value ="year-asc "> Oldest First</ option >
765
766
</ select >
766
767
</ div >
768
+ <!-- Clear Filters button added #issue-602 -->
769
+ < div class ="filter-container ">
770
+ < button id ="clearFiltersBtn " class ="filter-clear-btn " title ="Clear all filters ">
771
+ < i class ="fas fa-eraser " style ="color: #6b7280 "> </ i >
772
+ </ button >
773
+ <!-- hover text for clear filter button -->
774
+ < span class ="tooltip-text "> Clear all filters</ span >
775
+ </ div >
767
776
</ div >
768
777
</ div >
769
778
</ div >
779
+ <!-- Filter section ends here -->
770
780
< div class ="main-grid ">
771
781
<!-- Papers List -->
772
782
< div class ="papers-section ">
@@ -1395,6 +1405,8 @@ <h4>Connect</h4>
1395
1405
} ) ;
1396
1406
} ) ;
1397
1407
</ script >
1408
+
1409
+ < script src ="./js/filterBtn.js "> </ script >
1398
1410
</ body >
1399
1411
1400
1412
</ html>
Original file line number Diff line number Diff line change
1
+ document . getElementById ( "clearFiltersBtn" ) . addEventListener ( "click" , function ( ) {
2
+ document . getElementById ( "searchInput" ) . value = "" ;
3
+ document . getElementById ( "topicFilter" ) . selectedIndex = 0 ;
4
+ document . getElementById ( "minYear" ) . selectedIndex = 0 ;
5
+ document . getElementById ( "favoriteFilter" ) . selectedIndex = 0 ;
6
+ document . getElementById ( "ratingFilter" ) . selectedIndex = 0 ;
7
+ document . getElementById ( "sortFilter" ) . selectedIndex = 0 ;
8
+
9
+ filterPapers ( ) ;
10
+ } ) ;
You can’t perform that action at this time.
0 commit comments