Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Website: Add Aria Labels and Better Alt Text #754

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions new-dti-website/components/apply/ApplicationTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import { extractEndDate, extractEndTime, parseDate } from '../../src/utils/dateU
type TabProps = {
isSelected: boolean;
text: string;
tabIndex?: number;
onClick?: () => void;
};

const Tab: React.FC<TabProps> = ({ isSelected, text, onClick, tabIndex }) => (
const Tab: React.FC<TabProps> = ({ isSelected, text, onClick }) => (
<button
className={`flex items-center lg:px-5 lg:py-4 md:px-4 md:py-3 xs:px-2 md:rounded-t-xl xs:rounded-t-lg ${
isSelected ? 'bg-[#FEFEFE] text-[#A52424]' : 'text-[#FEFEFE]'
Expand All @@ -25,6 +24,7 @@ const Tab: React.FC<TabProps> = ({ isSelected, text, onClick, tabIndex }) => (
role="tab"
tabIndex={isSelected ? 0 : -1}
aria-selected={isSelected}
aria-label="select tab"
>
<p className="font-bold lg:text-lg md:text-[13px] xs:text-[10px]" role="tabpanel">
{text}
Expand Down
1 change: 1 addition & 0 deletions new-dti-website/components/apply/ApplyFAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const ApplyFAQ = () => {
section === question ? 'text-[#FEFEFE] bg-[#0C0404]' : ''
}`}
onClick={() => setQuestion(section)}
aria-label={`select ${section} section`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay for aria labels!

Just a small nit i found when testing – do you think we could make the <button> wrap the label as well ("Design", "Business", etc.)? That way you can click on the entire container (label + icon).

It's just a smol polish thing that could increase the tap target and make it easier to select the tabs

Screenshot 2024-11-30 at 12 41 14 AM

>
{section}
</button>
Expand Down
28 changes: 14 additions & 14 deletions new-dti-website/components/apply/RoleDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ const RoleDescriptions = () => {
{Object.keys(applications).map((application) => {
const { icon } = applications[application];
return (
<div className="flex flex-col items-center gap-7" key={application}>
<button
onClick={() => setRole(application)}
aria-label={`Show ${application} questions`}
className="flex flex-col items-center gap-7"
key={application}
>
Comment on lines +32 to +37
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, ty for this!

<h3
className={`lg:text-[24px] lg:leading-[29px] md:text-[18px] md:leading-[22px]
xs:text-[16px] xs:leading-[19px] ${
Expand All @@ -38,20 +43,15 @@ const RoleDescriptions = () => {
>
{application.charAt(0).toUpperCase() + application.substring(1)}
</h3>
<button
onClick={() => setRole(application)}
aria-label={`Show ${application} questions`}
>
<Image
src={icon.src}
alt=""
width={icon.width}
height={icon.height}
className={`${role === application ? '' : 'brightness-50'}
<Image
src={icon.src}
alt=""
width={icon.width}
height={icon.height}
className={`${role === application ? '' : 'brightness-50'}
lg:h-[90px] md:h-[73px] xs:h-[44px] w-auto`}
/>
</button>
</div>
/>
</button>
);
})}
</div>
Expand Down
22 changes: 11 additions & 11 deletions new-dti-website/components/bottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ const Bottom: React.FC = () => (
src="/images/teaching_1.svg"
width={292}
height={441}
alt="teaching 1"
alt="teacher presenting slide on ReactJS"
/>
<div className="flex flex-col h-full w-7/12 gap-y-16">
<Image
className="w-11/12 self-end"
src="/images/teaching_2.svg"
width={276}
height={179}
alt="teachine 2"
alt="teacher lecturing in front of architecture diagram"
/>
<Image
className="w-3/4 self-end"
src="/images/teaching_3.svg"
width={276}
height={179}
alt="teachine 3"
alt="students in front of sticky note board"
/>
</div>
</div>
Expand All @@ -46,7 +46,7 @@ const Bottom: React.FC = () => (
src="/icons/new_trends.svg"
width={58}
height={58}
alt="Trends icon"
alt="Laptop icon"
/>
<div className="flex flex-col justify-start w-full items-start">
<h6 className="text-left w-full font-bold md:text-sm lg:text-[22px]">
Expand All @@ -63,7 +63,7 @@ const Bottom: React.FC = () => (
src="/icons/propel_icon.svg"
width={58}
height={63}
alt="Propel icon"
alt="rocket ship icon"
/>
<div className="flex flex-col justify-start w-full items-start md:text-xs">
<h6 className="text-left w-full font-bold md:text-sm lg:text-[22px]">Propel</h6>
Expand All @@ -72,7 +72,7 @@ const Bottom: React.FC = () => (
</p>
</div>
</div>
<Link href="/course" className="primary-button">
<Link href="/course" className="primary-button" aria-label="Courses page">
Learn more
</Link>
</div>
Expand All @@ -85,22 +85,22 @@ const Bottom: React.FC = () => (
src="/images/outreach_1.svg"
width={275}
height={143}
alt="outreach 1"
alt="kids stacking boxes at make-a-thon"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while we're at it adding alt text, do u think u could add alt text for the images on the Initiatives page? i think the images a missing a few or aren't too precise:

Screenshot 2024-11-30 at 12 46 53 AM
Screenshot 2024-11-30 at 12 47 06 AM

Screenshot 2024-11-30 at 12 47 23 AM

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of my suggestions (feel free to edit as u see fit):

Image Alt text
image "a DTI member teaching members of the Ithaca community about technology"
image "a DTI member presenting a series of graphs at the Half-Baked event"
image "a DTI member presenting code at the BigRed//Hacks hackathon event"
image "DTI members posing in front of the Millennium logo"

/>
<div className="flex flex-row gap-x-10 w-full h-3/4">
<Image
className="w-1/2 self-end"
src="/images/outreach_3.svg"
width={154}
height={104}
alt="outreach 3"
alt="kids being mentored by DTI member"
/>
<Image
className="w-1/3 self-start"
src="/images/outreach_2.svg"
width={115}
height={103}
alt="outreach 2"
alt="students learning Figma from DTI members"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yess ty for this

/>
</div>
</div>
Expand Down Expand Up @@ -128,8 +128,8 @@ const Bottom: React.FC = () => (
src="/images/team.svg"
width={377}
height={286}
alt="team"
></Image>
alt="team photo of DTI members"
/>
<div className="text-left w-full flex flex-col gap-y-3 md:self-center md:gap-y-5 max-w-[389px]">
<div className="flex flex-col gap-y-1 md:gap-y-2">
<p className="text-neutral-200 text-xs font-bold uppercase lg:text-lg">team</p>
Expand Down
1 change: 1 addition & 0 deletions new-dti-website/components/course/DDProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function DDProjects({ title, description, imageSrc }: DDProjectsP
isOpen ? 'bg-red-500' : 'bg-white'
} w-full max-w-8xl rounded-xl drop-shadow-sm px-10 py-8 border-1 border-[#E4E4E4]`}
onClick={toggleCard}
aria-label={`${isOpen ? 'Minimize' : 'Expand'} ${title} student project`}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yessss awesome

>
<div className="flex justify-between items-center">
<h3 className={`md:text-3xl text-xl font-bold ${isOpen ? 'text-white' : 'text-black'}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"image": {
"src": "/images/tcpl.jpg",
"alt": "tcpl",
"alt": "a DTI member teaching members of the Ithaca community about technology at the Tompkins County Public Library",
"width": 563,
Comment on lines +13 to 14
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤩 ty!

"height": 328
},
Expand All @@ -30,7 +30,7 @@
},
"image": {
"src": "/images/half-baked.jpg",
"alt": "half-baked",
"alt": "a DTI member presenting a series of graphs at the Half-Baked event",
"width": 373,
"height": 263
},
Expand All @@ -49,7 +49,7 @@
},
"image": {
"src": "/images/bigredhacks.jpg",
"alt": "bigredhacks",
"alt": "a DTI member presenting code at the Big Red Hacks hackathon event",
"width": 344,
"height": 263
},
Expand All @@ -68,7 +68,7 @@
},
"image": {
"src": "/images/millennium.jpg",
"alt": "millennium",
"alt": "DTI members posing in front of the Millennium logo",
"width": 345,
"height": 260
},
Expand Down
16 changes: 8 additions & 8 deletions new-dti-website/components/products/products.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,29 @@
],
"images": [
{
"src": "/images/products/dcc/dcc1.png",
"alt": "DCC Image 1"
"src": "/images/products/dac/dac1.png",
"alt": "DAC Image 1"
},
{
"src": "/images/products/dcc/dcc2.png",
"alt": "DCC Image 2",
"src": "/images/products/dac/dac2.png",
"alt": "DAC Image 2",
"top": "50%",
"left": "-7%",
"width": "47%",
"direction": "down"
},
{
"src": "/images/products/dcc/dcc3.png",
"alt": "DCC Image 3",
"src": "/images/products/dac/dac3.png",
"alt": "DAC Image 3",
"bottom": "11%",
"right": "-10%",
"width": "62%",
"direction": "down",
"delay": true
},
{
"src": "/images/products/dcc/dcc4.png",
"alt": "DCC Image 4",
"src": "/images/products/dac/dac4.png",
"alt": "DAC Image 4",
"top": "9%",
"right": "-18%",
"width": "45%",
Expand Down
2 changes: 1 addition & 1 deletion new-dti-website/components/sponsor/SponsorshipTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const SponsorshipTableLaptop = () => (
key={`${benefit.key}-${tier}`}
>
{tiers.indexOf(tier) >= tiers.indexOf(benefit.lowestTier) && (
<Image src="/icons/check.svg" alt="check" width={30} height={60} />
<Image src="/icons/check.svg" alt="checkmark" width={30} height={60} />
)}
</div>
))}
Expand Down
1 change: 1 addition & 0 deletions new-dti-website/components/team/MemberDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const MemberDisplay: React.FC = () => {
setSelectedRole(role.altText);
setSelectedMember(undefined);
}}
aria-label={`select ${role.altText} role`}
>
<Icon
icon={`${role.src}_base.svg`}
Expand Down
19 changes: 15 additions & 4 deletions new-dti-website/components/team/MemberGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export const MemberDetails: React.FC<MemberDetailsProps> = (props: MemberDetails
onMouseLeave={mouseHandler}
className="flex items-center justify-center gap-3 py-3 px-5 bg-white rounded-xl text-[#A52424] border-[3px] border-[#A52424]
hover:bg-[#A52424] hover:text-white stroke-white w-max"
aria-label={`schedule coffee chat with ${props.firstName} ${props.lastName}`}
>
<Image
src="/icons/red_calendar.svg"
Expand All @@ -211,11 +212,13 @@ export const MemberDetails: React.FC<MemberDetailsProps> = (props: MemberDetails
</button>
</div>
<div className="md:hidden xs:block">
<button
<Link
href={props.coffeeChatLink ?? `mailto:${props.email}`}
onMouseEnter={mouseHandler}
onMouseLeave={mouseHandler}
className="py-3 px-5 bg-white rounded-xl text-[#A52424] border-[3px] border-[#A52424]
hover:bg-[#A52424] hover:text-white stroke-white w-full flex justify-center"
aria-label={`schedule coffee chat with ${props.firstName} ${props.lastName}`}
>
<div className="flex gap-3 w-max">
<Image
Expand All @@ -227,7 +230,7 @@ export const MemberDetails: React.FC<MemberDetailsProps> = (props: MemberDetails
/>
<p className="font-bold text-base text-inherit whitespace-nowrap">Chat with me</p>
</div>
</button>
</Link>
</div>
</Card>
);
Expand Down Expand Up @@ -310,7 +313,11 @@ const MemberGroup: React.FC<MemberGroupProps> = ({
<div className="flex flex-row justify-center flex-wrap gap-x-14 gap-y-10">
{members.map((member, index) => (
<>
<button onClick={() => onMemberCardClick(member)} className="memberCard">
<button
onClick={() => onMemberCardClick(member)}
className="memberCard"
aria-label={`open ${member.firstName} ${member.lastName}'s details`}
>
<MemberCard
{...member}
key={member.netid}
Expand Down Expand Up @@ -343,7 +350,11 @@ const MemberGroup: React.FC<MemberGroupProps> = ({
>
{members.map((member, index) => (
<>
<button onClick={() => onMemberCardClick(member)} className="memberCard">
<button
onClick={() => onMemberCardClick(member)}
className="memberCard"
aria-label={`open ${member.firstName} ${member.lastName}'s details`}
>
Comment on lines +355 to +357
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes yes yes ty for this!

<MemberCard
{...member}
key={member.netid}
Expand Down
9 changes: 5 additions & 4 deletions new-dti-website/components/team/TeamHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const ImageModal: React.FC<ImageModalProps> = ({
className="flex justify-center items-center h-full gap-[70px] md:scale-75 lg:scale-100"
onKeyDown={handleKeyDown}
>
<button onClick={handlePrev} ref={modalRef}>
<img src="/icons/arrow.svg" alt="left arrow" width={20} className="cursor-pointer" />
<button onClick={handlePrev} ref={modalRef} aria-label="navigate to previous photo">
<img src="/icons/arrow.svg" alt="" width={20} className="cursor-pointer" />
</button>
<Carousel
opts={{
Expand Down Expand Up @@ -172,7 +172,7 @@ const TeamHero = () => {
className="flex justify-center relative bottom-2 cursor-pointer"
style={{ pointerEvents: 'none' }}
>
<img src="/images/carousel-frame.png" alt="frame" className="absolute z-10" />
<img src="/images/carousel-frame.png" alt="" className="absolute z-10" />
<div className="absolute z-10 w-[243px] h-[270px]">
<p className={`absolute bottom-0 py-3 px-2 text-[#877B7B] ${ibm_plex_mono.className}`}>
{`${carouselImages.images[carouselIndex % carouselLength].alt}.jpg`}
Expand Down Expand Up @@ -204,13 +204,14 @@ const TeamHero = () => {
onClick={() =>
setModalShown(index === carouselIndex && width >= TABLET_BREAKPOINT)
}
aria-label="open modal"
>
<div className="flex justify-center overflow-hidden w-[227px] rounded-md">
<img src={image.src} alt={image.alt} className="h-[220px] max-w-none" />
</div>
<img
src={image.icon}
alt="icon"
alt=""
width={50}
height={50}
className="relative bottom-[62px] left-2"
Expand Down
3 changes: 2 additions & 1 deletion new-dti-website/src/app/course/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function Courses() {
src={'/icons/courses/trends_logo.png'}
width={450}
height={450}
alt="Trends Logo"
alt="Trends Logo composed of the firebase, react, typescript, nodejs, vscode, and DTI logos."
unoptimized
className="w-72 md:w-96 lg:w-[450px]"
/>
Expand Down Expand Up @@ -142,6 +142,7 @@ export default function Courses() {
key="Trends Website"
href={config.trendsWebsiteLink}
className="primary-button"
aria-label="Trends Website"
>
Learn More
</Link>
Expand Down
3 changes: 2 additions & 1 deletion new-dti-website/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ const Home: React.FC = () => {
onClick={scrollToContent}
className={`text-white md:text-lg xs:text-[16px] font-semibold cursor-pointer flex flex-col items-center z-10 ${ibm_plex_mono.className}`}
style={{ transition: 'all 0.3s ease' }}
aria-label="scroll down"
>
LEARN MORE
<img src="/images/arrow.png" alt="Learn more" className="mt-3 w-auto h-6" />
<img src="/images/arrow.png" alt="" className="mt-3 w-auto h-6" />
</button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion new-dti-website/src/app/sponsor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const SponsorPage = () => {
<div className="max-w-5xl flex justify-center p-5 py-24 lg:gap-20 md:gap-10 xs:gap-5 md:flex-row xs:flex-col">
<Image
src="/images/dti_2024.png"
alt="DTI 2024"
alt="2024 DTI Team"
width={width >= LAPTOP_BREAKPOINT ? 475 : 350}
height={width >= LAPTOP_BREAKPOINT ? 320 : 236}
className="rounded-3xl object-cover md:w-5/12"
Expand Down
Loading