Fix: \n 1. Set GitHub contributions calendar scroll position to start at right-most (latest date). \n 2. Set GitHub contributions calendar first column with day of week axis labels to fixed position above scrollable rest of table. \n 3. Removed light-mode-icon.svg

This commit is contained in:
2025-03-06 17:09:33 +00:00
parent e5e29273a9
commit e1597f496f
12 changed files with 47 additions and 61 deletions

View File

@@ -17,6 +17,7 @@ function hookupPage() {
hookupScroll();
// hookupProjectThumbnails();
hookupProjectDetailButtons();
hookupGitHubContributionsCalendar();
}
function hookupPageLocalStorage() {
let pageLocalStorage = getPageLocalStorage();
@@ -54,6 +55,10 @@ function setPageLocalStorage(pageLocalStorage) {
localStorage.setItem(pageHash, JSON.stringify(pageLocalStorage));
}
function hookupNav() {
hookupNavLinks();
// Google Translate feature hooked up by plugin call
}
function hookupNavLinks() {
document.querySelectorAll('nav a').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
@@ -226,3 +231,27 @@ function hookupProjectDetailButtons() {
});
});
}
function hookupGitHubContributionsCalendar() {
// Basic implementation
// e - statistics are all 0
GitHubCalendar(".github-calendar", "Teddy-1024");
// Or with responsive option enabled:
// e - statistics are all 0
// GitHubCalendar(".github-calendar", "Teddy-1024", { responsive: true });
/*
// Or with proxy option enabled:
// e - statistics are all 0
GitHubCalendar(".github-calendar", "Teddy-1024", {
responsive: true,
proxy: function(username) {
return fetch(`https://cors-anywhere.herokuapp.com/https://github.com/users/${username}/contributions`)
.then(response => response.text());
}
});
*/
const scrollableElement = document.querySelector('.github-calendar table.js-calendar-graph-table');
scrollableElement.scrollLeft = scrollableElement.scrollWidth - scrollableElement.clientWidth;
}