Skip to content

Commit

Permalink
Merge pull request #557 from aslams2020/LastUpdatedFunc
Browse files Browse the repository at this point in the history
✔️Added Dynamic "Last Updated" Functionality to All Legal Pages !
  • Loading branch information
aditya-bhaumik authored Aug 3, 2024
2 parents f4e3ee8 + cb29142 commit af4983d
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
60 changes: 60 additions & 0 deletions pages/privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@
display: none;
}
}


.Lastupdate {
margin-bottom: 18px;
font-size: 20px !important;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, serif !important;
font-weight: 700;
margin-top: 0px;
color: rgb(255, 171, 4) !important;
}

#last-updated-date {
font-size: 18px;
color: rgb(255, 255, 255) !important;
font-weight: 400 !important;
}



</style>
</head>
<body>
Expand Down Expand Up @@ -185,6 +204,7 @@ <h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 30px;
Privacy Policy
</h1>
<div class="privacyBox">
<div class="Lastupdate">Last updated: <span id="last-updated-date"></span></div>
<div class="heading">Privacy Policy</div>
<div class="desc">
This Privacy Policy describes how your personal information is collected, used, and shared when you visit or
Expand Down Expand Up @@ -274,6 +294,46 @@ <h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 30px;
</p>
</div>
</footer>


<script>
document.addEventListener("DOMContentLoaded", () => {
setTimeout(() => {
const loader = document.getElementById("loader");
if (loader) {
loader.style.display = "none";
} else {
console.error("Element with ID 'loader' not found.");
}
}, 500);

// Update the date dynamically
function updateLastUpdatedDate() {
const dateElement = document.getElementById("last-updated-date");
const now = new Date();
const day = now.getDate();
const monthNames = [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
const month = monthNames[now.getMonth()];
const year = now.getFullYear();
dateElement.textContent = `${month} ${day}, ${year}`;
}

function updateWeekly() {
const now = new Date();
const dayOfWeek = now.getDay(); // 0 (Sunday) to 6 (Saturday)
const timeUntilNextUpdate = (7 - dayOfWeek) * 24 * 60 * 60 * 1000; // Time until next Sunday
updateLastUpdatedDate();
setTimeout(updateWeekly, timeUntilNextUpdate);
}

updateWeekly();
});
</script>


<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="../js/background.js"></script>
<script src="../js/script.js"></script>
Expand Down
56 changes: 56 additions & 0 deletions pages/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@
display: none;
}
}

.Lastupdate {
margin-bottom: 18px;
font-size: 20px !important;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, serif !important;
font-weight: 700;
margin-top: 0px;
color: rgb(255, 171, 4) !important;
}

#last-updated-date {
font-size: 18px;
color: rgb(255, 255, 255) !important;
font-weight: 400 !important;
}


</style>
</head>
<body>
Expand Down Expand Up @@ -184,6 +201,7 @@ <h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 30px;
Terms and Conditions
</h1>
<div class="termsBox">
<div class="Lastupdate">Last updated: <span id="last-updated-date"></span></div>
<div class="heading">Terms and Conditions</div>
<div class="desc">
These terms and conditions outline the rules and regulations for the use of our website.
Expand Down Expand Up @@ -282,6 +300,44 @@ <h1 id="changingHeading" style="font-family: Arial, sans-serif; font-size: 30px;
</p>
</div>
</footer>

<script>
document.addEventListener("DOMContentLoaded", () => {
setTimeout(() => {
const loader = document.getElementById("loader");
if (loader) {
loader.style.display = "none";
} else {
console.error("Element with ID 'loader' not found.");
}
}, 500);

// Update the date dynamically
function updateLastUpdatedDate() {
const dateElement = document.getElementById("last-updated-date");
const now = new Date();
const day = now.getDate();
const monthNames = [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
const month = monthNames[now.getMonth()];
const year = now.getFullYear();
dateElement.textContent = `${month} ${day}, ${year}`;
}

function updateWeekly() {
const now = new Date();
const dayOfWeek = now.getDay(); // 0 (Sunday) to 6 (Saturday)
const timeUntilNextUpdate = (7 - dayOfWeek) * 24 * 60 * 60 * 1000; // Time until next Sunday
updateLastUpdatedDate();
setTimeout(updateWeekly, timeUntilNextUpdate);
}

updateWeekly();
});
</script>

<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="../js/background.js"></script>
<script src="../js/script.js"></script>
Expand Down

0 comments on commit af4983d

Please sign in to comment.