File size: 880 Bytes
52fa71f
 
 
 
 
 
914d413
 
 
 
 
 
 
52fa71f
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
document.addEventListener('DOMContentLoaded', () => {
    // Initialize tooltips
    const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
    tooltipTriggerList.map(function (tooltipTriggerEl) {
        return new bootstrap.Tooltip(tooltipTriggerEl);
    });
    // External link handler
    document.querySelectorAll('a[target="_blank"]').forEach(link => {
        link.addEventListener('click', (e) => {
            e.preventDefault();
            window.open(link.href, '_blank', 'noopener,noreferrer');
        });
    });
});

function trackSimulationCompletion(simulationId) {
    const completed = JSON.parse(localStorage.getItem('completedSimulations'));
    if (!completed.includes(simulationId)) {
        completed.push(simulationId);
        localStorage.setItem('completedSimulations', JSON.stringify(completed));
    }
}