Datasets:
Download tasks/c28/repo/src/components/Works.jsx from Roy-DOU/Webdev-Bench: direct link, hf CLI and curl.
- Browser
- Download file 3.26 kB
-
https://huggingface.co/datasets/Roy-DOU/Webdev-Bench/resolve/main/tasks/c28/repo/src/components/Works.jsx
- Command line
-
hf download hf://datasets/Roy-DOU/Webdev-Bench/tasks/c28/repo/src/components/Works.jsx
-
curl -L -o Works.jsx https://huggingface.co/datasets/Roy-DOU/Webdev-Bench/resolve/main/tasks/c28/repo/src/components/Works.jsx
3.26 kB
| import { useRef } from 'react' | |
| import Reveal from './Reveal.jsx' | |
| import { TurnArrow } from './Icons.jsx' | |
| function ArrowLink({ label, className = '', style }) { | |
| const ref = useRef(null) | |
| const handleClick = (event) => { | |
| event.preventDefault() | |
| const el = ref.current | |
| if (!el) return | |
| el.classList.remove('pulsed') | |
| // restart the pulse animation on every click | |
| void el.offsetWidth | |
| el.classList.add('pulsed') | |
| } | |
| return ( | |
| <a | |
| ref={ref} | |
| className={`arrow-link ${className}`} | |
| style={style} | |
| href="#" | |
| aria-label={label} | |
| onClick={handleClick} | |
| > | |
| <TurnArrow /> | |
| </a> | |
| ) | |
| } | |
| function WorkTitle({ eyebrow, lines, eyebrowIndent = 0 }) { | |
| return ( | |
| <> | |
| <p className="eyebrow" style={{ '--indent': eyebrowIndent }}> | |
| {eyebrow} | |
| </p> | |
| <h2 className="work-title"> | |
| {lines.map(([text, indent]) => ( | |
| <span key={text} className="line" style={{ '--indent': indent }}> | |
| {text} | |
| </span> | |
| ))} | |
| </h2> | |
| </> | |
| ) | |
| } | |
| export default function Works() { | |
| return ( | |
| <section className="works" id="works"> | |
| <Reveal as="article" className="work work-zoniou"> | |
| <img | |
| className="work-media" | |
| src="/images/work-perfume.jpg" | |
| alt="Zoniou Perfumes — black fragrance diffuser bottle photographed on rippling dark liquid" | |
| width="766" | |
| height="957" | |
| loading="lazy" | |
| /> | |
| <div className="work-text"> | |
| <WorkTitle | |
| eyebrow="Zoniou Perfumes" | |
| lines={[ | |
| ['A WAY', 0], | |
| ['TO LABEL', 100], | |
| ['SCENTS', 0], | |
| ]} | |
| /> | |
| <ArrowLink label="View the Zoniou Perfumes case" /> | |
| </div> | |
| </Reveal> | |
| <Reveal as="article" className="work work-shook"> | |
| <div className="shook-head"> | |
| <WorkTitle | |
| eyebrow="Shook Radio" | |
| lines={[ | |
| ['SOMETHING TO', 113], | |
| ['TUNE IN', 0], | |
| ['GENERATION Z', 113], | |
| ]} | |
| /> | |
| <ArrowLink label="View the Shook Radio case" className="shook-arrow" /> | |
| </div> | |
| <img | |
| className="shook-media" | |
| src="/images/work-ringlight.jpg" | |
| alt="Shook Radio — host in a pale green sweater speaking behind a ring light, in front of an op-art striped backdrop" | |
| width="1920" | |
| height="814" | |
| loading="lazy" | |
| /> | |
| </Reveal> | |
| <Reveal as="article" className="work work-onoma"> | |
| <div className="onoma-text"> | |
| <WorkTitle | |
| eyebrow="Onoma Hotel" | |
| eyebrowIndent={96} | |
| lines={[ | |
| ['A STORY OF AN', 96], | |
| ['INSTAGRAMMABLE', 0], | |
| ['HOTEL', 96], | |
| ]} | |
| /> | |
| </div> | |
| <img | |
| className="onoma-media" | |
| src="/images/work-bearbrick.jpg" | |
| alt="Onoma Hotel — black bear figurine carrying a duffel bag over a giant letter S on a yellow poster" | |
| width="766" | |
| height="959" | |
| loading="lazy" | |
| /> | |
| <ArrowLink label="View the Onoma Hotel case" className="onoma-arrow" /> | |
| </Reveal> | |
| </section> | |
| ) | |
| } | |