-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
61 lines (57 loc) · 1.94 KB
/
script.js
File metadata and controls
61 lines (57 loc) · 1.94 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
// Sticky Navigation
window.addEventListener('scroll', function() {
const navbar = document.getElementById('navbar');
if (window.scrollY > 100) {
navbar.style.boxShadow = '0 4px 6px rgba(0, 0, 0, 0.1)';
} else {
navbar.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.1)';
}
});
// Smooth scrolling for navigation links
document.querySelectorAll('nav a').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const targetId = this.getAttribute('href');
const targetSection = document.querySelector(targetId);
window.scrollTo({
top: targetSection.offsetTop - 70,
behavior: 'smooth'
});
});
});
// Initialize charts when the page loads
// document.addEventListener('DOMContentLoaded', function() {
// // Button Task Chart
// const buttonCtx = document.getElementById('buttonChart').getContext('2d');
// new Chart(buttonCtx, {
// type: 'bar',
// data: {
// labels: ['Task 1', 'Task 2', 'Task 3', 'Task 4'],
// datasets: [{
// label: 'Task Completion',
// data: [12, 19, 3, 5],
// backgroundColor: [
// 'rgba(75, 192, 192, 0.2)',
// 'rgba(54, 162, 235, 0.2)',
// 'rgba(255, 206, 86, 0.2)',
// 'rgba(255, 99, 132, 0.2)'
// ],
// borderColor: [
// 'rgba(75, 192, 192, 1)',
// 'rgba(54, 162, 235, 1)',
// 'rgba(255, 206, 86, 1)',
// 'rgba(255, 99, 132, 1)'
// ],
// borderWidth: 1
// }]
// },
// options: {
// responsive: true,
// scales: {
// y: {
// beginAtZero: true
// }
// }
// }
// });
// });