Skip to content

Commit

Permalink
added: social storytelling project
Browse files Browse the repository at this point in the history
  • Loading branch information
krishna8421 committed Jan 12, 2025
1 parent a9f80dd commit 05aed4b
Show file tree
Hide file tree
Showing 23 changed files with 875 additions and 301 deletions.
25 changes: 15 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,45 @@
"@headlessui/react": "^1.7.19",
"@heroicons/react": "^2.1.3",
"@nextui-org/react": "^2.2.10",
"@radix-ui/react-slot": "^1.1.1",
"@sendgrid/mail": "^8.1.3",
"@tailwindcss/forms": "^0.5.7",
"@wojtekmaj/react-hooks": "^1.19.0",
"bcrypt": "^5.1.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.0",
"embla-carousel-react": "^8.5.2",
"form-data": "^4.0.0",
"formik": "^2.4.5",
"framer-motion": "^11.0.25",
"geist": "^1.3.0",
"gsap": "^3.12.5",
"lucide-react": "^0.471.0",
"mailgun.js": "^10.2.1",
"mini-svg-data-uri": "^1.4.4",
"next": "14.1.4",
"react": "^18",
"react-dom": "^18",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react-pdf": "^7.7.1",
"react-simple-typewriter": "^5.0.1",
"sonner": "^1.4.41",
"swiper": "^11.2.1",
"tailwind-merge": "^2.2.2",
"validator": "^13.11.0",
"zod": "^3.22.4",
"zod-formik-adapter": "^1.3.0",
"zustand": "^4.5.2"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"@types/node": "^20.12.5",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-next": "14.1.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.4"
}
}
681 changes: 401 additions & 280 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 81 additions & 9 deletions src/app/projects/[projectSlug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@
import { FollowerPointerCard } from "@/components/following-pointer";
import PdfViewer from "@/components/pdf-viewer";
import { PROJECTS } from "@/constants";
import { syncopate } from "@/fonts";
import { syncopate, rockSalt, caveat } from "@/fonts";
import { Avatar, Chip } from "@nextui-org/react";
import Image from "next/image";
import Link from "next/link";
import { register } from "swiper/element/bundle";
import { IoChevronBack } from "react-icons/io5";
// import { Chip, Avatar } from "@nextui-org/react";
import { useEffect } from "react";
import { useRef } from "react";
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel";
// import type { Metadata, ResolvingMetadata } from "next";
// import { SITE_NAME } from "@/constants";

Expand Down Expand Up @@ -41,6 +50,21 @@ export default function ProjectPage({ params: { projectSlug } }: IProps) {
throw new Error(`Project not found for slug: ${projectSlug}`);
}

const swiperRef = useRef(null);

useEffect(() => {
const swiperContainer = swiperRef.current;
if (swiperContainer) {
const params = {
navigation: true,
fade: true,
rewind: true,
};

Object.assign(swiperContainer, params);
(swiperContainer as any).initialize();
}
}, []);
return (
<main className="">
<div className="px-4 mx-auto max-w-screen-md">
Expand Down Expand Up @@ -227,17 +251,65 @@ export default function ProjectPage({ params: { projectSlug } }: IProps) {
// title={typeof pdf === "object" ? pdf.alt : undefined}
// // className={typeof pdf === "object" ? "" : "hidden"}
// >
<PdfViewer
key={index}
pdfFile={`/projects/${project.projectSlug}/pdfs/${
typeof pdf === "object" ? pdf.url : pdf
}`}
twoPageLayout={project.twoPageLayoutPdf}
/>
<PdfViewer
key={index}
pdfFile={`/projects/${project.projectSlug}/pdfs/${
typeof pdf === "object" ? pdf.url : pdf
}`}
twoPageLayout={project.twoPageLayoutPdf}
/>
// </FollowerPointerCard>
);
})}
</div>

{project.subProjects &&
Object.keys(project.subProjects).map((key, index) => (
<div key={index} className="mb-8 space-y-4">
<h2
className={`text-3xl md:text-4xl font-medium text-left break-words text-zinc-300 uppercase ${syncopate.className}`}
>
{key.split("-").join(" ")}
</h2>
{project.subProjects?.[key]?.map((subProject, i) => (
<div key={i} className="flex gap-3 flex-col">
{subProject?.images?.length > 1 ? (
<Carousel>
<CarouselContent>
{subProject?.images?.map((image, index) => (
<CarouselItem key={index}>
<Image
key={index}
src={`/projects/${project.projectSlug}/sub-projects/${key}/${subProject.slug}/${image}`}
alt={subProject.name}
width={800}
height={600}
quality={100}
className="rounded-lg border border-zinc-900 shadow-xl w-full h-full object-cover"
/>
</CarouselItem>
))}
</CarouselContent>
<CarouselPrevious />
<CarouselNext />
</Carousel>
) : subProject?.images?.length === 1 ? (
<Image
src={`/projects/${project.projectSlug}/sub-projects/${key}/${subProject.name}/${subProject.images[0]}`}
alt={subProject.name}
width={800}
height={600}
quality={100}
className="rounded-lg border border-zinc-900 shadow-xl w-full h-full"
/>
) : null}
<div className="text-center capitalize mb-6">
{subProject.name.split("-").join(" ")}
</div>
</div>
))}
</div>
))}
</div>
</div>
</main>
Expand Down
57 changes: 57 additions & 0 deletions src/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";

import { cn } from "@/lib/utils";

const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline:
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-9 px-4 py-2",
sm: "h-8 rounded-md px-3 text-xs",
lg: "h-10 rounded-md px-8",
icon: "h-9 w-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
);

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
}
);
Button.displayName = "Button";

export { Button, buttonVariants };
Loading

0 comments on commit 05aed4b

Please sign in to comment.