Skip to content

Commit

Permalink
Merge pull request #1583 from aslams2020/LastUpdatedFunc
Browse files Browse the repository at this point in the history
✔️Implemented Dynamic "Last Updated" Functionality to All Legal Pages !
  • Loading branch information
sunny0625 authored Aug 9, 2024
2 parents d800494 + 06e3d69 commit 0a6448e
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Html-files/Licensing.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,22 @@
text-shadow: #FC0 1px 0 6px;
text-decoration: none;
}

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

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


</style>
<style> #progressBar {
position: fixed;
Expand Down Expand Up @@ -297,6 +313,11 @@ <h1>Licensing Page</h1>
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.</p>

<div class="Lastupdate">
Last updated: <span id="last-updated-date"></span>
</div>

</div>
<hr>
<footer class="copyright-footer">
Expand Down Expand Up @@ -440,6 +461,46 @@ <h4>Follow Us</h4>
</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()]; // Get the full month name
const year = now.getFullYear();
dateElement.textContent = `${month} ${day}, ${year}`;
}

// Update the date weekly
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);
}

// Initialize weekly updates
updateWeekly();
});
</script>


<button id="scroll-top-button" class="scroll-top-button" onclick="goToTop()">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="white"
class="arrow">
Expand Down
58 changes: 58 additions & 0 deletions Html-files/privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@
text-shadow: #FC0 1px 0 6px;
text-decoration: none;
}

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

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

</style>
<style> #progressBar {
position: fixed;
Expand Down Expand Up @@ -201,6 +216,10 @@
<main class="main-container">
<h1>PRIVACY POLICY</h1>
<hr>
<div class="Lastupdate">
Last updated: <span id="last-updated-date"></span>
</div>

<section class="pri-section">
<p>Foodie is a food ordering website that aims to provide users with a seamless experience for ordering food online, taking orders for pickup, and booking tables for dining in. The website showcases the quality and specialties of the food offered, along with a variety of services to cater to different user preferences.</p>
</section>
Expand Down Expand Up @@ -374,6 +393,45 @@ <h4>Follow Us</h4>
</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()]; // Get the full month name
const year = now.getFullYear();
dateElement.textContent = `${month} ${day}, ${year}`;
}

// Update the date weekly
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);
}

// Initialize weekly updates
updateWeekly();
});
</script>

<button id="scroll-top-button" class="scroll-top-button" onclick="goToTop()">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="white"
class="arrow">
Expand Down
58 changes: 58 additions & 0 deletions Html-files/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@
text-shadow: #FC0 1px 0 6px;
text-decoration: none;
}

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

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


</style>
<style> #progressBar {
position: fixed;
Expand Down Expand Up @@ -201,6 +217,9 @@
<main class= "main-container">
<h1>TERMS AND CONDITIONS</h1>
<hr>
<div class="Lastupdate">
Last updated: <span id="last-updated-date"></span>
</div>
<section class="terms-section">
<p>Foodie is a food ordering website that aims to provide users with a seamless experience for ordering food online, taking orders for pickup, and booking tables for dining in. The website showcases the quality and specialties of the food offered, along with a variety of services to cater to different user preferences.</p>
</section>
Expand Down Expand Up @@ -409,6 +428,45 @@ <h4>Follow Us</h4>
</svg>
</button>

<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()]; // Get the full month name
const year = now.getFullYear();
dateElement.textContent = `${month} ${day}, ${year}`;
}

// Update the date weekly
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);
}

// Initialize weekly updates
updateWeekly();
});
</script>


<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script src="Html-files/top.js"></script>
Expand Down

0 comments on commit 0a6448e

Please sign in to comment.