1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 01:09:35 +05:30

(refactor): switched to auto age and yoe calculation and improved load time by replacing render blocking scripts

This commit is contained in:
2024-04-02 14:26:20 +05:30
parent d0b8ac6841
commit 40f690db92
6 changed files with 17 additions and 8 deletions

View File

@@ -1,5 +1,9 @@
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script type="text/javascript" src="assets/js/preloader-config.js"></script>
<script type="text/javascript" src="assets/js/navmenu-config.js"></script>
<script type="text/javascript" src="assets/js/floatingbar-config.js"></script>
<script type="text/javascript" src="assets/js/keybinding-config.js"></script>
<script type="text/javascript" src="assets/js/tippy-config.js"></script>
<script type="text/javascript" src="assets/js/tippy-config.js"></script>
<script type="text/javascript" src="assets/js/aos-config.js"></script>

View File

@@ -10,9 +10,7 @@
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<script src="https://cdn.lordicon.com/lordicon-1.2.0.js"></script>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script src="assets/js/utility-functions.js"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $_ENV['ANALYTICS_ID'] ?>"></script>
<script>

View File

@@ -0,0 +1,10 @@
//---JS utility functions
// function to calculate the year difference between the given date and the current date
function calculateYearDiff(date) {
let givenDate = new Date(date);
let currentDate = new Date();
let timeDiff = currentDate.getTime() - givenDate.getTime();
let years = Math.floor(timeDiff / (1000 * 3600 * 24 * 365.25));
return years;
}