Feature: the icons are added#91
Conversation
|
Thank you for submitting a pull request. Please ensure your changes comply with the project's contribution guidelines and that all workflow checks pass successfully. A maintainer will review your submission shortly. |
jagdish-15
left a comment
There was a problem hiding this comment.
Commit the changes suggested, and we should be ready to merge this
| @@ -1 +1 @@ | |||
| document.addEventListener("DOMContentLoaded", () => { | |||
There was a problem hiding this comment.
| if (!document.querySelector('link[data-font-awesome]')) { | |
| const iconStylesheet = document.createElement("link"); | |
| iconStylesheet.rel = "stylesheet"; | |
| iconStylesheet.href = | |
| "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"; | |
| iconStylesheet.setAttribute("data-font-awesome", "true"); | |
| document.head.appendChild(iconStylesheet); | |
| } | |
| document.addEventListener("DOMContentLoaded", () => { |
Adding this will dynamically load the stylesheet on any page that uses the shared footer component
| <link | ||
| rel="stylesheet" | ||
| href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" | ||
| /> |
There was a problem hiding this comment.
| <link | |
| rel="stylesheet" | |
| href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" | |
| /> |
Since footer.js is used across all pages except the home page, adding the Font Awesome stylesheet only to leaderboard.html won't make the icons available on the other pages using the shared footer component.
A better approach would be to load the stylesheet dynamically from the footer.js file itself, so we can remove the direct stylesheet import from here.
Hi, @jagdish-15
closes #85
Added social media icons to the footer links to improve visual appearance and make navigation to CodePVG's social platforms more intuitive.