diff --git a/app/globals.css b/app/globals.css
index d6ad20e..b6f0e94 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -188,9 +188,10 @@ nav {
nav {
font-size: 16px;
}
-.project-grid {
- scrollbar-width: 10px;
-}
+
+ .project-grid {
+ scrollbar-width: 10px;
+ }
}
diff --git a/components/ProjectCard.tsx b/components/ProjectCard.tsx
index 2d5ff03..ede06f9 100644
--- a/components/ProjectCard.tsx
+++ b/components/ProjectCard.tsx
@@ -5,7 +5,7 @@ import type { Project } from "@/data/content";
import SimpleGallery from "./SimpleGallery";
import Link from "next/link";
import { relative } from "path";
-
+import "../styles/project-card.css";
type Props = {
project: Project;
@@ -114,7 +114,7 @@ export default function ProjectCard({ project, visible, selected = false, setSel
style={{
minWidth: "10em",
maxWidth: "90vw",
- overflow: "hidden",
+
textDecoration: "none",
padding: 28,
marginTop: 3,
@@ -130,9 +130,7 @@ export default function ProjectCard({ project, visible, selected = false, setSel
pointerEvents: "auto",
cursor: "pointer"
}}>
-
+
{project.title}
@@ -142,7 +140,8 @@ export default function ProjectCard({ project, visible, selected = false, setSel
{projectTagsComponent(project)}
-
+
{project.description}
@@ -158,15 +157,11 @@ export default function ProjectCard({ project, visible, selected = false, setSel
border: `1px solid ${hovered ? "var(--accent)" : "var(--border)"}`,
backgroundColor: "var(--bg)",
height: "3em",
- display: "block",
alignContent: "center",
alignItems: "center",
textAlign: "center",
width: "10em",
borderRadius: "var(--radius-md)",
- position: "absolute",
- right: "1em",
- bottom: "1em"
}} href={"/project/"+project.slug} >See More
);
diff --git a/components/SimpleGallery.tsx b/components/SimpleGallery.tsx
index ab2f199..e1e7f10 100644
--- a/components/SimpleGallery.tsx
+++ b/components/SimpleGallery.tsx
@@ -1,6 +1,6 @@
import Image from "next/image";
-import { useState, useEffect, useRef, useCallback } from "react";
+import { useState, useEffect, useRef } from "react";
import { createPortal } from "react-dom";
import '@/styles/gallery.css';
@@ -10,9 +10,6 @@ type Props = {
title: string;
};
-// 0 = inline default, 1 = inline enlarged, 2 = fullscreen overlay
-type EnlargeLevel = 0 | 1 | 2;
-
export default function SimpleGallery({
images,
videos = [],
@@ -20,9 +17,10 @@ export default function SimpleGallery({
}: Props) {
const [active, setActive] = useState(0);
- const [enlargeLevel, setEnlargeLevel] = useState(0);
+ const [isEnlarged, setIsEnlarged] = useState(false);
const timerRef = useRef | null>(null);
const videoRef = useRef(null);
+ const fsPortalRef = useRef(null);
const totalMedia = images.length + videos.length;
const isVideo = active >= images.length;
@@ -31,24 +29,8 @@ export default function SimpleGallery({
if (totalMedia === 0) return null;
- function handleEnlarge() {
- if (enlargeLevel === 0) {
- setEnlargeLevel(1);
- } else if (enlargeLevel === 1) {
- setEnlargeLevel(2);
- }
- }
-
- function handleShrink() {
- if (enlargeLevel === 2) {
- setEnlargeLevel(1);
- } else if (enlargeLevel === 1) {
- setEnlargeLevel(0);
- }
- }
-
function handleFullscreenClose() {
- setEnlargeLevel(1);
+ setIsEnlarged(false);
}
function handleThumbnailClick(index: number) {
@@ -57,14 +39,22 @@ export default function SimpleGallery({
function expandButton() {
return (
-