Skip to content

Commit

Permalink
Merge pull request #757 from Tejashri-Taral/FixLastUpdated
Browse files Browse the repository at this point in the history
✔️ Fix "Last Updated" Functionality in ALL Legal Pages!
  • Loading branch information
ayush-t02 authored Aug 10, 2024
2 parents aeaf073 + 3b36efa commit 948900c
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 4 deletions.
51 changes: 51 additions & 0 deletions pages/licensing.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<!-- Logo of the game -->
<link rel="icon" href="../assets/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../assets/favicon.ico" type="image/x-icon" />
<style>

.Lastupdate {
margin-bottom: 14px;
font-size: 15px;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, serif;
font-weight: 500;
margin-top: 0px;
}

#last-updated-date {
font-size: 15px;
}

</style>
</head>

<body>
Expand Down Expand Up @@ -63,6 +78,9 @@ <h2 class="section-title">MIT License</h2>
SOFTWARE.
</pre>
</section>
<div class="Lastupdate">
Last updated: <span id="last-updated-date"></span>
</div>
</main>
<center>
<button class="back-button">
Expand All @@ -79,6 +97,39 @@ <h2 class="section-title">MIT License</h2>
yearSpan.textContent = currentYear;
});
</script>

<script>

document.addEventListener("DOMContentLoaded", () => {
function updateLastUpdatedDate() {
const dateElement = document.getElementById("last-updated-date");
if (dateElement) {
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();
// Use backticks for template literals
dateElement.textContent = `${month} ${day}, ${year}`;
}
}

// Initialize the date update
updateLastUpdatedDate();
});

window.onscroll = function () {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("progressBar").style.width = scrolled + "%";
};

</script>

</body>

</html>
53 changes: 51 additions & 2 deletions pages/privacypolicy.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<!-- Logo of the game -->
<link rel="icon" href="../assets/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../assets/favicon.ico" type="image/x-icon" />
<style>

.Lastupdate {
margin-bottom: 14px;
font-size: 15px;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, serif;
font-weight: 500;
margin-top: 0px;
}

#last-updated-date {
font-size: 15px;
}

</style>
</head>

<body>
Expand All @@ -29,7 +44,9 @@ <h1 class="title" id="privacy-policy-title">Privacy Policy</h1>
</header>
<main class="main-content">
<section class="section">
Last updated: <span id="last-updated-date"></span>
<div class="Lastupdate">
Last updated: <span id="last-updated-date"></span>
</div>
<h2 class="section-title">Introduction</h2>
<p class="section-content">
Welcome to Dot Box. We value your privacy and are committed to
Expand Down Expand Up @@ -149,7 +166,39 @@ <h2 class="section-title">Contact Us</h2>
</center>
</div>
</div>
<script src="../js/updateDates.js"></script>

<script>

document.addEventListener("DOMContentLoaded", () => {
function updateLastUpdatedDate() {
const dateElement = document.getElementById("last-updated-date");
if (dateElement) {
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();
// Use backticks for template literals
dateElement.textContent = `${month} ${day}, ${year}`;
}
}

// Initialize the date update
updateLastUpdatedDate();
});

window.onscroll = function () {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("progressBar").style.width = scrolled + "%";
};

</script>

</body>

</html>
53 changes: 51 additions & 2 deletions pages/termsofservice.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
<!-- Logo of the game -->
<link rel="icon" href="../assets/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../assets/favicon.ico" type="image/x-icon" />

<style>

.Lastupdate {
margin-bottom: 14px;
font-size: 15px;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, serif;
font-weight: 500;
margin-top: 0px;
}

#last-updated-date {
font-size: 15px;
}

</style>

</head>

<body>
Expand All @@ -29,7 +46,9 @@ <h1 class="title" id="terms-conditions-title">Terms Of Services</h1>
</header>
<main class="main-content" id="terms-conditions-main">
<section class="section">
Last updated: <span id="last-updated-date"></span>
<div class="Lastupdate">
Last updated: <span id="last-updated-date"></span>
</div>
<h2 class="section-title">Introduction</h2>
<p class="section-content">
These terms and conditions outline the rules and regulations for
Expand Down Expand Up @@ -110,7 +129,37 @@ <h2 class="section-title">Contact Information</h2>
</center>
</div>
</div>
<script src="../js/updateDates.js"></script>
<script>

document.addEventListener("DOMContentLoaded", () => {
function updateLastUpdatedDate() {
const dateElement = document.getElementById("last-updated-date");
if (dateElement) {
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();
// Use backticks for template literals
dateElement.textContent = `${month} ${day}, ${year}`;
}
}

// Initialize the date update
updateLastUpdatedDate();
});

window.onscroll = function () {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("progressBar").style.width = scrolled + "%";
};

</script>
</body>

</html>

0 comments on commit 948900c

Please sign in to comment.