Skip to content
Merged
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
43 changes: 21 additions & 22 deletions components/ChapterSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,31 @@ const ChapterSection = () => {
<div className='flex flex-wrap items-center justify-center p-4 gap-20 mt-10'>
{Chapters.map((item, idx) => (
<div className='h-auto w-64 flex items-center justify-center' key={idx}>
<Link href={item.link} target="_blank">
<Link href={item.link} target='_blank'>
<PinContainer title={item.title} href={item.link}>
<div
className={`flex basis-full flex-col p-4 tracking-tight text-slate-100/50 sm:basis-1/2 ${
idx == 1 ? "md:w-[18rem] md:h-[22rem] w-[16rem] h-[20rem]" : " w-[16rem] h-[20rem]"
}`}
>

<h3 className='max-w-xs !pb-2 !m-0 font-normal text-base text-slate-100'>{item.title}</h3>
<div className='text-sm !m-0 !p-0 font-normal'>
<span className='text-slate-500 '>{item.des}</span>
<div
className={`flex basis-full flex-col p-4 tracking-tight text-slate-100/50 sm:basis-1/2 ${
idx == 1 ? "md:w-[18rem] md:h-[22rem] w-[16rem] h-[20rem]" : " w-[16rem] h-[20rem]"
}`}
>
<h3 className='max-w-xs !pb-2 !m-0 font-normal text-base text-slate-100'>{item.title}</h3>
<div className='text-sm !m-0 !p-0 font-normal'>
<span className='text-slate-500 '>{item.des}</span>
</div>
<div className='flex flex-1 w-full rounded-lg object-contain mt-4'>
<Image
src={item.img}
alt='tect'
width={350}
height={200}
className='flex flex-1 w-full rounded-lg '
/>
</div>
</div>
<div className='flex flex-1 w-full rounded-lg object-contain mt-4'>
<Image
src={item.img}
alt='tect'
width={350}
height={200}
className='flex flex-1 w-full rounded-lg '
/>
</div>
</div>
</PinContainer>
</PinContainer>

</Link>
</div>

))}
</div>
</div>
Expand Down
49 changes: 35 additions & 14 deletions components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import { WobbleCard } from "./ui/wobble-card";
import Image from "next/image";
import { useEffect, useState } from "react";
import axios from "axios";
// import axios from "axios";
import { randomProblemConst } from "@/constants/randomProblem";

const Grid = () => {
const [randomProblem, setRandomProblem] = useState({});
const [randomProblem, setRandomProblem] = useState<any>({});
//@ts-ignore
// eslint-disable-next-line
const getRandomProblem = (problemsMap) => {
Expand All @@ -21,11 +22,12 @@ const Grid = () => {
useEffect(() => {
const fetchQuestion = async () => {
try {
const url = "https://us-central1-neetcode-dd170.cloudfunctions.net/getProblemListFunction";
const response = await axios.post(url, { data: {} });
const data = response.data;
const randomProblem = getRandomProblem(data.result);
console.log(randomProblem);
// const url = "https://us-central1-neetcode-dd170.cloudfunctions.net/getProblemListFunction";
// const response = await axios.post(url, { data: {} });
// const data = response.data;
const randomProblem = getRandomProblem(randomProblemConst.result);
// console.log(randomProblem);

setRandomProblem(randomProblem);
} catch (error) {
console.error("Error fetching problem list:", error);
Expand All @@ -47,7 +49,10 @@ const Grid = () => {
</h2>
{randomProblem && Object.keys(randomProblem).length != 0 && (
//@ts-ignore
<a href={"https://neetcode.io/problems/" + randomProblem.id} target='_blank'>
<a
href={"https://neetcode.io/problems/" + randomProblem.id}
target='_blank'
>
<div className='absolute top-48 md:top-52 text-xl px-4 cursor-pointer py-2 border border-white rounded-lg'>
{
//@ts-ignore
Expand All @@ -58,7 +63,13 @@ const Grid = () => {
)}
<div className='absolute left-48 top-36 md:top-40 -rotate-12 '>
<div className='flex gap-1'>
<svg width='45' height='25' viewBox='0 0 45 25' fill='none' xmlns='http://www.w3.org/2000/svg'>
<svg
width='45'
height='25'
viewBox='0 0 45 25'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M43.2951 3.47877C43.8357 3.59191 44.3656 3.24541 44.4788 2.70484C44.5919 2.16427 44.2454 1.63433 43.7049 1.52119L43.2951 3.47877ZM4.63031 24.4936C4.90293 24.9739 5.51329 25.1423 5.99361 24.8697L13.8208 20.4272C14.3011 20.1546 14.4695 19.5443 14.1969 19.0639C13.9242 18.5836 13.3139 18.4152 12.8336 18.6879L5.87608 22.6367L1.92723 15.6792C1.65462 15.1989 1.04426 15.0305 0.563943 15.3031C0.0836291 15.5757 -0.0847477 16.1861 0.187863 16.6664L4.63031 24.4936ZM43.7049 1.52119C32.7389 -0.77401 23.9595 0.99522 17.3905 5.28788C10.8356 9.57127 6.58742 16.2977 4.53601 23.7341L6.46399 24.2659C8.41258 17.2023 12.4144 10.9287 18.4845 6.96211C24.5405 3.00476 32.7611 1.27399 43.2951 3.47877L43.7049 1.52119Z'
fill='currentColor'
Expand All @@ -82,14 +93,23 @@ const Grid = () => {
No Projects, no skills, Build on your own
</h2>
<p className='mt-4 max-w-[26rem] text-left text-base/6 text-neutral-200'></p>
<a href={"https://codingchallenges.fyi/challenges/intro"} target='_blank'>
<a
href={"https://codingchallenges.fyi/challenges/intro"}
target='_blank'
>
<div className='absolute top-48 md:top-52 text-xl px-4 cursor-pointer py-2 border border-white rounded-lg'>
codingchallenges.fyi
</div>
</a>
<div className='absolute left-48 top-36 md:top-40 -rotate-12 '>
<div className='flex gap-1'>
<svg width='45' height='25' viewBox='0 0 45 25' fill='none' xmlns='http://www.w3.org/2000/svg'>
<svg
width='45'
height='25'
viewBox='0 0 45 25'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M43.2951 3.47877C43.8357 3.59191 44.3656 3.24541 44.4788 2.70484C44.5919 2.16427 44.2454 1.63433 43.7049 1.52119L43.2951 3.47877ZM4.63031 24.4936C4.90293 24.9739 5.51329 25.1423 5.99361 24.8697L13.8208 20.4272C14.3011 20.1546 14.4695 19.5443 14.1969 19.0639C13.9242 18.5836 13.3139 18.4152 12.8336 18.6879L5.87608 22.6367L1.92723 15.6792C1.65462 15.1989 1.04426 15.0305 0.563943 15.3031C0.0836291 15.5757 -0.0847477 16.1861 0.187863 16.6664L4.63031 24.4936ZM43.7049 1.52119C32.7389 -0.77401 23.9595 0.99522 17.3905 5.28788C10.8356 9.57127 6.58742 16.2977 4.53601 23.7341L6.46399 24.2659C8.41258 17.2023 12.4144 10.9287 18.4845 6.96211C24.5405 3.00476 32.7611 1.27399 43.2951 3.47877L43.7049 1.52119Z'
fill='currentColor'
Expand All @@ -103,11 +123,12 @@ const Grid = () => {
<WobbleCard containerClassName='col-span-1 lg:col-span-3 bg-blue-900 min-h-[500px] lg:min-h-[600px] xl:min-h-[300px]'>
<div className='max-w-2xl'>
<h2 className='max-w-sm md:max-w-7xl text-left text-balance text-xl md:text-xl lg:text-2xl font-semibold tracking-[-0.015em] text-white'>
Elixir is a collaborative tech community that encourages a comprehensive learning environment.
Elixir is a collaborative tech community that encourages a
comprehensive learning environment.
</h2>
<p className='mt-4 max-w-[30rem] text-left text-base/6 text-neutral-200'>
This supportive network promotes young enthusiasts to explore, learn and grow together in the dynamic tech
industry.
This supportive network promotes young enthusiasts to explore, learn
and grow together in the dynamic tech industry.
</p>
</div>
<Image
Expand Down
2 changes: 1 addition & 1 deletion components/PageHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PageHeading = ({
longHeading,
link,
}: {
smallHeading: string;
smallHeading?: string;
longHeading: string;
link?: string;
}) => {
Expand Down
40 changes: 11 additions & 29 deletions components/ui/BentoGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from "react";
import { IoCopyOutline } from "react-icons/io5";

// Also install this npm i --save-dev @types/react-lottie
import Lottie from "react-lottie";
// import Lottie from "react-lottie";

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

Expand All @@ -12,19 +12,13 @@ import animationData from "@/data/confetti.json";
import MagicButton from "../MagicButton";
import Image from "next/image";

export const BentoGrid = ({
className,
children,
}: {
className?: string;
children?: React.ReactNode;
}) => {
export const BentoGrid = ({ className, children }: { className?: string; children?: React.ReactNode }) => {
return (
<div
className={cn(
// change gap-4 to gap-8, change grid-cols-3 to grid-cols-5, remove md:auto-rows-[18rem], add responsive code
"grid grid-cols-1 md:grid-cols-6 lg:grid-cols-5 md:grid-row-7 gap-4 lg:gap-8 mx-auto",
className
className,
)}
>
{children}
Expand Down Expand Up @@ -77,14 +71,13 @@ export const BentoGridItem = ({
className={cn(
// remove p-4 rounded-3xl dark:bg-black dark:border-white/[0.2] bg-white border border-transparent, add border border-white/[0.1] overflow-hidden relative
"row-span-1 relative overflow-hidden rounded-3xl border border-white/[0.1] group/bento hover:shadow-xl transition duration-200 shadow-input dark:shadow-none justify-between flex flex-col space-y-4",
className
className,
)}
style={{
// add these two
// you can generate the color from here https://cssgradient.io/
background: "rgb(4,7,29)",
backgroundColor:
"linear-gradient(90deg, rgba(4,7,29,1) 0%, rgba(12,14,35,1) 100%)",
backgroundColor: "linear-gradient(90deg, rgba(4,7,29,1) 0%, rgba(12,14,35,1) 100%)",
}}
>
{/* add img divs */}
Expand All @@ -100,11 +93,7 @@ export const BentoGridItem = ({
/>
)}
</div>
<div
className={`absolute right-0 -bottom-5 ${
id === 5 && "w-full opacity-80"
} `}
>
<div className={`absolute right-0 -bottom-5 ${id === 5 && "w-full opacity-80"} `}>
{spareImg && (
<Image
src={spareImg}
Expand All @@ -125,7 +114,7 @@ export const BentoGridItem = ({
<div
className={cn(
titleClassName,
"group-hover/bento:translate-x-2 transition duration-200 relative md:h-full min-h-40 flex flex-col px-5 p-5 lg:p-10"
"group-hover/bento:translate-x-2 transition duration-200 relative md:h-full min-h-40 flex flex-col px-5 p-5 lg:p-10",
)}
>
{/* change the order of the title and des, font-extralight, remove text-xs text-neutral-600 dark:text-neutral-300 , change the text-color */}
Expand All @@ -134,11 +123,7 @@ export const BentoGridItem = ({
</div>
{/* add text-3xl max-w-96 , remove text-neutral-600 dark:text-neutral-300*/}
{/* remove mb-2 mt-2 */}
<div
className={`font-sans text-lg lg:text-3xl max-w-96 font-bold z-10`}
>
{title}
</div>
<div className={`font-sans text-lg lg:text-3xl max-w-96 font-bold z-10`}>{title}</div>

{/* for the github 3d globe */}
{id === 2 && <GridGlobe />}
Expand Down Expand Up @@ -179,13 +164,10 @@ export const BentoGridItem = ({
{/* add rounded-md h-8 md:h-8, remove rounded-full */}
{/* remove focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 focus:ring-offset-slate-50 */}
{/* add handleCopy() for the copy the text */}
<div
className={`absolute -bottom-5 right-0 ${
copied ? "block" : "block"
}`}
>
<div className={`absolute -bottom-5 right-0 ${copied ? "block" : "block"}`}>

{/* <img src="/confetti.gif" alt="confetti" /> */}
<Lottie options={defaultOptions} height={200} width={400} />
{/* <Lottie options={defaultOptions} height={200} width={400} /> */}
</div>

<MagicButton
Expand Down
Loading