Feat: GitHub contributions calendar added to bottom of page.

This commit is contained in:
2025-03-05 13:04:57 +00:00
parent 22c884c007
commit 3912506f24
3 changed files with 88 additions and 11 deletions

View File

@@ -7,9 +7,22 @@
<!-- SEO -->
<meta name="yandex-verification" content="6d6eae9d533ef680" />
<!-- Security -->
<!--
<meta http-equiv="X-Frame-Options" content="SAMEORIGIN">
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate">
<!-- Stylesheet -->
-->
<!-- Stylesheets -->
<!--
GitHub Contributions Calendar (light mode default)
- Statistics under calendar do not work.
-->
<link rel="stylesheet" href="https://unpkg.com/github-calendar@latest/dist/github-calendar-responsive.css" />
<!--
GitHub Contributions Calendar (dark mode default)
- Statistics under calendar do not work.
- Requires https://github.com/forresttindall/Github-Activity-Calendar
<link rel="stylesheet" href="./Github-Activity-Calendar/github-calendar.css"/>
-->
<link rel="stylesheet" href="styles/styles.css">
</head>
<body>
@@ -200,6 +213,9 @@
<li>LinkedIn: <a href="https://www.linkedin.com/in/teddyms/">linkedin.com/in/teddyms</a></li>
<li>GitHub: <a href="https://github.com/Teddy-1024/">github.com/Teddy-1024</a></li>
</ul>
<div class="github-calendar">
<!-- GitHub activity calendar will be rendered here -->
</div>
</div>
</section>
</main>
@@ -210,8 +226,51 @@
</footer>
<!-- Scripts -->
<!-- Internal -->
<script type="text/javascript" src="scripts/scripts.js"></script>
<!-- External -->
<!-- Google Translate -->
<script>
function initGoogleTranslateElement() {
new google.translate.TranslateElement({
pageLanguage: 'en',
// layout: google.translate.TranslateElement.InlineLayout.SIMPLE
layout: google.translate.TranslateElement.InlineLayout.VERTICAL
}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=initGoogleTranslateElement"></script>
<!--
GitHub Contributions Calendar (light mode default)
- Statistics under calendar do not work.
-->
<script src="https://unpkg.com/github-calendar@latest/dist/github-calendar.min.js"></script>
<script>
// 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 });
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());
}
});
</script>
<!--
GitHub Contributions Calendar (dark mode default)
- Statistics under calendar do not work.
- Requires https://github.com/forresttindall/Github-Activity-Calendar
<script src="./Github-Activity-Calendar/github-calendar.js"></script>
<script>
GitHubCalendar(".github-calendar", "Teddy-1024");
</script>
-->
<script>
window.onload = function() {