-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from schm00g/3-accessibility-lighthouse
accessibility lighthouse fixes
- Loading branch information
Showing
2 changed files
with
45 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,52 @@ | ||
--- | ||
import sustainlife from '@assets/images/sustainlife.jpeg'; | ||
import axial3d from '@assets/images/axial3d.png'; | ||
import pmdsolutionsltd from '@assets/images/pmdsolutionsltd.jpg'; | ||
import { Image } from '@astrojs/image/components'; | ||
import Tags from '@components/ui/Tags.astro'; | ||
import sustainlife from "@assets/images/sustainlife.jpeg"; | ||
import axial3d from "@assets/images/axial3d.png"; | ||
import pmdsolutionsltd from "@assets/images/pmdsolutionsltd.jpg"; | ||
import { Image } from "@astrojs/image/components"; | ||
import Tags from "@components/ui/Tags.astro"; | ||
interface Props { | ||
url?: string; | ||
alt?: string; | ||
title?: string; | ||
tags: string[]; | ||
children?: HTMLElement | HTMLElement[]; | ||
url?: string; | ||
alt?: string; | ||
title?: string; | ||
tags: string[]; | ||
children?: HTMLElement | HTMLElement[]; | ||
} | ||
const { url = '#', alt = 'Project image', title = 'Project title', tags = ['Tags'] } = Astro.props; | ||
const { | ||
url = "#", | ||
alt = "Project image", | ||
title = "Project title", | ||
tags = ["Tags"], | ||
} = Astro.props; | ||
--- | ||
|
||
<section class="w-full p-4 md:w-1/2 lg:w-1/3"> | ||
<article | ||
data-testId="card" | ||
class="rounded-xl bg-white p-3 shadow-lg duration-300 hover:scale-105 hover:transform hover:shadow-xl" | ||
> | ||
<a href={url} aria-label="link to project"> | ||
<div class="relative flex items-end overflow-hidden rounded-xl"> | ||
<Image | ||
src={[axial3d, pmdsolutionsltd, sustainlife][title.toLowerCase().includes("axial") ? 0 : title.toLowerCase().includes("pmd") ? 1 : 2]} | ||
alt={alt} | ||
aspectRatio="4:4" | ||
format="png" | ||
width={400} | ||
height={400} | ||
loading="eager" | ||
/> | ||
</div> | ||
<div class="mt-1 p-2"> | ||
<h3 class="text-xl text-purple lg:text-2xl">{title}</h3> | ||
<Tags tags={tags} /> | ||
</div> | ||
</a> | ||
</article> | ||
<article | ||
data-testId="card" | ||
class="rounded-xl bg-white p-3 shadow-lg duration-300 hover:scale-105 hover:transform hover:shadow-xl" | ||
> | ||
<div class="relative flex items-end overflow-hidden rounded-xl"> | ||
<Image | ||
src={[axial3d, pmdsolutionsltd, sustainlife][ | ||
title.toLowerCase().includes("axial") | ||
? 0 | ||
: title.toLowerCase().includes("pmd") | ||
? 1 | ||
: 2 | ||
]} | ||
alt={alt} | ||
aspectRatio="4:4" | ||
format="png" | ||
width={400} | ||
height={400} | ||
loading="eager" | ||
/> | ||
</div> | ||
<div class="mt-1 p-2"> | ||
<a href={url} aria-label={title}> | ||
<h3 class="text-xl text-purple lg:text-2xl">{title}</h3> | ||
</a> | ||
<Tags tags={tags} /> | ||
</div> | ||
</article> | ||
</section> |