-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
124 lines (119 loc) · 3.78 KB
/
index.html
File metadata and controls
124 lines (119 loc) · 3.78 KB
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
124
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RSS Summary</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
line-height: 1.6;
background-color: #f0f0f0;
transition: background-color 0.5s ease;
}
body:hover {
background-color: #e0e0e0;
}
.summary-section {
background-color: #fff;
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.summary-section:hover {
transform: translateY(-5px);
}
.items-section {
display: grid;
gap: 20px;
}
.item {
border: 1px solid #ddd;
padding: 15px;
border-radius: 8px;
transition: background-color 0.3s ease, transform 0.3s ease;
}
.item:hover {
background-color: #f9f9f9;
transform: scale(1.02);
}
.item h3 {
margin-top: 0;
color: #333;
transition: color 0.3s ease;
}
.item h3:hover {
color: #007bff;
}
.loading {
text-align: center;
padding: 20px;
font-size: 1.2em;
animation: pulse 1.5s infinite;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
.color-button {
display: block;
margin: 20px auto;
padding: 10px 20px;
font-size: 1em;
color: #fff;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.color-button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<h1>RSS Feed Summary</h1>
<button class="color-button" onclick="changeBackgroundColor()">Change Background Color</button>
<div id="loading" class="loading">Loading RSS feed...</div>
<div id="summary" class="summary-section" style="display: none;"></div>
<div id="items" class="items-section"></div>
<script>
function changeBackgroundColor() {
const body = document.body;
body.style.backgroundColor = body.style.backgroundColor === '#f0f0f0' ? '#e0e0e0' : '#f0f0f0';
}
async function fetchRSSData() {
try {
const response = await fetch('/api/test');
const data = await response.json();
const itemsSection = document.querySelector('.items-section');
itemsSection.innerHTML = ''; // Clear existing content
data.forEach(item => {
const itemElement = document.createElement('div');
itemElement.className = 'item';
itemElement.innerHTML = `
<h3><a href="${item.link}" target="_blank">${item.title}</a></h3>
<p>${item.description}</p>
<small>${new Date(item.pubDate).toLocaleString()}</small>
`;
itemsSection.appendChild(itemElement);
});
} catch (error) {
console.error('Error fetching RSS data:', error);
}
}
// Fetch data when page loads
fetchRSSData();
</script>
</body>
</html>