Skip to content

Commit

Permalink
correct title resize
Browse files Browse the repository at this point in the history
  • Loading branch information
wulfdewolf committed Apr 1, 2024
1 parent e23121c commit b837431
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions _includes/header.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,19 @@
</div>
</progress>
{% endif %}
<script>
window.addEventListener('resize', resizeFont);
<script>
window.addEventListener('resize', resizeFont);
function resizeFont() {
var parentWidth = document.querySelector('.container').offsetWidth;
var fontSize = parentWidth * 0.05; // Adjust the multiplier as needed
var textElements = document.querySelectorAll('.banner-text');
function resizeFont() {
var parentWidth = document.querySelector('.container').offsetWidth;
var fontSize = parentWidth * 0.05; // Adjust the multiplier as needed
var textElements = document.querySelectorAll('.banner-text');
textElements.forEach(function(element) {
element.style.fontSize = fontSize + 'px';
});
}
// Call resizeFont on page load
window.onload=function() {
resizeFont();
}
</script>
textElements.forEach(function(element) {
element.style.fontSize = fontSize + 'px';
});
}
document.addEventListener('DOMContentLoaded', function() {
resizeFont();
});
</script>
</header>

0 comments on commit b837431

Please sign in to comment.