// popup.js
document.getElementById('clearTrace').addEventListener('click', function() {
    window.localStorage.setItem('thetrace', ''); // Clear the 'thetrace' variable
    document.getElementById('cleared').textContent = 'Cleared: trace';
});

document.getElementById('clearPoints').addEventListener('click', function() {
    window.localStorage.setItem('points', ''); // Clear the 'points' variable
    document.getElementById('cleared').textContent = 'Cleared: points';
});

// Handle the checkbox for enabling/disabling the font
document.getElementById('toggleFont').addEventListener('change', function() {
    const isChecked = this.checked;
    // Set the font state in the extension's storage
    chrome.storage.local.set({ fontDisabled: !isChecked });
});

// Check the current font state when the popup is opened
chrome.storage.local.get(['fontDisabled'], function(result) {
    document.getElementById('toggleFont').checked = !result.fontDisabled; // Set checkbox based on stored value
});