Skip to content

Commit

Permalink
fdas
Browse files Browse the repository at this point in the history
  • Loading branch information
neerajrekwar committed Sep 4, 2024
1 parent 5ced2c7 commit ffba0a8
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 159 deletions.
6 changes: 3 additions & 3 deletions app/blog/data/posts.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
},
{
"slug": "second-post",
"title": "The Art of Patience: Learning from Delays and Setbacks",
"title": "The Art of Patience Learning from Delays and Setbacks",
"imageUrl": "https://images.unsplash.com/photo-1724830909783-b50ab4e263ec?q=80&w=1374&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
"date": "2024-08-29",
"date": "",
"content": "This is the content of the second post."
},
{
"slug": "third-post",
"title": "",
"imageUrl": "https://images.unsplash.com/photo-1724870069803-ee8d7119d608?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxmZWF0dXJlZC1waG90b3MtZmVlZHwxNXx8fGVufDB8fHx8fA%3D%3D",
"date": "2024-08-30",
"date": "",
"content": "This is the content of the third post."
}
]
6 changes: 3 additions & 3 deletions app/blog/first-post/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function FirstPostPage() {
{typeof post.content === 'object' && 'data-ctn' in post.content && post.content["data-ctn"].map((contentItem) => (
<div key={contentItem.id}>
{contentItem.heading3 && (
<h3 className='text-xl md:opacity-95 md:font-semibold font-medium md:text-2xl text-five pt-2'>{contentItem.heading3}</h3>
<h3 className='text-xl md:opacity-95 font-medium md:text-2xl text-five pt-2'>{contentItem.heading3}</h3>
)}
{contentItem.paraChildPara && (
<p className='pb-4'>{contentItem.paraChildPara}</p>
Expand All @@ -69,9 +69,9 @@ export default function FirstPostPage() {

{/* Additional post content */}
<div className='max-w-6xl m-auto'>

{/*
<IconQuote className='skew-x-12 rotate-120' />
<IconQuote className='' />
<IconQuote className='' /> */}
</div>
</article>

Expand Down
39 changes: 23 additions & 16 deletions app/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function BlogIndexPage() {
<ul className="basis-2/2 max-w-5xl m-auto flex-col flex gap-6">
{posts.map((post) => (
<li key={post.slug} className="p-2 border-b-2 bg-custom-radial-sm md:bg-none rounded border-seven sm:flex gap-10 flex-row-reverse m-2">
<div className="basis-1/4 rounded flex justify-center items-center aspect-video overflow-hidden border-red-400">
<div className="basis-1/4 rounded md:rounded-none flex justify-center items-center md:aspect-square aspect-video overflow-hidden border-red-400">
{post.imageUrl ? (
<Image
className="w-full aspect-square object-cover"
Expand All @@ -47,28 +47,32 @@ export default function BlogIndexPage() {
)}
</div>
<h2 className="basis-3/4 flex-col flex justify-start border-red-400">
{post.title ? (
<Link
className="text-2xl md:text-4xl text-five font-semibold"
href={`/blog/${post.slug}`}
>
{post.title}
</Link>
):(<div className=''>title in processing</div>)}
{post.title ? (
<Link
className="text-2xl md:text-4xl text-five "
href={`/blog/${post.slug}`}
>
{post.title}
</Link>
) : (<div className=''>title in processing</div>)}
<div className="flex gap-1 md:gap-2 opacity-50 text-four md:pb-4 tracking-wide text-xs md:text-sm font-medium py-2 justify-start">
<p>
{post?.date ? (<p>
{new Date(post.date).toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
})}
</p>
</p>) : (<p>none of print</p>)}
<p>{post.author}</p>
{post?.author ? (<p>
{post.author}
</p>) : (<p>unknown</p>)}


</div>
<BlogExcerpt
key={post.slug}

description={post.description || "No description available"}
slug={post.slug}
/>
Expand All @@ -89,9 +93,12 @@ export default function BlogIndexPage() {
</ul>
<ShareDialog url={shareUrl} isOpen={isDialogOpen} onClose={closeShareDialog} />
</section>
<section className="min-h-[50vh]">

</section>
<section className="min-h-96 ">
<div className="m-auto max-w-5xl py-16 px-2">
<h4 className="text-center text-4xl">Change thinking, your life Change automatically </h4>
<p className="text-center p-4">Lorem ipsum dolor sit amet consectetur adipisicing elit. Itaque quibusdam culpa eveniet sed commodi beatae, quam nemo, iure, necessitatibus repellendus earum distinctio veritatis ab! Corporis minus dolore dolorem ullam voluptates.</p>
</div>
</section>
</main>

);
Expand Down
176 changes: 91 additions & 85 deletions app/blog/second-post/page.tsx
Original file line number Diff line number Diff line change
@@ -1,111 +1,117 @@
import { IconHeartFilled, IconLink, IconQuestionMark, IconQuote, IconShare } from '@tabler/icons-react';
import posts from '../data/posts.json';
import Image from 'next/image'
import Link from 'next/link';

const post = posts.find(p => p.slug === 'second-post');

export default function SecondPostPage() {
return (
<body className='bg-primary'>
<main className="prose min-h-screen max-w-5xl bg-primary m-auto text-four mx-auto py-2">
<section className='mb-44'>
<p className='p-[4px] font-semibold flex justify-center rounded-full items-center my-10 max-w-fit m-auto text-four border-2 border-four bg-primary px-2 uppercase text-sm'>think it</p>
<article className="prose max-w-none min-h-screen p-4">
<h1 className="text-3xl text-five md:text-center md:text-4xl font-bold mb-4">{post?.title}</h1>
<div className='flex gap-2 md:gap-4 md:pb-4 tracking-wide text-xs md:text-sm uppercase py-4 justify-center'>
<main className="prose min-h-screen max-w-5xl bg-primary m-auto text-four mx-auto py-2">
<section className='mb-44'>
<p className='p-[4px] font-semibold flex justify-center rounded-full items-center my-10 max-w-fit m-auto text-four border-2 border-four bg-primary px-2 uppercase text-sm'>think it</p>
<article className="prose max-w-none min-h-screen p-4">
<h1 className="text-3xl text-five md:text-center md:text-4xl font-bold mb-4">{post?.title ? (
<Link
className=""
href={`/blog/${post?.slug}`}
>
{post?.title}
</Link>
):(<div className=''>title in processing</div>)}</h1>
<div className='flex gap-2 md:gap-4 md:pb-4 tracking-wide text-xs uppercase py-4 justify-center'>

<span className='opacity-50'>by</span>
<span className='text-four'>
{post?.author}
</span>
<span>/</span>
<span className='opacity-50'>{new Date(post?.date as string).toLocaleString("en-US", {
day: 'numeric',
month: 'long',
year: 'numeric'
<span className='opacity-75'>by</span>
<span className='text-four'>
{post?.author}
</span>
<span>/</span>
<span className='opacity-75'>{new Date(post?.date as string).toLocaleString("en-US", {
day: 'numeric',
month: 'long',
year: 'numeric'

})}</span>
<span>/</span>
<span className='opacity-50'>
{post?.duration}
</span>
</div>
<p className='first-letter:text-xl text-sm p-2 opacity-75 rounded-sm my-2 first-letter:font-bold first-letter:ml-1 '>
{post?.description}
})}</span>
<span>/</span>
<span className='opacity-75'>
{post?.duration}
</span>
</div>
<p className='first-letter:text-xl text-sm p-2 opacity-75 rounded-sm my-2 first-letter:font-bold first-letter:ml-1 '>
{post?.description}

</p>
{post && (
<div>
</p>
{post && (
<div>

<img
src={post?.imageUrl}
alt={post?.title}
className="float-left mr-4 mb-2 w-1/3 h-auto object-cover rounded-lg"
/>
<div>
{/* Check if post.content is an object and has the "data-ctn" property */}
{typeof post.content === 'object' && 'data-ctn' in post.content && post.content["data-ctn"].map((contentItem) => (
<div key={contentItem.id}>
{contentItem.heading3 && (
<h3 className='text-xl md:opacity-95 md:font-semibold font-medium md:text-2xl text-five pt-2'>{contentItem.heading3}</h3>
)}
{contentItem.paraChildPara && (
<p className='pb-4'>{contentItem.paraChildPara}</p>
)}
</div>
))}
<img
src={post?.imageUrl}
alt={post?.title}
className="float-left mr-4 mb-2 w-1/3 h-auto object-cover rounded-lg"
/>
<div>
{/* Check if post.content is an object and has the "data-ctn" property */}
{typeof post.content === 'object' && 'data-ctn' in post.content && post.content["data-ctn"].map((contentItem) => (
<div key={contentItem.id}>
{contentItem.heading3 && (
<h3 className='text-xl md:opacity-95 font-medium md:text-2xl text-five pt-2'>{contentItem.heading3}</h3>
)}
{contentItem.paraChildPara && (
<p className='pb-4'>{contentItem.paraChildPara}</p>
)}
</div>
</div>
)}
))}
</div>
</div>
)}

{/* Additional post content */}
<div className='max-w-6xl m-auto'>
{/* Additional post content */}
<div className='max-w-6xl m-auto'>

<IconQuote className='skew-x-12 rotate-120' />
<IconQuote className='' />
</div>
</article>
{/* <IconQuote className='skew-x-12 rotate-120' />
<IconQuote className='' /> */}
</div>
</article>

</section>
<section className='min-h-screen border-third uppercase tracking-wide text-four'>
<div className='flex items-center py-4 justify-center '>
<span className='flex items-center bg-secondary rounded-full gap-2 text-primary p-2 px-3'><IconHeartFilled /> like this</span>
</div>
<div className='flex gap-4 text-sm py-2 items-center font-semibold justify-center '>
</section>
<section className='min-h-screen border-third uppercase tracking-wide text-four'>
<div className='flex items-center py-4 justify-center '>
<span className='flex items-center bg-secondary rounded-full gap-2 text-primary p-2 px-3'><IconHeartFilled /> like this</span>
</div>
<div className='flex gap-4 text-sm py-2 items-center font-semibold justify-center '>

<span className="font-bold">Himanshu</span> <span className="opacity-50">and</span><span className="font-bold">12</span>
<p className="opacity-50">others love this</p>
<span className="font-bold">Himanshu</span> <span className="opacity-50">and</span><span className="font-bold">12</span>
<p className="opacity-50">others love this</p>
</div>
<div className="">
<div className="relative ">
<div className="absolute h-44 w-full flex justify-center items-center w-full ">
<div className="h-[1px] bg-custom-radial-lg w-full "></div>
</div>
<div className="">
<div className="relative ">
<div className="absolute h-44 w-full flex justify-center items-center w-full ">
<div className="h-[0.5px] md:h-[1px] bg-custom-radial-lg w-full "></div>
</div>
<div className="absolute h-44 w-full absolute h-20 w-full flex flex-col justify-center items-center">
<Image
className="rounded-full"
src={'/me.webp'}
width={40}
height={40}
alt="neel"
/>
<div className="absolute bottom-0 text-center ">
<h6 className="font-bold py-2 text-sm">neeraj rekwar</h6>
<p className="text-xs opacity-50 tracking-widest">Artist way show realism</p>
<div className="absolute w-full text-center -bottom-24 ">
<a href="/" target="_blank" className="flex justify-center items-center bg-secondary rounded-full gap-2 text-primary p-2 px-3">suggest an idea</a>
</div>
</div>
<div className="absolute h-44 w-full absolute h-20 w-full flex flex-col justify-center items-center">
<Image
className="rounded-full"
src={'/me.webp'}
width={40}
height={40}
alt="neel"
/>
<div className="absolute bottom-0 text-center ">
<h6 className="font-bold py-2 text-sm">neeraj rekwar</h6>
<p className="text-xs opacity-50 tracking-widest">Artist way show realism</p>
<div className="absolute w-full text-center -bottom-24 ">
<a href="/" target="_blank" className="flex justify-center items-center bg-secondary rounded-full gap-2 text-primary p-2 px-3">suggest an idea</a>
</div>
</div>
</div>



</div>
</div>


</div>
</section>
</main>
</body>
</div>
</section>
</main>
);
}
30 changes: 19 additions & 11 deletions app/blog/third-post/page.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
import { IconHeartFilled, IconLink, IconQuote, IconShare } from '@tabler/icons-react';
import posts from '../data/posts.json';
import Image from 'next/image'
import Link from 'next/link';

const post = posts.find(p => p.slug === 'third-post');

export default function ThirdPostPage() {
return (

<main className="prose min-h-screen max-w-5xl bg-primary m-auto text-four mx-auto py-2">
<section className='mb-44'>
<p className='p-[4px] font-semibold flex justify-center rounded-full items-center my-10 max-w-fit m-auto text-four border-2 border-four bg-primary px-2 uppercase text-sm'>think it</p>
<article className="prose max-w-none min-h-screen p-4">
<h1 className="text-3xl text-five md:text-center md:text-4xl font-bold mb-4">{post?.title}</h1>
<div className='flex gap-2 md:gap-4 md:pb-4 tracking-wide text-xs md:text-sm uppercase py-4 justify-center'>

<span className='opacity-50'>by</span>
<h1 className="text-3xl text-five md:text-center md:text-4xl font-bold mb-4">{post?.title ? (
<Link
className=""
href={`/blog/${post?.slug}`}
>
{post?.title}
</Link>
) : (<div className=''>title in processing</div>)}</h1>
<div className='flex gap-2 md:gap-4 md:pb-4 tracking-wide text-xs uppercase py-4 justify-center'>

<span className='opacity-75'>by</span>
<span className='text-four'>
{post?.author}
</span>
<span>/</span>
<span className='opacity-50'>{new Date(post?.date as string).toLocaleString("en-US", {
<span className='opacity-75'>{new Date(post?.date as string).toLocaleString("en-US", {
day: 'numeric',
month: 'long',
year: 'numeric'

})}</span>
<span>/</span>
<span className='opacity-50'>
<span className='opacity-75'>
{post?.duration}
</span>
</div>
Expand All @@ -47,7 +55,7 @@ export default function ThirdPostPage() {
{typeof post.content === 'object' && 'data-ctn' in post.content && post.content["data-ctn"].map((contentItem) => (
<div key={contentItem.id}>
{contentItem.heading3 && (
<h3 className='text-xl md:opacity-96 md:font-semibold font-medium md:text-2xl text-five pt-2'>{contentItem.heading3}</h3>
<h3 className='text-xl md:opacity-95 font-medium md:text-2xl text-five pt-2'>{contentItem.heading3}</h3>
)}
{contentItem.paraChildPara && (
<p className='pb-4'>{contentItem.paraChildPara}</p>
Expand All @@ -61,8 +69,8 @@ export default function ThirdPostPage() {
{/* Additional post content */}
<div className='max-w-6xl m-auto'>

<IconQuote className='skew-x-12 rotate-120' />
<IconQuote className='' />
{/* <IconQuote className='skew-x-12 rotate-120' />
<IconQuote className='' /> */}
</div>
</article>

Expand All @@ -79,7 +87,7 @@ export default function ThirdPostPage() {
<div className="">
<div className="relative ">
<div className="absolute h-44 w-full flex justify-center items-center w-full ">
<div className="h-[0.5px] md:h-[1px] bg-custom-radial-lg w-full "></div>
<div className="h-[1px] bg-custom-radial-lg w-full "></div>
</div>
<div className="absolute h-44 w-full absolute h-20 w-full flex flex-col justify-center items-center">
<Image
Expand Down
Loading

0 comments on commit ffba0a8

Please sign in to comment.