Skip to content

Commit

Permalink
Merge pull request #2 from EnthusiastiCoder/main
Browse files Browse the repository at this point in the history
WOC FAQ and Timeline sections
  • Loading branch information
OindrilaDas27 authored Oct 4, 2024
2 parents 14fff78 + 3d437c9 commit 04aeef6
Show file tree
Hide file tree
Showing 54 changed files with 1,360 additions and 331 deletions.
Binary file modified app/favicon.ico
Binary file not shown.
25 changes: 25 additions & 0 deletions app/global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Function to set the font size based on the parent's width
function setFontSizeForTextScaleElements(): void {
// Select all elements whose class contains "text-scale"
const elements = document.querySelectorAll<HTMLElement>('[class*="text-scale"]');

// Iterate over each selected element
elements.forEach(element => {
// Get the parent element's width
const parentElement = element.parentElement;

// Ensure parentElement exists before proceeding
if (parentElement) {
const parentWidth = parentElement.clientWidth;

// Set the font size to 2 times the parent's width
element.style.fontSize = `${2 * parentWidth}px`;
}
});
}

// Set the initial font size for all matching elements
setFontSizeForTextScaleElements();

// Optionally, adjust the font size when the window is resized
window.addEventListener('resize', setFontSizeForTextScaleElements);
67 changes: 36 additions & 31 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,54 @@
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}

@layer base {
.border-outline-2 {
-webkit-text-stroke: 2px #E2AA06;
}
.border-outline {
-webkit-text-stroke: 0.5vw #609CFF;
}
}

.border-outline-1 {
-webkit-text-stroke: 1px #E2AA06;
}
.top-right-arrow {
border-left: 1.5vw solid transparent;
border-top: 1.5vw solid #609CFF;
}

.faq-b-r{
border-top-width:3px;
}
.faq-t-l{
border-bottom-width:3px;
}

hr {
border: 0;
height: 2px;
background-image: linear-gradient(to right, #ff7e5f, #feb47b, #ff7e5f);
}

.terminal-input:focus {
outline: none;
}

.terminal-input {
background-color: transparent;
color: transparent;
text-shadow: 0 0 0 #E2AA06;
}

/*
.terminal-inputlol {
-webkit-tap-highlight-color :black;
content: '_';
position: absolute;
color: #3b82f6; blue-500
animation: blink 1s step-end infinite;
}*/
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
34 changes: 18 additions & 16 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import type { Metadata } from "next";
import { Inter, Chakra_Petch } from "next/font/google";
import localfont from "next/font/local";
import "./globals.css";
import Navbar from "@/components/navbar";
import Register from "@/components/onboarding";
import Footer from "@/components/footer";
import AboutUs from "@/components/about";
import Structure from "@/components/structure";



export const metadata: Metadata = {
title: 'Winter of Code 4.0',
description: 'Loading...',
};

const inter = Inter({ subsets: ["latin"] });
const chakra = Chakra_Petch({
Expand All @@ -22,24 +25,23 @@ const kleemax = localfont({
variable: "--font-kleemax"
})

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
// export const metadata: Metadata = {
// title: "Create Next App",
// description: "Generated by create next app",
// };

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={`${kleemax.variable} ${chakra.variable}`}>
<Navbar/>
<Register/>
<AboutUs/>
{children}
<Footer/>
<html lang="en" className="bg-black">
<head>
<link rel="icon" href="/favicon.ico" sizes="any" />
</head>
<body className={`${kleemax.variable} ${chakra.variable} bg-black`}>
<Structure children={children}/>
</body>
</html>
);
Expand Down
24 changes: 13 additions & 11 deletions components/about.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
import Link from 'next/link';
import Image from 'next/image'
import asset1 from '../public/arrow.svg'
import asset2 from '../public/aboutus.svg'

const description = "Winter of Code is a 30-day open-source journey brought to you by GDG on campus IIIT Kalyani (formerly known as GDSC IIIT Kalyani) , in collaboration with Google Developer Groups on Campus. Modeled after Google Summer of Code (GSoC), this program offers an exciting opportunity for developers to dive into the world of open source, contribute to impactful projects, and collaborate with like-minded peers. Whether you're a seasoned coder or just starting out, Winter of Code 4.0 is your chance to enhance your skills, make meaningful contributions, and become part of the global open-source community."
const AboutUs = () => {
return (
<div className="bg-[#868686] bg-opacity-10 max-w-[1280px] m-10 xl:m-auto">
<section className='w-full p-4 pt-[10%] '>
<div className="bg-[#868686] bg-opacity-10 m-auto max-w-[90%] pb-[10%] relative">
<div className="w-full flex">
<div className='text-[#00FF84] bg-black w-fit rounded-br-xl border-[#868686] border-opacity-10 pr-4 text-4xl font-kleemax text-nowrap'>
<div className='text-[#00FF84] bg-black w-fit rounded-br-xl border-[#868686] border-opacity-10 pr-4 text-scale-40 font-kleemax text-nowrap'>
ABOUT US
</div>
<div className='w-full bg-black'>
<div className='h-full bg-[#868686] bg-opacity-10 rounded-tl-xl border-black'></div>
</div>
<div className='w-fit'>
<div className='max-w-[5%]'>
<Image src={asset1} alt="woc"/>
</div>
</div>
<div className="w-full flex p-5 rounded-2xl border-black">
Lorem ipsum dolor sit amet consectetur. Adipiscing commodo id vel id massa venenatis. Faucibus vitae nisi amet convallis commodo at consectetur suspendisse diam. Adipiscing est vel id quis tempor nisl eros dolor. Habitant curabitur leo ultrices vitae massa nullam. Convallis habitasse at in volutpat ullamcorper ornare vitae. Non justo egestas venenatis nunc sed metus. Cursus tellus consequat volutpat in facilisi sed tincidunt. Accumsan augue molestie vel integer imperdiet nec nulla.

Pellentesque tellus elementum auctor augue. Duis lobortis diam integer sit condimentum nulla cursus. Enim eget aliquam nibh lorem porttitor hac quisque massa. Integer varius sit imperdiet nam consectetur nulla eget. Quisque sed elit risus malesuada. Tortor velit libero tristique orci vitae morbi in consectetur. Nibh ligula maecenas arcu ornare urna gravida nec mi. Turpis mi ornare enim tempor risus tempus mi mi ullamcorper.
Eget mus ultricies nibh nec commodo interdum risus augue lacinia. Vitae arcu tincidunt vestibulum tristique sed sagittis nulla pellentesque quis. Massa nunc pellentesque ut ipsum nec. At est ullamcorper elementum bibendum amet. Phasellus et egestas fermentum in risus nulla.

Non cursus platea enim tellus. Interdum ornare pulvinar at tortor mus faucibus nulla tellus laoreet. Quam convallis interdum amet malesuada ante. Enim accumsan tellus pellentesque et viverra id in tincidunt in. Enim et parturient in feugiat a sollicitudin massa arcu vel.
<div className="w-full flex p-[5%] text-scale-20 text-grey">
{description}
<Image className="absolute w-[50%] -bottom-[22%] left-[25%] backdrop-blur" src={asset2} alt="woc" />
</div>

</div>
<hr className="flex max-w-full flex-grow bg-gradient-to-r from-black via-[#CCCCCC50] mt-[20%]"/>
</section>
);
};

Expand Down
62 changes: 62 additions & 0 deletions components/bordertext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from 'react';

const ParallelAnimatedTextBorderTrace = () => {
const text = Array.from("WINTEROFCODE");
const x = [0, 90, 180, 270, 360,450,0, 85, 195, 280, 365, 450];
return (
<div className="flex items-center mt-[5%] justify-center w-full sm:p-0 relative">
{false && <div className="absolute w-full h-fit top-[-19%] font-kleemax text-scale-260 text-center text-white">WOC</div>}
<svg className="z-20 w-[80%]" viewBox="0 0 570 170">
{text.map((letter,index)=>
<text
key={index}
x={x[index]+20}
y={index > 5? 160 : 70}
className="text-trace font-kleemax"
stroke="#609CFF"
fill="#151D2F"
strokeWidth="0.5%"
>
{letter}
</text>
)}
</svg>
</div>
);
};

const styles = `
@keyframes trace {
0% {
stroke-dashoffset: 0%;
}
100% {
stroke-dashoffset: 155%;
}
}
.text-trace {
font-size: 70px;
stroke-dasharray: 150%,5%;
stroke-linejoin: round;
animation: trace 8s linear 1;
}
/* Add a glow effect */
.text-trace {
filter: drop-shadow(0 0 0.5vw rgba(96, 156, 255, 1));
}
`;

const BorderText = () => {
return (
<>
<style>{styles}</style>
<ParallelAnimatedTextBorderTrace />
</>
);
};

export default BorderText;
89 changes: 89 additions & 0 deletions components/carousel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import React, { useState, useEffect } from 'react'
import Image from 'next/image'
import asset2 from '../public/triangle.svg'
import asset3 from '../public/triangle2.svg'

const Carousel = ({ images = [] }) => {
const [currentIndex, setCurrentIndex] = useState(0);
const [nextIndex, setNextIndex] = useState<number | null>(null);
const [direction, setDirection] = useState('');

useEffect(() => {
if (nextIndex !== null) {
const timer = setTimeout(() => {
setCurrentIndex(nextIndex);
setNextIndex(null);
}, 300); // Match this with the CSS transition duration
return () => clearTimeout(timer);
}
}, [nextIndex]);

if (!images || images.length === 0) {
return <div className="w-full h-[300px] bg-gray-200 flex items-center justify-center">No images available</div>;
}

const slide = (newIndex: number , newDirection: React.SetStateAction<string>) => {
setNextIndex(newIndex);
setDirection(newDirection);
};

const goToPrevious = () => {
const newIndex = currentIndex === 0 ? images.length - 1 : currentIndex - 1;
slide(newIndex, 'left');
};

const goToNext = () => {
const newIndex = currentIndex === images.length - 1 ? 0 : currentIndex + 1;
slide(newIndex, 'right');
};

const goToSlide = (index:number) => {
if (index === currentIndex) return;
slide(index, index > currentIndex ? 'right' : 'left');
};

return (
<div className="w-full max-w-3xl mx-auto">
<div className="relative w-full h-[300px] mb-4 overflow-hidden">
<div
className={`absolute w-full h-full transition-transform duration-300 ease-in-out ${
nextIndex !== null ? (direction === 'right' ? '-translate-x-full' : 'translate-x-full') : 'translate-x-0'
}`}
style={{ backgroundImage: `url(${images[currentIndex]})`, backgroundSize: 'cover', backgroundPosition: 'center' }}
/>
{nextIndex !== null && (
<div
className={`absolute w-full h-full transition-transform duration-300 ease-in-out ${
direction === 'right' ? 'translate-x-full' : '-translate-x-full'
}`}>
<Image src={images[currentIndex]} alt="slide" />
</div>
)}
<button
className="absolute top-1/2 -translate-y-1/2 left-2 z-10 text-2xl rounded-full p-2 bg-black/20 text-white cursor-pointer transition-opacity hover:bg-black/40"
onClick={goToPrevious}
>
<Image src={asset3} alt="left" />
</button>
<button
className="absolute top-1/2 -translate-y-1/2 right-2 z-10 text-2xl rounded-full p-2 bg-black/20 text-white cursor-pointer transition-opacity hover:bg-black/40"
onClick={goToNext}
>
<Image src={asset2} alt="right" />
</button>
</div>
<div className="flex justify-center space-x-2 overflow-x-auto">
{images.map((image, index) => (
<button
key={index}
className={`w-16 h-16 bg-center bg-cover cursor-pointer transition-all ${
index === currentIndex ? 'border-2 border-blue-500 scale-110' : 'opacity-70 hover:opacity-100'
}`}
onClick={() => goToSlide(index)}
/>
))}
</div>
</div>
);
};
export default Carousel;
Loading

0 comments on commit 04aeef6

Please sign in to comment.