-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpapers.html
123 lines (102 loc) · 3.1 KB
/
papers.html
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Paper Dashboard</title>
<link rel="stylesheet" href="styles.css">
<style>
/* Add your CSS styles here */
*{
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
}
.navbar {
background-color: #333;
color: #fff;
height: 15vh;
}
h1 {
text-align: center;
padding: 40px ;
}
#papers-list {
margin: 20px;
}
.paper {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
cursor: pointer;
}
.paper:hover {
background-color: #f0f0f0;
}
.filter{
left: 20px;
position: relative;
}
</style>
</head>
<body>
<nav class="navbar">
<div class="container">
<h1>Welcome to the Paper Dashboard</h1>
</nav>
<br>
<div class="filter" id="filter-options">
<label for="topic-filter">Filter by Topic:</label>
<select id="topic-filter">
<option value="all">All Topics</option>
<option value="topic1">Topic 1</option>
<option value="topic2">Topic 2</option>
<!-- Add more topic options as needed -->
</select>
</div>
<div id="papers-list">
<!-- Papers will be dynamically added here using JavaScript -->
</div>
<script src="script.js"></script>
<script>
// Sample data with topics (you would replace this with actual paper data)
const papers = [
{ title: 'Paper 1', url: 'paper1.pdf', topic: 'topic1' },
{ title: 'Paper 2', url: 'paper2.pdf', topic: 'topic2' },
{ title: 'Paper 3', url: 'paper3.pdf', topic: 'topic1' },
{ title: 'Paper 4', url: 'Final Paper.pdf', topic: 'topic2' },
{ title: 'Paper 5', url: 'Thoiba paper.pdf', topic: 'topic1' },
{ title: 'Paper 6', url: 'E_Scholar Research Paper.pdf', topic: 'topic2' },
// Add more papers with topics as needed
];
// Function to add papers to the list
function addPapersToDashboard() {
const papersList = document.getElementById('papers-list');
const topicFilter = document.getElementById('topic-filter');
// Clear existing papers
papersList.innerHTML = '';
// Get the selected topic from the filter
const selectedTopic = topicFilter.value;
papers.forEach((paper, index) => {
if (selectedTopic === 'all' || paper.topic === selectedTopic) {
const paperDiv = document.createElement('div');
paperDiv.classList.add('paper');
paperDiv.textContent = `${index + 1}. ${paper.title}`;
// Open the paper in a new tab when clicked (you can enhance this for your needs)
paperDiv.addEventListener('click', () => {
window.open(paper.url, '_blank');
});
papersList.appendChild(paperDiv);
}
});
}
// Call the function to add papers to the dashboard
addPapersToDashboard();
// Listen for changes in the topic filter
const topicFilter = document.getElementById('topic-filter');
topicFilter.addEventListener('change', addPapersToDashboard);
</script>
</body>
</html>