-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport.html
200 lines (193 loc) · 6.56 KB
/
report.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitHub Activity Report</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
}
body {
font-family: 'Poppins', sans-serif;
background-color: var(--bg-color, #f4f4f9);
color: var(--text-color, #333);
align-items: center;
transition: background 0.3s, color 0.3s;
}
h1 {
text-align: center;
font-size: 2.5em;
margin: 20px;
}
.chart-container {
width: 50%;
max-width: 600px;
background-color: var(--card-bg, #fff);
padding: 25px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
border-radius: 8px;
margin-top: 20px;
transition: background 0.3s;
display: none;
}
.theme-toggle, .filter-dropdown {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
font-size: 1.5em;
}
.filter-dropdown {
right: 50px;
font-size: 1em;
}
.footer {
margin-top: auto;
padding: 20px 0;
font-size: 1.2em;
font-style: italic;
color: var(--footer-color, #777);
text-align: center;
width: 100%;
background-color: var(--card-bg, #fff);
box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
}
.footer i {
font-size: 1.2em;
}
.github-profile {
position: absolute;
top: 10px;
left: 10px;
font-size: 1.2em;
}
.date-filter {
margin-top: 20px;
display: flex;
flex-direction: row;
align-items: center;
}
.date-filter label {
margin-right: 10px;
font-weight: 600;
}
.date-filter input {
padding: 5px;
border: 1px solid #ccc;
border-radius: 5px;
margin-right: 10px;
}
.date-filter button {
padding: 5px 10px;
background-color: #007BFF;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
}
@media (max-width: 600px) {
h1 {
font-size: 2em;
}
.chart-container {
width: 90%;
}
}
</style>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<div class="github-profile">
<i class="fab fa-github"></i> <span>GitHub: 48Naveenkumar</span>
</div>
<i class="theme-toggle fas fa-moon" onclick="toggleTheme()"></i>
<select class="filter-dropdown" onchange="updateChart(this.value)">
<option value="All">All Events</option>
<option value="PushEvent">Push Events</option>
<option value="PullRequestEvent">Pull Requests</option>
</select>
<h1>GitHub Activity Report</h1>
<div class="date-filter">
<label for="start-date">From:</label>
<input type="date" id="start-date">
<label for="end-date">To:</label>
<input type="date" id="end-date">
<button onclick="filterByDate()">Okay</button>
</div>
<div class="chart-container" id="chartContainer">
<canvas id="commitChart"></canvas>
</div>
<div class="footer">
<i class="fas fa-copyright"></i> Generated with ♥ Made by Naveen (Updated as of Feb, 2025)
</div>
<script>
let originalData = {
labels: ["Jan 1", "Jan 5", "Feb 2", "Feb 5", "Mar 10", "Apr 15"],
values: [5, 10, 15, 20, 25, 30]
};
let ctx = document.getElementById('commitChart').getContext('2d');
let chart;
function renderChart() {
if (chart) chart.destroy();
chart = new Chart(ctx, {
type: 'bar',
data: {
labels: originalData.labels,
datasets: [{
label: 'Number of Commits',
data: originalData.values,
backgroundColor: 'rgba(75, 192, 192, 0.5)',
borderColor: 'rgba(75, 192, 192, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Number of Commits'
}
}
}
}
});
}
function filterByDate() {
let startDate = new Date(document.getElementById('start-date').value);
let endDate = new Date(document.getElementById('end-date').value);
let filteredLabels = [];
let filteredValues = [];
for (let i = 0; i < originalData.labels.length; i++) {
let dateParts = originalData.labels[i].split(' ');
let month = new Date(`${dateParts[0]} 1, 2025`).getMonth();
let day = parseInt(dateParts[1]);
let fullDate = new Date(2025, month, day);
if (fullDate >= startDate && fullDate <= endDate) {
filteredLabels.push(originalData.labels[i]);
filteredValues.push(originalData.values[i]);
}
}
if (filteredLabels.length === 0) {
document.getElementById('chartContainer').style.display = 'none';
return;
}
originalData.labels = filteredLabels;
originalData.values = filteredValues;
document.getElementById('chartContainer').style.display = 'block';
renderChart();
}
</script>
</body>
</html>