Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 9 additions & 9 deletions src/components/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ export default function NavBar() {
const location = useLocation();

const links = [
{ path: '/', label: 'Home' },
{ path: '/credits', label: 'Credits' },
{ path: '/about', label: 'About' },
{ path: 'https://github.com/Ryan-Millard/Img2Num', label: 'GitHub', external: true },
{ path: '/', label: 'Home', tooltip: 'Go to the home page' },
{ path: '/credits', label: 'Credits', tooltip: 'View project credits' },
{ path: '/about', label: 'About', tooltip: 'Learn more about Img2Num' },
{ path: 'https://github.com/Ryan-Millard/Img2Num', label: 'GitHub', tooltip: 'Open the project on GitHub', external: true },
];

const renderLinks = links.map((link) => {
const isActive = !link.external && location.pathname === link.path; // active if route matches
return (
<li key={link.label}>
{link.external ? (
<a href={link.path} target="_blank" rel="noopener noreferrer" className={styles.externalLink}>
<a href={link.path} target="_blank" rel="noopener noreferrer" className={styles.externalLink} title={link.tooltip}>
{link.label}
<SquareArrowOutUpRight size={'1.25em'} className={styles.externalLinkIcon} />
<SquareArrowOutUpRight size="1.25em" className={styles.externalLinkIcon} title="Opens in a new tab" />
</a>
) : (
<Link to={link.path} className={isActive ? styles.activeLink : ''}>
<Link to={link.path} className={isActive ? styles.activeLink : ''} title={link.tooltip}>
{link.label}
</Link>
)}
Expand All @@ -36,10 +36,10 @@ export default function NavBar() {
return (
<GlassCard as="nav" className={styles.navbar} style={{ padding: '0.5rem 1rem' }}>
<div className={styles.logo}>
<Link to="/">Img2Num</Link>
<Link to="/" title="Go to home page">Img2Num</Link>
</div>

<button className={styles.hamburger} onClick={() => setIsOpen(!isOpen)} aria-label="Toggle menu">
<button className={styles.hamburger} onClick={() => setIsOpen(!isOpen)} aria-label="Toggle menu" title="Toggle navigation menu">
<span className={isOpen ? styles.barActive : styles.bar}></span>
<span className={isOpen ? styles.barActive : styles.bar}></span>
<span className={isOpen ? styles.barActive : styles.bar}></span>
Expand Down
8 changes: 5 additions & 3 deletions src/components/WasmImageProcessor.jsx

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please add all the comments that were in this file back. This is a very technical file, and there hasn't been any documentation written for it, so that will cause problems for newcomers and for me (the person who wrote this code).

I will likely forget a lot of the important things I added comments about in this file, which is why it is imperative that the comments are added back to the file. I will write documentation on it once I get around to refactoring and documenting most of the project.

Note

In future, please leave code as-is unless it is directly related to the issue you are solving -
that will make reviewing your code much easier in the future.

If you find code that has a bug or possibly needs to be refactored, please open an issue about
it first before changing anything about it - it's possible that it was intentional or has already been
worked on.

The change you made on line 205 is nice. It looks better.

      data-image-loaded={!!originalSrc}
    >

Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ const WasmImageProcessor = () => {
const EmptyState = useMemo(
() => (
<>
<Upload className={`anchor-style ${styles.uploadIcon}`} />
<Upload className={`anchor-style ${styles.uploadIcon}`} title="Upload an image from your device" />
<p className={`text-center ${styles.dragDropText}`}>
Drag & Drop or <span className={`anchor-style ${styles.noTextWrap}`}>Choose File</span>
Drag & Drop or <span className={`anchor-style ${styles.noTextWrap}`} title="Select an image file from your computer" >Choose File</span>
</p>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
</>
),
Expand All @@ -154,6 +154,7 @@ const WasmImageProcessor = () => {
{!isProcessing ? (
<button
className="uppercase button"
title="Process the image and convert it to numbers"
onClick={(e) => {
e.stopPropagation();
processImage();
Expand All @@ -170,6 +171,7 @@ const WasmImageProcessor = () => {
return (
<GlassCard
className={`flex-center flex-column ${styles.dropZone}`}
title="Drag and drop an image here or click to choose a file"
onDrop={handleDrop}
onDragOver={(e) => e.preventDefault()}
onClick={() => {
Expand All @@ -178,7 +180,7 @@ const WasmImageProcessor = () => {
data-image-loaded={!!originalSrc}>
{originalSrc ? LoadedState : EmptyState}

<input ref={inputRef} id={inputId} type="file" accept="image/*" hidden onChange={handleSelect} />
<input ref={inputRef} id={inputId} type="file" accept="image/*" hidden title="Choose an image file to upload" onChange={handleSelect} />
</GlassCard>
);
};
Expand Down
11 changes: 9 additions & 2 deletions src/data/contributor-credits.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@
"login": "Ryan-Millard",
"html_url": "https://github.com/Ryan-Millard",
"avatar_url": "https://avatars.githubusercontent.com/u/142347829?v=4",
"contributions": 43
"contributions": 50
},
{
"id": 49699333,
"login": "dependabot[bot]",
"html_url": "https://github.com/apps/dependabot",
"avatar_url": "https://avatars.githubusercontent.com/in/29110?v=4",
"contributions": 13
"contributions": 14
},
{
"id": 154383664,
"login": "hjmillard",
"html_url": "https://github.com/hjmillard",
"avatar_url": "https://avatars.githubusercontent.com/u/154383664?v=4",
"contributions": 3
},
{
"id": 186252912,
"login": "Rashmijoshi18",
"html_url": "https://github.com/Rashmijoshi18",
"avatar_url": "https://avatars.githubusercontent.com/u/186252912?v=4",
"contributions": 1
}
]
4 changes: 2 additions & 2 deletions src/pages/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ const Home = () => (
<WasmImageProcessor />

<div className={styles.featureContainer}>
<GlassCard>
<GlassCard title="Performance feature">
<h3>⚡ Fast & Lightweight</h3>
<p>Compiled C++ runs in your browser via WebAssembly with near-native speed.</p>
</GlassCard>
<GlassCard>
<GlassCard title="Integration feature">
<h3>🛠️ Easy to Integrate</h3>
<p>Minimal dependencies, works with any project or workflow.</p>
</GlassCard>
Expand Down