forked from PriyanshusinghPanda/OpenSource-activity-01
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
40 lines (26 loc) · 1.46 KB
/
script.js
File metadata and controls
40 lines (26 loc) · 1.46 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
// This file is for all the JavaScript-based issues.
document.addEventListener('DOMContentLoaded', () => {
// 🟡 ISSUE (All Pages): Create a mobile navigation menu (hamburger)
// You'll need to add a hamburger button to the HTML.
// This script should toggle a class on the nav element to show/hide it.
// 🟡 ISSUE (All Pages): Make the copyright year in the footer update automatically
// A footer with an element for the year needs to be added to the HTML files first.
// e.g., <footer id="footer">© <span id="current-year"></span> Jane Doe</footer>
// 🟡 ISSUE (contact.html): Form submission handling
// Find the form, prevent its default submission, and show a success message.
const contactForm = document.getElementById('contact-form');
if (contactForm) {
contactForm.addEventListener('submit', function(event) {
// Add your logic here
});
}
// 🟡 ISSUE (contact.html): Real-time email validation
// Find the email input field and check its value on the 'input' event.
// Show/hide an error message based on whether the format is valid.
// 🟡 ISSUE (All pages): Dark Mode Toggle
// Add a button to the HTML.
// This script should toggle a 'dark-mode' class on the body.
// Bonus: Use localStorage to remember the user's choice.
// 🟡 ISSUE (All pages): "Back to Top" Button
// This button should appear on scroll and smoothly scroll the user to the top.
});