File size: 3,013 Bytes
4d5c005
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
document.addEventListener('DOMContentLoaded', function() {
    const lightMode = document.getElementById('lightMode');
    const darkMode = document.getElementById('darkMode');
    const body = document.body;

    // Set initial theme based on system preference
    if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
        body.classList.add('dark-mode');
        darkMode.style.display = 'none';
        lightMode.style.display = 'block';
    } else {
        body.classList.remove('dark-mode');
        darkMode.style.display = 'block';
        lightMode.style.display = 'none';
    }

    // Toggle theme functions
    lightMode.addEventListener('click', () => {
        body.classList.remove('dark-mode');
        darkMode.style.display = 'block';
        lightMode.style.display = 'none';
        localStorage.setItem('theme', 'light');
    });
    
    darkMode.addEventListener('click', () => {
        body.classList.add('dark-mode');
        darkMode.style.display = 'none';
        lightMode.style.display = 'block';
        localStorage.setItem('theme', 'dark');
    });

    // Check for saved theme preference
    const savedTheme = localStorage.getItem('theme');
    if (savedTheme) {
        if (savedTheme === 'dark') {
            body.classList.add('dark-mode');
            darkMode.style.display = 'none';
            lightMode.style.display = 'block';
        } else {
            body.classList.remove('dark-mode');
            darkMode.style.display = 'block';
            lightMode.style.display = 'none';
        }
    }
}); 
function createPaperCard(paper) {
    return `
        <div class="paper-card">
            <h2 class="paper-title">${paper.title}</h2>
            <div class="paper-authors">
                ${paper.authors.split(', ').map(author => 
                    `<span class="author-name">${author}</span>`
                ).join('')}
            </div>
            <div class="paper-abstract">
                ${paper.abstract}
            </div>
            <div class="paper-meta">
                <div class="meta-info">
                    <span class="meta-item">
                        <span class="meta-icon">📅</span>
                        ${paper.published}
                    </span>
                    <span class="meta-item">
                        <span class="meta-icon">🏷️</span>
                        ${paper.categories.join(', ')}
                    </span>
                </div>
                <div class="paper-actions">
                    <button onclick="analyzeWithAI('${paper.pdf_link}')" class="action-button analyze-btn">
                        <span>🔍</span> Analyze with AI
                    </button>
                    <button onclick="downloadPaper('${paper.pdf_link}', '${paper.title}')" class="action-button download-btn">
                        <span>📥</span> Download PDF
                    </button>
                </div>
            </div>
        </div>
    `;
}