File size: 1,952 Bytes
e5bd0e4 | 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 | // 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>`;
}
});
}
});
|