Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const modules = document.querySelectorAll('.module');
+ const storyList = document.getElementById('story-list');
+
+ const stories = {
+ ai: [
+ { title: 'AI Breakthrough in Healthcare', link: '#' },
+ { title: 'New AI Language Model Released', link: '#' }
+ ],
+ tech: [
+ { title: 'Quantum Computing Advances', link: '#' },
+ { title: 'New Smartphone Tech Unveiled', link: '#' }
+ ],
+ startups: [
+ { title: 'Startup Raises $10M in Funding', link: '#' },
+ { title: 'New App Revolutionizes Social Media', link: '#' }
+ ],
+ ethics: [
+ { title: 'Ethical AI Guidelines Published', link: '#' },
+ { title: 'Tech Giants Face Privacy Scrutiny', link: '#' }
+ ]
+ };
+
+ modules.forEach(module => {
+ module.addEventListener('click', function() {
+ const topic = this.getAttribute('data-topic');
+ displayStories(topic);
+ });
+ });
+
+ function displayStories(topic) {
+ storyList.innerHTML = '';
+ stories[topic].forEach(story => {
+ const li = document.createElement('li');
+ const a = document.createElement('a');
+ a.href = story.link;
+ a.textContent = story.title;
+ li.appendChild(a);
+ storyList.appendChild(li);
+ });
+ }
+ });