33< head >
44 < meta charset ="UTF-8 ">
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6- < meta name ="description " content ="Browse a list of free jQuery plugins to use in your projects. Find the latest jQuery plugins with direct links. ">
6+ < meta name ="description " content ="Browse a list of free jQuery plugins to use in your web projects. Find the latest jQuery plugins with direct links and last update dates . ">
77 < title > jQuery Plugins List</ title >
88 < style >
99 body {
10- font-family : Arial, sans-serif;
11- background-color : # f4f4f4 ;
10+ font-family : ' Arial' , sans-serif;
11+ background-color : # f8f9fa ;
1212 margin : 0 ;
1313 padding : 20px ;
1414 }
1717 margin : auto;
1818 background : # fff ;
1919 padding : 20px ;
20- border-radius : 8 px ;
21- box-shadow : 0 0 10px rgba (0 , 0 , 0 , 0.1 );
20+ border-radius : 10 px ;
21+ box-shadow : 0 4 px 10px rgba (0 , 0 , 0 , 0.1 );
2222 }
2323 h1 {
2424 text-align : center;
2929 padding : 0 ;
3030 }
3131 li {
32- background : # fff ;
33- margin : 10 px 0 ;
34- padding : 12 px ;
35- border-radius : 5 px ;
36- box-shadow : 0 2px 4 px rgba (0 , 0 , 0 , 0.1 );
32+ background : # ffffff ;
33+ margin : 15 px 0 ;
34+ padding : 15 px ;
35+ border-radius : 8 px ;
36+ box-shadow : 0 2px 5 px rgba (0 , 0 , 0 , 0.1 );
3737 transition : transform 0.2s ease-in-out;
3838 }
3939 li : hover {
40- transform : translateY (-3 px );
40+ transform : translateY (-4 px );
4141 }
4242 a {
4343 text-decoration : none;
4848 a : hover {
4949 text-decoration : underline;
5050 }
51+ .meta-info {
52+ display : flex;
53+ justify-content : space-between;
54+ font-size : 14px ;
55+ color : # 666 ;
56+ margin-top : 5px ;
57+ }
58+ .meta-info span {
59+ background : # eef1f7 ;
60+ padding : 5px 10px ;
61+ border-radius : 5px ;
62+ }
5163 </ style >
5264</ head >
5365< body >
@@ -62,6 +74,14 @@ <h1>jQuery Plugins List</h1>
6274 const sitemapUrl = "https://codehimblog.github.io/sitemap_jquery.xml" ;
6375 const postsContainer = document . getElementById ( "posts" ) ;
6476
77+ // Function to format branding names properly
78+ function formatTitleCase ( text ) {
79+ const specialWords = [ "jQuery" , "HTML" , "CSS" , "Bootstrap" , "JavaScript" , "React" , "Vue" , "Angular" ] ; // Known brand names
80+ return text . split ( "-" ) . map ( word => {
81+ return specialWords . includes ( word ) ? word : word . charAt ( 0 ) . toUpperCase ( ) + word . slice ( 1 ) ;
82+ } ) . join ( " " ) ;
83+ }
84+
6585 fetch ( sitemapUrl )
6686 . then ( response => response . text ( ) )
6787 . then ( str => new window . DOMParser ( ) . parseFromString ( str , "text/xml" ) )
@@ -71,23 +91,29 @@ <h1>jQuery Plugins List</h1>
7191
7292 for ( let url of urls ) {
7393 let loc = url . getElementsByTagName ( "loc" ) [ 0 ] . textContent ;
94+ let lastmod = url . getElementsByTagName ( "lastmod" ) [ 0 ] ?. textContent || "Unknown Date" ;
7495
75- // Extract the title after "/jquery-plugins/" and before ".html"
96+ // Extract the plugin title and author
7697 let match = loc . match ( / \/ j q u e r y - p l u g i n s \/ ( .+ ?) \. h t m l / ) ;
7798 if ( match ) {
78- let title = match [ 1 ]
79- . split ( "-" ) // Split by dashes
80- . map ( word => word . charAt ( 0 ) . toUpperCase ( ) + word . slice ( 1 ) ) // Convert to title case
81- . join ( " " ) ;
99+ let rawTitle = match [ 1 ] ;
100+ let title = formatTitleCase ( rawTitle . replace ( / - b y - . + $ / , "" ) ) ; // Remove author from title
101+ let authorMatch = rawTitle . match ( / - b y - ( . + ) $ / ) ;
102+ let author = authorMatch ? formatTitleCase ( authorMatch [ 1 ] ) : "Unknown" ;
82103
83104 // Create list item with link
84105 let li = document . createElement ( "li" ) ;
85106 let a = document . createElement ( "a" ) ;
86107 a . href = loc ;
87108 a . textContent = title ;
88109 a . target = "_blank" ; // Open link in new tab
89-
110+
111+ let metaDiv = document . createElement ( "div" ) ;
112+ metaDiv . className = "meta-info" ;
113+ metaDiv . innerHTML = `<span>🗓️ ${ lastmod } </span> <span>👤 ${ author } </span>` ;
114+
90115 li . appendChild ( a ) ;
116+ li . appendChild ( metaDiv ) ;
91117 ul . appendChild ( li ) ;
92118 }
93119 }
0 commit comments