From 4959d94bfc4cbd2ef6fadb8a00f08b6d94b3d5ef Mon Sep 17 00:00:00 2001 From: Kinara2020 Date: Wed, 17 Jun 2026 22:32:12 +0530 Subject: [PATCH] fix: add descriptive alt text to project card images for accessibility --- web-app/js/main.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web-app/js/main.js b/web-app/js/main.js index cb98c63..2a8305b 100644 --- a/web-app/js/main.js +++ b/web-app/js/main.js @@ -1,5 +1,5 @@ /* ═══════════════════════════════════════════════════════════════ - main.js — App wiring for Premium Python Projects Gallery + main.js — App wiring for Premium Python Projects Gallery ═══════════════════════════════════════════════════════════════ */ import { updateProjectVisibility } from "./modules/utils.js"; @@ -911,10 +911,18 @@ document.addEventListener("DOMContentLoaded", function () { var iconBox = document.createElement("div"); iconBox.className = "dropdown-item-icon"; var banner = project.card.querySelector(".card-banner"); + projectCards.forEach(function(card) { + var banner = card.querySelector(".card-banner"); + var title = card.querySelector("h3"); + + if (banner && title) { + banner.alt = title.textContent.trim() + " project preview"; + } + }); if (banner) { var img = document.createElement("img"); img.src = banner.src; - img.alt = ""; + img.alt = project.title + " project preview"; iconBox.appendChild(img); }