|
1 |
| -<h1> jQuery Plugins </h1> |
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <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."> |
| 7 | + <title>jQuery Plugins List</title> |
| 8 | + <style> |
| 9 | + body { |
| 10 | + font-family: Arial, sans-serif; |
| 11 | + background-color: #f4f4f4; |
| 12 | + margin: 0; |
| 13 | + padding: 20px; |
| 14 | + } |
| 15 | + .container { |
| 16 | + max-width: 800px; |
| 17 | + margin: auto; |
| 18 | + background: #fff; |
| 19 | + padding: 20px; |
| 20 | + border-radius: 8px; |
| 21 | + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); |
| 22 | + } |
| 23 | + h1 { |
| 24 | + text-align: center; |
| 25 | + color: #333; |
| 26 | + } |
| 27 | + ul { |
| 28 | + list-style: none; |
| 29 | + padding: 0; |
| 30 | + } |
| 31 | + li { |
| 32 | + background: #fff; |
| 33 | + margin: 10px 0; |
| 34 | + padding: 12px; |
| 35 | + border-radius: 5px; |
| 36 | + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| 37 | + transition: transform 0.2s ease-in-out; |
| 38 | + } |
| 39 | + li:hover { |
| 40 | + transform: translateY(-3px); |
| 41 | + } |
| 42 | + a { |
| 43 | + text-decoration: none; |
| 44 | + color: #007BFF; |
| 45 | + font-size: 18px; |
| 46 | + font-weight: bold; |
| 47 | + } |
| 48 | + a:hover { |
| 49 | + text-decoration: underline; |
| 50 | + } |
| 51 | + </style> |
| 52 | +</head> |
| 53 | +<body> |
| 54 | + |
| 55 | + <div class="container"> |
| 56 | + <h1>jQuery Plugins List</h1> |
| 57 | + <div id="posts">Loading plugins...</div> |
| 58 | + </div> |
| 59 | + |
| 60 | + <script> |
| 61 | + document.addEventListener("DOMContentLoaded", function () { |
| 62 | + const sitemapUrl = "https://codehimblog.github.io/sitemap_jquery.xml"; |
| 63 | + const postsContainer = document.getElementById("posts"); |
| 64 | + |
| 65 | + fetch(sitemapUrl) |
| 66 | + .then(response => response.text()) |
| 67 | + .then(str => new window.DOMParser().parseFromString(str, "text/xml")) |
| 68 | + .then(xml => { |
| 69 | + const urls = xml.getElementsByTagName("url"); |
| 70 | + const ul = document.createElement("ul"); |
| 71 | + |
| 72 | + for (let url of urls) { |
| 73 | + let loc = url.getElementsByTagName("loc")[0].textContent; |
| 74 | + |
| 75 | + // Extract the title after "/jquery-plugins/" and before ".html" |
| 76 | + let match = loc.match(/\/jquery-plugins\/(.+?)\.html/); |
| 77 | + 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(" "); |
| 82 | + |
| 83 | + // Create list item with link |
| 84 | + let li = document.createElement("li"); |
| 85 | + let a = document.createElement("a"); |
| 86 | + a.href = loc; |
| 87 | + a.textContent = title; |
| 88 | + a.target = "_blank"; // Open link in new tab |
| 89 | + |
| 90 | + li.appendChild(a); |
| 91 | + ul.appendChild(li); |
| 92 | + } |
| 93 | + } |
| 94 | + |
| 95 | + postsContainer.innerHTML = ""; // Clear loading text |
| 96 | + postsContainer.appendChild(ul); |
| 97 | + }) |
| 98 | + .catch(error => { |
| 99 | + console.error("Error fetching sitemap:", error); |
| 100 | + postsContainer.innerHTML = "Failed to load plugins."; |
| 101 | + }); |
| 102 | + }); |
| 103 | + </script> |
| 104 | + |
| 105 | +</body> |
| 106 | +</html> |
0 commit comments