Skip to content

Commit

Permalink
Update site size and render time
Browse files Browse the repository at this point in the history
  • Loading branch information
mastiff-systems343 committed Dec 5, 2024
1 parent 8f65f22 commit 4fbb03a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
12 changes: 8 additions & 4 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
<div class="row">
<!-- Copyright and Logo Section -->
<div class="col-md-4">
<p>&copy; {{ "now" | date: "%Y" }} Mastiff Systems. All rights reserved.</p>
<p><a href="{{ site.baseurl }}/legal/" class="author-name">Privacy Policy</a></p>
<a href="{{ site.baseurl }}/tech/"><img src="{{ site.baseurl }}/assets/img/clients/logo.png" alt="Company Logo" width="30">
</a>
</div>

<!-- Privacy Policy and Creative Commons -->
<div class="col-md-4 text-center">
<p><a href="{{ site.baseurl }}/legal/" class="author-name">Privacy Policy</a></p>
<p><a href="{{ site.baseurl }}/fb/" class="author-name">Facebook Free Social Media Statement</a></p>
<a href="https://network.creativecommons.org/">
<img src="{{ site.baseurl }}/assets/img/icons/cc.png" alt="Creative Commons Logo" height="31"/>
</a>
</div>

<!-- Total Size of Site and Render Time -->
<div class="col-md-4 text-right">
<p>Total Size of Site: {{ site.total_size | divided_by: 1024 | divided_by: 1024 | round: 2 }} MB</p>
<p>Render Time: {{ site.time | date: "%s" }} seconds</p>
<p>
Total Size of Site:
{{ site.total_size | divided_by: 1048576.0 | round: 2 }} MB
</p>

<p>Render Time: <span id="render-time">Calculating...</span></p>
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions fb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
layout: page
title: Facebook Free Social Media Statement
---
21 changes: 17 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1230,10 +1230,23 @@ <h3 class="section-subheading text-light">Ready to elevate your business with ta
<script src="assets/js/agency.min.js"></script>

<script>
document.addEventListener("DOMContentLoaded", function() {
var t = performance.timing;
var loadTime = (t.loadEventEnd - t.responseEnd) / 1000;
document.getElementById('render-time').innerText = loadTime.toFixed(2) + ' seconds';
document.addEventListener("DOMContentLoaded", function () {
// Get performance timings
var startTime = performance.timing.responseStart; // Time the browser starts receiving the page
var endTime = performance.timing.loadEventEnd; // Time when the page is fully loaded

// Calculate render time in seconds
var renderTimeInSeconds = (endTime - startTime) / 1000;

// Convert to minutes and seconds
var minutes = Math.floor(renderTimeInSeconds / 60);
var seconds = Math.round(renderTimeInSeconds % 60);

// Update the DOM with the render time
var renderTimeText = minutes > 0
? `${minutes} minutes ${seconds} seconds`
: `${seconds} seconds`;
document.getElementById("render-time").innerText = renderTimeText;
});
</script>
</body>
Expand Down

0 comments on commit 4fbb03a

Please sign in to comment.