File tree Expand file tree Collapse file tree 2 files changed +28
-9
lines changed Expand file tree Collapse file tree 2 files changed +28
-9
lines changed Original file line number Diff line number Diff line change @@ -788,15 +788,19 @@ span[style="display:flex;background-color:#3c3d38"] {
788
788
789
789
.taxny-card {
790
790
margin : 10px ;
791
- box-shadow : var (--shadow );
792
- padding : 5px ;
793
- border-radius : var (--radius );
791
+ /* box-shadow: var(--shadow); */
792
+ /* padding: 5px; */
793
+ /* border-radius: var(--radius); */
794
794
}
795
795
796
796
.taxny-card a {
797
797
text-decoration : none;
798
798
}
799
799
800
+ .taxny-card span {
801
+ display : none;
802
+ }
803
+
800
804
.comment {
801
805
margin-top : 2rem ;
802
806
}
Original file line number Diff line number Diff line change 6
6
// ["#taxny-card-container"] -> ["#lst"]
7
7
// [".taxny-card"] -> ["li"]
8
8
//
9
+ // const tagList = document.querySelector("#taxny-card-container");
10
+ // if (tagList) {
11
+ // const itemArr = Array.from(tagList.querySelectorAll(".taxny-card"));
12
+ // itemArr.sort(
13
+ // (a, b) =>
14
+ // Number(b.querySelector("div span").innerText) -
15
+ // Number(a.querySelector("div span").innerText)
16
+ // );
17
+ // tagList.innerHTML = "";
18
+ // itemArr.forEach((item) => tagList.appendChild(item));
19
+ // }
20
+
21
+ //
22
+ // Tag size by tag count
23
+ //
9
24
const tagList = document . querySelector ( "#taxny-card-container" ) ;
10
25
if ( tagList ) {
11
26
const itemArr = Array . from ( tagList . querySelectorAll ( ".taxny-card" ) ) ;
12
- itemArr . sort (
13
- ( a , b ) =>
14
- Number ( b . querySelector ( "div span" ) . innerText ) -
15
- Number ( a . querySelector ( "div span" ) . innerText )
27
+ const maxNumber = Math . max (
28
+ ...itemArr . map ( ( item ) => item . querySelector ( "div span" ) . innerText )
16
29
) ;
17
- tagList . innerHTML = "" ;
18
- itemArr . forEach ( ( item ) => tagList . appendChild ( item ) ) ;
30
+ itemArr . forEach ( ( item ) => {
31
+ item . querySelector ( "div a" ) . style . fontSize =
32
+ 0.8 + item . querySelector ( "div span" ) . innerText / maxNumber + "em" ;
33
+ } ) ;
19
34
}
20
35
21
36
//
You can’t perform that action at this time.
0 commit comments