Download script.js from rid2244/project1: direct link, hf CLI and curl.
- Browser
- Download file 1.95 kB
-
https://huggingface.co/spaces/rid2244/project1/resolve/main/script.js
- Command line
-
hf download hf://spaces/rid2244/project1/script.js
-
curl -L -o script.js https://huggingface.co/spaces/rid2244/project1/resolve/main/script.js
1.95 kB
| // Universal JS file targeting interactions on multiple pages | |
| document.addEventListener("DOMContentLoaded", () => { | |
| // --- 1. Interaction for Home Page (index.html) --- | |
| const welcomeBtn = document.getElementById("welcomeBtn"); | |
| const welcomeOutput = document.getElementById("welcomeOutput"); | |
| if (welcomeBtn && welcomeOutput) { | |
| welcomeBtn.addEventListener("click", () => { | |
| welcomeOutput.innerHTML = "<h3>🤝 System Online</h3><p>Hello! This verification proves that custom dynamic scripts are running properly directly from Hugging Face Cloud Infrastructure.</p>"; | |
| welcomeOutput.style.borderLeft = "4px solid #10b981"; | |
| }); | |
| } | |
| // --- 2. Interaction for Skills Page (skills.html) --- | |
| const skillsBtn = document.getElementById("skillsBtn"); | |
| const countText = document.getElementById("countText"); | |
| let count = 0; | |
| if (skillsBtn && countText) { | |
| skillsBtn.addEventListener("click", () => { | |
| count++; | |
| countText.textContent = count; | |
| countText.style.color = "#2563eb"; | |
| countText.style.fontWeight = "bold"; | |
| }); | |
| } | |
| // --- 3. Interaction for Contact Page (contact.html) --- | |
| const submitBtn = document.getElementById("submitBtn"); | |
| const formFeedback = document.getElementById("formFeedback"); | |
| const inputName = document.getElementById("name"); | |
| if (submitBtn && formFeedback) { | |
| submitBtn.addEventListener("click", () => { | |
| if (inputName && inputName.value.trim() !== "") { | |
| formFeedback.innerHTML = `<p style="color: green; font-weight: bold;">✔️ Thank you, ${inputName.value}! Your submission data was processed successfully by local client execution script.</p>`; | |
| } else { | |
| formFeedback.innerHTML = `<p style="color: red;">❌ Please fill out the required form parameters first.</p>`; | |
| } | |
| }); | |
| } | |
| }); | |