cailean
5 months ago
3 changed files with 39 additions and 0 deletions
@ -0,0 +1,27 @@ |
|||
// script.js
|
|||
document.addEventListener('DOMContentLoaded', () => { |
|||
const increaseButton = document.getElementById('access-tab'); |
|||
const elements = document.querySelectorAll('.text-content p, #index-info p, #hyperlink-container, #page-header, .list-title, .list-artists, .list-details, #article-title, #article-text, .page-info-title, .page-info-entry, #article-information, #article-book'); |
|||
//const decreaseButton = document.getElementById('decreaseText');
|
|||
|
|||
increaseButton.addEventListener('click', () => { |
|||
console.log("hello") |
|||
adjustTextSize(1.1); // Increase text size by 10%
|
|||
}); |
|||
|
|||
// decreaseButton.addEventListener('click', () => {
|
|||
// adjustTextSize(0.9); // Decrease text size by 10%
|
|||
// });
|
|||
|
|||
function adjustTextSize(factor) { |
|||
elements.forEach(element => { |
|||
// Get the current font size of the element
|
|||
const currentSize = parseFloat(window.getComputedStyle(element, null).getPropertyValue('font-size')); |
|||
// Calculate the new size based on the factor
|
|||
const newSize = currentSize * factor; |
|||
// Apply the new size to the element
|
|||
element.style.fontSize = `${newSize}px`; |
|||
element.style.lineHeight = `${newSize}px`; |
|||
}); |
|||
} |
|||
}); |
Loading…
Reference in new issue