Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const connectButton = document.getElementById('connectButton');
+ const resultsSection = document.getElementById('results');
+
+ // Mock data for demonstration
+ const mockData = {
+ tweets: 1245,
+ likes: 5678,
+ retweets: 1234,
+ topHashtag: '#TwitterWrapped'
+ };
+
+ connectButton.addEventListener('click', () => {
+ // Simulate API call
+ setTimeout(() => {
+ // Update stats
+ document.getElementById('tweetCount').textContent = mockData.tweets;
+ document.getElementById('likeCount').textContent = mockData.likes;
+ document.getElementById('retweetCount').textContent = mockData.retweets;
+ document.getElementById('topHashtag').textContent = mockData.topHashtag;
+
+ // Show results
+ resultsSection.classList.remove('hidden');
+
+ // Initialize chart
+ const ctx = document.getElementById('activityChart').getContext('2d');
+ new Chart(ctx, {
+ type: 'line',
+ data: {
+ labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ datasets: [{
+ label: 'Tweets',
+ data: [120, 150, 130, 140, 160, 170, 180, 190, 200, 210, 220, 230],
+ borderColor: '#1da1f2',
+ fill: false
+ }]
+ },
+ options: {
+ responsive: true,
+ maintainAspectRatio: false,
+ scales: {
+ y: {
+ beginAtZero: true
+ }
+ }
+ }
+ });
+ }, 1000);
+ });
+ });