|
1 | | -import type { DesignWork as DesignWorkProps } from '../../res/design' |
| 1 | +import { useId } from 'react' |
| 2 | +import type { DesignWork as DesignWorkProps } from '/res/designWork' |
| 3 | + |
| 4 | +export const DesignWork = ({ name, image, href }: DesignWorkProps) => { |
| 5 | + const id = useId() |
2 | 6 |
|
3 | | -export const DesignWork = ({ name, imageURL, href }: DesignWorkProps) => { |
4 | 7 | return ( |
5 | 8 | <a |
6 | 9 | href={href} |
7 | | - className="!no-underline group relative flex items-center px-gutter py-2 transition-[font-weight,color] hover:font-black hover:text-light" |
| 10 | + className="!no-underline group transition-[font-weight,color] hover:font-black hover:text-light" |
8 | 11 | target="_blank" |
| 12 | + aria-labelledby={id} |
9 | 13 | > |
10 | | - <img |
11 | | - src={imageURL} |
12 | | - alt="" |
13 | | - className="-translate-x-1.5 absolute inset-0 h-full w-full bg-dark object-cover opacity-0 transition-[opacity,translate] group-hover:translate-x-0 group-hover:opacity-100" |
14 | | - /> |
15 | | - <div className="absolute inset-0 bg-dark/60 opacity-0 transition-opacity group-hover:opacity-100" /> |
| 14 | + <article className="relative flex items-center px-gutter py-2"> |
| 15 | + <img |
| 16 | + src={`https://benji-portfolio.s3.ap-southeast-2.amazonaws.com/Portfolio/Design+Work/${image}`} |
| 17 | + alt="" |
| 18 | + className="-translate-x-1.5 absolute inset-0 h-full w-full bg-dark object-cover opacity-0 transition-[opacity,translate] group-hover:translate-x-0 group-hover:opacity-100" |
| 19 | + /> |
| 20 | + <div className="absolute inset-0 bg-dark/60 opacity-0 transition-opacity group-hover:opacity-100" /> |
16 | 21 |
|
17 | | - <h1 className="relative z-10 flex-1 underline">{name}</h1> |
| 22 | + <h1 className="relative z-10 flex-1 underline" id={id}> |
| 23 | + {name} |
| 24 | + </h1> |
18 | 25 |
|
19 | | - <svg |
20 | | - viewBox="0 0 85 85" |
21 | | - fill="none" |
22 | | - xmlns="http://www.w3.org/2000/svg" |
23 | | - width="56" |
24 | | - height="56" |
25 | | - className="relative z-10 h-14 w-14 stroke-4 transition-[stroke-width] group-hover:stroke-7" |
26 | | - > |
27 | | - <path d="M42.5 17.7083L67.2917 42.4999L42.5 67.2916M17.7083 42.4999H67.2917H17.7083Z" stroke="currentColor" /> |
28 | | - </svg> |
| 26 | + <svg |
| 27 | + viewBox="0 0 85 85" |
| 28 | + fill="none" |
| 29 | + xmlns="http://www.w3.org/2000/svg" |
| 30 | + width="56" |
| 31 | + height="56" |
| 32 | + className="relative z-10 h-14 w-14 stroke-4 transition-[stroke-width] group-hover:stroke-7" |
| 33 | + > |
| 34 | + <path d="M42.5 17.7083L67.2917 42.4999L42.5 67.2916M17.7083 42.4999H67.2917H17.7083Z" stroke="currentColor" /> |
| 35 | + </svg> |
| 36 | + </article> |
29 | 37 | </a> |
30 | 38 | ) |
31 | 39 | } |
0 commit comments