Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
52 changes: 22 additions & 30 deletions src/components/ImageOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ interface ImageOverlayPanelProps {
}

const POSITIONS: { value: OverlayPosition; icon: React.ReactNode; label: string }[] = [
{ value: "top-left", icon: <ArrowUpLeft size={11} />, label: "TL" },
{ value: "top-right", icon: <ArrowUpRight size={11} />, label: "TR" },
{ value: "bottom-left", icon: <ArrowDownLeft size={11} />, label: "BL" },
{ value: "top-left", icon: <ArrowUpLeft size={11} />, label: "TL" },
{ value: "top-right", icon: <ArrowUpRight size={11} />, label: "TR" },
{ value: "bottom-left", icon: <ArrowDownLeft size={11} />, label: "BL" },
{ value: "bottom-right", icon: <ArrowDownRight size={11} />, label: "BR" },
];

Expand Down Expand Up @@ -60,16 +60,15 @@ export default function ImageOverlayPanel({

return (
<div className="w-full text-[11px] text-[var(--text)] space-y-3">

{/* Side-by-Side Area */}
<div className="flex gap-2.5 items-center w-full">

{/* Left Side: Dynamic Upload / Preview Square */}
<label htmlFor="overlay-file-input" className={`w-14 h-11 shrink-0 rounded-lg overflow-hidden flex flex-col items-center justify-center transition border ${
overlayFile
<label htmlFor="overlay-file-input" className={`w-14 h-11 shrink-0 rounded-lg overflow-hidden flex flex-col items-center justify-center transition border ${overlayFile
? "border-[var(--border)] bg-[var(--bg)] pointer-events-none"
: "border-dashed border-[var(--border)] hover:bg-[var(--accent-muted)] text-[var(--muted)] hover:text-[var(--text)] cursor-pointer"
}`}>
}`}>
{thumbUrl ? (
<Image
src={thumbUrl}
Expand Down Expand Up @@ -140,14 +139,13 @@ export default function ImageOverlayPanel({
<div className="grid grid-cols-4 gap-1 flex-1">
{POSITIONS.map(({ value, icon, label }) => (
<button
key={value}
key={value as string}
type="button"
onClick={() => setOverlayPosition(value)}
className={`rounded border py-0.5 text-center text-[10px] transition flex items-center justify-center gap-0.5 ${
overlayPosition === value
className={`rounded border py-0.5 text-center text-[10px] transition flex items-center justify-center gap-0.5 ${overlayPosition === value
? "border-[var(--accent)] text-[var(--text)] bg-[var(--accent-muted)]"
: "border-[var(--border)] text-[var(--muted)] hover:bg-[var(--accent-muted)]"
}`}
}`}
>
<span className={overlayPosition === value ? "text-[var(--accent)]" : "text-[var(--muted)]"}>
{icon}
Expand All @@ -165,33 +163,30 @@ export default function ImageOverlayPanel({
<button
type="button"
onClick={() => setOverlaySize(100)}
className={`rounded border py-0.5 text-center text-[10px] transition ${
isSmallSize
className={`rounded border py-0.5 text-center text-[10px] transition ${isSmallSize
? "border-[var(--accent)] text-[var(--text)] bg-[var(--accent-muted)]"
: "border-[var(--border)] text-[var(--muted)] hover:bg-[var(--accent-muted)]"
}`}
}`}
>
Small
</button>
<button
type="button"
onClick={() => setOverlaySize(250)}
className={`rounded border py-0.5 text-center text-[10px] transition ${
isMediumSize
className={`rounded border py-0.5 text-center text-[10px] transition ${isMediumSize
? "border-[var(--accent)] text-[var(--text)] bg-[var(--accent-muted)]"
: "border-[var(--border)] text-[var(--muted)] hover:bg-[var(--accent-muted)]"
}`}
}`}
>
Medium
</button>
<button
type="button"
onClick={() => setOverlaySize(450)}
className={`rounded border py-0.5 text-center text-[10px] transition ${
isLargeSize
className={`rounded border py-0.5 text-center text-[10px] transition ${isLargeSize
? "border-[var(--accent)] text-[var(--text)] bg-[var(--accent-muted)]"
: "border-[var(--border)] text-[var(--muted)] hover:bg-[var(--accent-muted)]"
}`}
}`}
>
Large
</button>
Expand All @@ -205,33 +200,30 @@ export default function ImageOverlayPanel({
<button
type="button"
onClick={() => setOverlayOpacity(25)}
className={`rounded border py-0.5 text-center text-[10px] transition ${
isFaintOpacity
className={`rounded border py-0.5 text-center text-[10px] transition ${isFaintOpacity
? "border-[var(--accent)] text-[var(--text)] bg-[var(--accent-muted)]"
: "border-[var(--border)] text-[var(--muted)] hover:bg-[var(--accent-muted)]"
}`}
}`}
>
25%
</button>
<button
type="button"
onClick={() => setOverlayOpacity(60)}
className={`rounded border py-0.5 text-center text-[10px] transition ${
isMediumOpacity
className={`rounded border py-0.5 text-center text-[10px] transition ${isMediumOpacity
? "border-[var(--accent)] text-[var(--text)] bg-[var(--accent-muted)]"
: "border-[var(--border)] text-[var(--muted)] hover:bg-[var(--accent-muted)]"
}`}
}`}
>
60%
</button>
<button
type="button"
onClick={() => setOverlayOpacity(100)}
className={`rounded border py-0.5 text-center text-[10px] transition ${
isSolidOpacity
className={`rounded border py-0.5 text-center text-[10px] transition ${isSolidOpacity
? "border-[var(--accent)] text-[var(--text)] bg-[var(--accent-muted)]"
: "border-[var(--border)] text-[var(--muted)] hover:bg-[var(--accent-muted)]"
}`}
}`}
>
100%
</button>
Expand Down
38 changes: 29 additions & 9 deletions src/components/ThemeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function ThemeToggle() {
}, []);

const isDark = theme === "dark";

if (!mounted) {
return (
<button
Expand All @@ -30,10 +30,10 @@ export function ThemeToggle() {

return (
<button
type="button"
suppressHydrationWarning={true}
onClick={toggleTheme}
aria-label={isDark ? "Switch to light mode" : "Switch to dark mode"}
type="button"
suppressHydrationWarning={true}
onClick={toggleTheme}
aria-label={isDark ? "Switch to light mode" : "Switch to dark mode"}
className="
relative flex items-center justify-center
w-9 h-9 rounded-full
Expand All @@ -46,14 +46,34 @@ export function ThemeToggle() {
transition-all duration-200
"
>
{!mounted ? (
<div className="w-4 h-4" />
{!mounted ? (
<div className="w-4 h-4" />
) : isDark ? (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" className="w-4 h-4" aria-hidden="true">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
className="w-4 h-4"
aria-hidden="true"
>
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
</svg>
) : (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" className="w-4 h-4" aria-hidden="true">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth={2}
strokeLinecap="round"
strokeLinejoin="round"
className="w-4 h-4"
aria-hidden="true"
>
<circle cx="12" cy="12" r="4" />
<path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" />
</svg>
Expand Down
Loading
Loading