Skip to content

Commit

Permalink
Merge pull request #338 from open-pv/330-add-alt-text-to-static-images
Browse files Browse the repository at this point in the history
Add alt text to images #330
  • Loading branch information
FlorianK13 authored Oct 13, 2024
2 parents 694f791 + 74baf95 commit 710ba3a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pages/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ const About = () => {
"images/WelcomeMessage2.png",
"images/WelcomeMessage3.png",
]}
alttext={[
"Screenshot of the map that is visible on the start screen of openpv.de.",
"Screenhot of a simulated building.",
"Screenshot of a PV system that is drawn on a simulated building together with an estimated annual PV yield.",
]}
/>
<TextBox heading={t("about.data.h")}>
{t("about.data.p1")}{" "}
Expand Down Expand Up @@ -95,6 +100,10 @@ const About = () => {
/>
<ImageRow
images={["images/about/ptf.png", "images/about/bmbf.jpg"]}
alttext={[
"Logo of the Prototypefund.",
"Logo of the German Federal Ministry of Education and Research.",
]}
links={["https://prototypefund.de/", "https://www.bmbf.de"]}
objectFit="contain"
/>
Expand All @@ -121,7 +130,7 @@ function TextBox({ content, heading, children }) {
)
}

const ImageRow = ({ images, links = [], objectFit = "cover" }) => {
const ImageRow = ({ images, alttext, links = [], objectFit = "cover" }) => {
return (
<SimpleGrid columns={images.length} spacing={4}>
{images.map((src, index) => {
Expand All @@ -132,6 +141,7 @@ const ImageRow = ({ images, links = [], objectFit = "cover" }) => {
width="100%"
height="150px"
borderRadius="md"
alt={alttext[index]}
/>
)

Expand Down

0 comments on commit 710ba3a

Please sign in to comment.