-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinteractive.html
More file actions
312 lines (279 loc) · 12.5 KB
/
Copy pathinteractive.html
File metadata and controls
312 lines (279 loc) · 12.5 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>PointCounterpoint Interactive</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, sans-serif;
margin: 0;
padding: 0;
background-color: #333;
color: #fff;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
h1 {
color: #fd67a3;
text-align: center;
font-size: 28px;
margin-bottom: 30px;
}
.categories {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
margin-bottom: 30px;
}
.category-button {
background-color: #444;
color: #fff;
border: none;
padding: 8px 15px;
border-radius: 4px;
cursor: pointer;
}
.category-button.active {
background-color: #fd67a3;
}
.article {
background-color: #222;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
}
.article-title {
font-size: 22px;
font-weight: bold;
margin-bottom: 10px;
}
.article-source {
font-style: italic;
color: #aaa;
margin-bottom: 15px;
}
.article-content {
margin-bottom: 20px;
line-height: 1.6;
}
.perspective {
background-color: #333;
border-left: 4px solid #fd67a3;
padding: 15px;
margin-bottom: 15px;
}
.perspective-title {
font-weight: bold;
margin-bottom: 10px;
color: #fd67a3;
}
.perspective-content {
line-height: 1.6;
}
.writing-style {
margin-bottom: 30px;
text-align: center;
}
.writing-style select {
background-color: #444;
color: #fff;
border: none;
padding: 8px 15px;
border-radius: 4px;
}
</style>
</head>
<body>
<div class="container">
<h1>PointCounterpoint</h1>
<div class="writing-style">
<label for="style-select">News read to you by: </label>
<select id="style-select">
<option value="standard">Standard GPT</option>
<option value="hunter">Hunter S. Thompson</option>
<option value="parker">Dorothy Parker</option>
<option value="sagan">Carl Sagan</option>
<option value="baldwin">James Baldwin</option>
<option value="pratchett">Terry Pratchett</option>
<option value="eli5">ELI5</option>
</select>
</div>
<div class="categories">
<button class="category-button active" data-category="general">General</button>
<button class="category-button" data-category="business">Business</button>
<button class="category-button" data-category="technology">Technology</button>
<button class="category-button" data-category="entertainment">Entertainment</button>
<button class="category-button" data-category="sports">Sports</button>
</div>
<div id="articles-container">
<!-- Articles will be inserted here by JavaScript -->
</div>
</div>
<script>
// Sample data
const articles = {
general: [
{
id: "general-1",
title: "New Climate Change Policy Announced",
source: "Climate News",
content: "The government announced a new climate change policy today that aims to reduce carbon emissions by 50% by 2030.",
perspectives: {
standard: [
{
title: "Point",
content: "The new climate policy represents a crucial step forward in addressing the urgent climate crisis. By setting ambitious targets, the government is showing leadership on an issue that requires immediate action."
},
{
title: "Counterpoint",
content: "While climate change is a concern, this policy may place undue burden on businesses and could lead to job losses in key industries. The rapid timeline for implementation doesn't allow sufficient transition periods for affected sectors."
}
],
hunter: [
{
title: "Point",
content: "By God, this is the kind of madness that makes perfect sense in our savage journey through the American Dream! Anyone with half a brain cell can see the raw truth here. The facts are clear as crystal meth to those brave enough to face them."
},
{
title: "Counterpoint",
content: "Those spineless bastards in their three-piece suits will tell you otherwise, of course. They'll feed you the same sanitized garbage they always do, wrapped in fancy words and false promises. It's the same old song and dance from the same old swine."
}
],
eli5: [
{
title: "Point",
content: "Imagine you have a toy that everyone wants to play with. Some people think it's good to share the toy with everyone, taking turns. They say this way, everyone gets to have fun, and nobody feels left out."
},
{
title: "Counterpoint",
content: "But some people think differently. They say if too many kids play with the toy, it might break faster. Or maybe some kids won't be careful with it. It's like when you have a special drawing—sometimes you don't want everyone touching it."
}
]
}
},
{
id: "general-2",
title: "Global Economic Summit Concludes with New Agreements",
source: "Business Daily",
content: "World leaders reached several key agreements at the conclusion of the Global Economic Summit yesterday.",
perspectives: {
standard: [
{
title: "Point",
content: "The summit represents a diplomatic triumph that will strengthen international cooperation and economic stability."
},
{
title: "Counterpoint",
content: "While the summit produced agreements, it failed to address several critical issues facing the global economy."
}
]
}
}
],
technology: [
{
id: "tech-1",
title: "Tech Company Launches Revolutionary Product",
source: "Tech Today",
content: "A leading tech company has unveiled a groundbreaking new product that promises to transform the industry.",
perspectives: {
standard: [
{
title: "Point",
content: "This product represents a significant leap forward in technology that could benefit millions of users worldwide."
},
{
title: "Counterpoint",
content: "Despite the excitement, there are legitimate concerns about this new technology."
}
]
}
}
],
business: [
{
id: "business-1",
title: "Major Merger Announced Between Industry Leaders",
source: "Financial Times",
content: "Two industry giants have announced plans to merge in a deal valued at billions of dollars.",
perspectives: {
standard: [
{
title: "Point",
content: "This merger creates a stronger company that can better compete in the global marketplace."
},
{
title: "Counterpoint",
content: "The consolidation raises concerns about reduced competition and potential impacts on consumers."
}
]
}
}
]
};
// DOM elements
const articlesContainer = document.getElementById('articles-container');
const categoryButtons = document.querySelectorAll('.category-button');
const styleSelect = document.getElementById('style-select');
// Current state
let currentCategory = 'general';
let currentStyle = 'standard';
// Initialize
displayArticles();
// Add event listeners
categoryButtons.forEach(button => {
button.addEventListener('click', () => {
// Update active button
categoryButtons.forEach(btn => btn.classList.remove('active'));
button.classList.add('active');
// Update current category
currentCategory = button.dataset.category;
// Display articles
displayArticles();
});
});
styleSelect.addEventListener('change', () => {
currentStyle = styleSelect.value;
displayArticles();
});
// Function to display articles
function displayArticles() {
// Clear articles container
articlesContainer.innerHTML = '';
// Get articles for current category
const categoryArticles = articles[currentCategory] || [];
// Display articles
categoryArticles.forEach(article => {
// Get perspectives for current style, fallback to standard if not available
const perspectives = article.perspectives[currentStyle] || article.perspectives.standard;
// Create article element
const articleElement = document.createElement('div');
articleElement.className = 'article';
// Add article content
articleElement.innerHTML = `
<div class="article-title">${article.title}</div>
<div class="article-source">Source: ${article.source}</div>
<div class="article-content">${article.content}</div>
`;
// Add perspectives
perspectives.forEach(perspective => {
const perspectiveElement = document.createElement('div');
perspectiveElement.className = 'perspective';
perspectiveElement.innerHTML = `
<div class="perspective-title">${perspective.title}</div>
<div class="perspective-content">${perspective.content}</div>
`;
articleElement.appendChild(perspectiveElement);
});
// Add article to container
articlesContainer.appendChild(articleElement);
});
}
</script>
</body>
</html>