mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-09 03:03:02 +00:00
removed projectHasPointer
This commit is contained in:
21
src/App.tsx
21
src/App.tsx
@@ -55,7 +55,6 @@ function Home() {
|
||||
const [activeProject, setActiveProject] = useState<number | null>(null);
|
||||
const [activeLocation, setActiveLocation] = useState<number | null>(null);
|
||||
const [activePhoto, setActivePhoto] = useState<string | null>(null);
|
||||
const [projectHasPointer, setProjectHasPointer] = useState(false);
|
||||
const [asciiFile] = useState(
|
||||
() => asciiFiles[Math.floor(Math.random() * asciiFiles.length)],
|
||||
);
|
||||
@@ -146,24 +145,6 @@ function Home() {
|
||||
};
|
||||
}, [activeProject, navigate, visibleProjects]);
|
||||
|
||||
useEffect(() => {
|
||||
const enablePointerInteraction = () => {
|
||||
setProjectHasPointer(true);
|
||||
};
|
||||
|
||||
window.addEventListener("pointermove", enablePointerInteraction, {
|
||||
once: true,
|
||||
});
|
||||
window.addEventListener("pointerdown", enablePointerInteraction, {
|
||||
once: true,
|
||||
});
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("pointermove", enablePointerInteraction);
|
||||
window.removeEventListener("pointerdown", enablePointerInteraction);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="min-h-dvh flex flex-col items-center gap-2 text-2xl px-6 py-10">
|
||||
<div className="flex flex-col items-center gap-4 mb-4">
|
||||
@@ -236,7 +217,6 @@ function Home() {
|
||||
metadata={project.metadata}
|
||||
isDevMode={isDevMode}
|
||||
isActive={activeProject !== null && index === activeProject}
|
||||
enableHover={projectHasPointer}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
@@ -330,7 +310,6 @@ function Home() {
|
||||
metadata={project.metadata}
|
||||
isDevMode={isDevMode}
|
||||
isActive={activeProject !== null && index === activeProject}
|
||||
enableHover={projectHasPointer}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -6,12 +6,10 @@ export function ProjectListItem({
|
||||
metadata,
|
||||
isDevMode = false,
|
||||
isActive = false,
|
||||
enableHover = true,
|
||||
}: {
|
||||
metadata: ProjectMetadata;
|
||||
isDevMode?: boolean;
|
||||
isActive?: boolean;
|
||||
enableHover?: boolean;
|
||||
}) {
|
||||
const tags = metadata.tags ? [...metadata.tags].sort() : [];
|
||||
if (metadata.hidden && !isDevMode) return null;
|
||||
@@ -21,7 +19,7 @@ export function ProjectListItem({
|
||||
to={`/projects/${metadata.slug}`}
|
||||
className={cn(
|
||||
"group relative block flex flex-col justify-between transition-colors duration-200 border-2",
|
||||
enableHover && "hover:border-accent",
|
||||
"hover:border-accent",
|
||||
isActive && "border-accent",
|
||||
isDevMode && metadata.hidden && "border-dashed border-accent",
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user