Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d7a54d6
fix(example-app): enable ref forwarding in GlassCard React component
Ryan-Millard Mar 7, 2026
d1199d5
feat(example-app): (React) Editor page controls
Ryan-Millard Mar 7, 2026
365797b
refactor(example-app): (React) make navbar hamburger reusable
Ryan-Millard Mar 8, 2026
b2c1018
feat(example-app): (React) improve UI and make reusable HamburgerMenu
Ryan-Millard Mar 11, 2026
ccd105a
feat(example-app): (React) add print feature
Ryan-Millard Mar 11, 2026
150959e
refactor(example-app): (React) move printing to its own function
Ryan-Millard Mar 11, 2026
410abe4
perf(example-app): (React) use pointerrawupdate for faster mouse drags
Ryan-Millard Mar 11, 2026
097a64f
feat(example-app): (React) undo and redo with history tracking
Ryan-Millard Mar 11, 2026
0b436bc
chore(example-app): (React) clean up styles
Ryan-Millard Mar 11, 2026
722e688
feat(example-app): add confirmation dialog for resets
Ryan-Millard Mar 11, 2026
9120639
feat(example-app): hide save buttons behind a modal and prompt for co…
Ryan-Millard Mar 11, 2026
d6dbf96
fix(example-app): (React) Modal displayed under other elements & adde…
Ryan-Millard Mar 12, 2026
0006934
fix(example-app): (React) editor page keybindings now support Mac
Ryan-Millard Mar 12, 2026
fd580a6
feat(example-app): (React) improve Editor page styles
Ryan-Millard Mar 20, 2026
6389ea8
refactor(example-app): (React) reuse download function and clean up CSS
Ryan-Millard Mar 21, 2026
184e7ca
feat(example-app): (React) improve editor page reset confirmation mod…
Ryan-Millard Mar 21, 2026
ff4bd80
fix(example-app): (React) unrevoked Blob URL
Ryan-Millard Mar 21, 2026
a762bcb
fix(example-app): (React) fix history bug where resetting doesn't cle…
Ryan-Millard Mar 21, 2026
27d6df7
fix(example-app): (React) Skip history writes when the tap doesn't ch…
Ryan-Millard Mar 21, 2026
e98b0fa
fix(example-app): (React) Don't swallow every Ctrl/Cmd shortcut, and …
Ryan-Millard Mar 21, 2026
b604158
ci(fix-checkouts): include recursive checkouts to include submodules…
Ryan-Millard Mar 21, 2026
6b0343c
Merge branch 'main' into feat/example-app/react/download-svg
Ryan-Millard Mar 21, 2026
ec0bfb1
Merge branch 'main' into feat/example-app/react/download-svg
Ryan-Millard Mar 21, 2026
cb44b7e
fix(example-app): (React) use pointermove when pointerrawupdate is un…
Ryan-Millard Mar 25, 2026
050bdde
fix(example-app): (React) revokeObjectURL on SVG in Editor page
Ryan-Millard Mar 25, 2026
3d8ca26
Merge branch 'main' into feat/example-app/react/download-svg
Ryan-Millard Mar 31, 2026
23faea3
Merge branch 'main' into feat/example-app/react/download-svg
Ryan-Millard Apr 1, 2026
2e489c1
style(example-app): format all files
Ryan-Millard Apr 1, 2026
01cbb1e
fix(react-js): resolve ESLint warnings in Editor components
Ryan-Millard Apr 1, 2026
35c0ea1
Merge branch 'main' into feat/example-app/react/download-svg
Ryan-Millard Apr 3, 2026
1aa1674
chore(file-resets): reset gpu.h and pr-auto-label.yml back to main's …
Ryan-Millard Apr 4, 2026
801584e
feat(editor): add fullscreen and improve zoom behavior
Ryan-Millard Apr 4, 2026
623e83f
style(example-app): (React) format all files
Ryan-Millard Apr 4, 2026
f56519f
refactor(example-app): (React) fix eslint warnings & tooltip positions
Ryan-Millard Apr 4, 2026
f736879
style(format): format all files
Ryan-Millard Apr 4, 2026
b6a40d3
Merge branch 'main' into feat/example-app/react/download-svg
Ryan-Millard Apr 4, 2026
20855b7
fix(example-app): (React) used functionbefore defined
Ryan-Millard Apr 4, 2026
843af6b
fix(useFullscreen): push/pop history on fullscreenchange instead of o…
Ryan-Millard Apr 4, 2026
4931be6
feat(editor): add raster (PNG/JPG) and PDF export to EditorControls
Ryan-Millard Apr 4, 2026
7b18ad8
style(format): format all files
Ryan-Millard Apr 4, 2026
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
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
context: .
dockerfile: Dockerfile.dev
container_name: img2num-dev
image: ryanmillard/img2num-dev:latest
working_dir: /usr/src/app
volumes:
- .:/usr/src/app:cached
Expand Down
7 changes: 4 additions & 3 deletions example-apps/react-js/src/components/GlassCard.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { forwardRef } from 'react';
import PropTypes from "prop-types";
import styles from "./GlassCard.module.css";

// eslint-disable-next-line no-unused-vars
const GlassCard = ({ as: Tag = "div", children, ...rest }) => (
<Tag {...rest} className={`text-center glass ${styles.card} ${rest.className || ""}`}>
const GlassCard = forwardRef( ({ as: Tag = "div", children, ...rest }, ref) => (
<Tag {...rest} className={`text-center glass ${styles.card} ${rest.className || ""}`} ref={ref}>
{children}
</Tag>
);
));

GlassCard.propTypes = {
as: PropTypes.oneOf([
Expand Down
73 changes: 73 additions & 0 deletions example-apps/react-js/src/components/GlassModal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { useEffect } from "react";
import { createPortal } from "react-dom";
import PropTypes from "prop-types";
import GlassCard from "@components/GlassCard";
import styles from "./GlassModal.module.css";
import { X } from "lucide-react";

export default function GlassModal({
isOpen,
onClose,
children,
size = "lg", // sm | md | lg | any CSS width
showCloseButton = true,
closeOnBackdropClick = true,
className = "",
style = {}
}) {
useEffect(() => {
const handleKey = (e) => {
if (e.key === "Escape") onClose?.();
};
if (isOpen) window.addEventListener("keydown", handleKey);
return () => window.removeEventListener("keydown", handleKey);
}, [isOpen, onClose]);

if (!isOpen) return null;

const handleBackdropClick = (e) => {
if (e.target === e.currentTarget && closeOnBackdropClick) {
onClose?.();
}
};

const width = size === "sm" ? "300px"
: size === "md" ? "500px"
: size === "lg" ? "800px"
: size;

const modal = (
<div
className={styles.backdrop}
onClick={handleBackdropClick}
role="dialog"
>
<GlassCard
as="div"
className={`${styles.modal} ${className}`}
style={{
flex: "0 0 auto",
width: width,
...style,
}}
>
{showCloseButton && (
<a
href="#"
onClick={(e) => {
e.preventDefault();
onClose();
}}
className={`${styles.closeButton}`}
aria-label="Close modal"
>
<X size={20} />
</a>
)}
{children}
</GlassCard>
</div>
);

return createPortal(modal, document.body);
}
43 changes: 43 additions & 0 deletions example-apps/react-js/src/components/GlassModal.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.backdrop {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
animation: fadeIn 0.2s ease forwards;
}

.modal {
position: relative;
border-radius: 1rem;
background: var(--color-bg);
padding: 1.5rem;
box-shadow: 0 8px 32px rgba(0,0,0,0.25);
animation: scaleIn 0.2s ease forwards;
max-height: 90vh;
overflow-y: auto;
z-index: 1001;
}

.closeButton {
position: absolute;
top: 0.5rem;
right: 0.5rem;
border: none;
cursor: pointer;
padding: 0.25rem;
display: flex;
align-items: center;
justify-content: center;
}

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

@keyframes scaleIn {
from { transform: scale(0.95); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}
Comment thread
Ryan-Millard marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
border-radius: 9999px;
position: relative;
cursor: pointer;
margin-right: 15px;
}

/* WCAG 2.4.7 Compliant Focus Indicator */
Expand Down
6 changes: 6 additions & 0 deletions example-apps/react-js/src/global-styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ img {
}

/* General link style */
button.anchor-style {
padding: auto;
background: none;
border: none;
}
a,
.anchor-style {
color: var(--color-primary);
Expand All @@ -69,6 +74,7 @@ a,
text-decoration 0.3s;
cursor: pointer;
text-decoration: underline;
cursor: pointer;
}

/* Hover/focus states */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
display: flex;
justify-content: space-between;
}
.flex-wrap-wrap {
display: flex;
flex-wrap: wrap;
}

.grid {
display: grid;
Expand Down
10 changes: 5 additions & 5 deletions example-apps/react-js/src/pages/Editor/Editor.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
background: transparent;
}
/* Default shape appearance in color mode: hide original fills until revealed */
.colorMode .viewport svg path:not(.coloredRegion),
.colorMode .viewport svg rect:not(.coloredRegion),
.colorMode .viewport svg circle:not(.coloredRegion),
.colorMode .viewport svg polygon:not(.coloredRegion),
.colorMode .viewport svg ellipse:not(.coloredRegion) {
.colorMode .viewport svg *:not(.coloredRegion) {
fill: white;
cursor: pointer;
transition: 150ms ease;
Expand Down Expand Up @@ -96,3 +92,7 @@
min-height: 240px;
}
}

.historyContainer {
width: 100%;
}
Loading
Loading