Skip to content

Commit

Permalink
Merge pull request #1 from SayarB/master
Browse files Browse the repository at this point in the history
website with basic features
  • Loading branch information
anirudhgray authored Nov 8, 2023
2 parents c2207f5 + b36cc38 commit 995a86e
Show file tree
Hide file tree
Showing 181 changed files with 18,446 additions and 0 deletions.
10 changes: 10 additions & 0 deletions node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
35 changes: 35 additions & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
34 changes: 34 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
1 change: 1 addition & 0 deletions web/animations/loading_anim.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web/animations/loading_mobile.json

Large diffs are not rendered by default.

Binary file added web/app/NeueMachina-Regular.otf
Binary file not shown.
58 changes: 58 additions & 0 deletions web/app/api/blogs/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { NextResponse } from "next/server";

type UserSchema = {
userId: string;
name: string;
username: string;
};

type PostSchema = {
id: string;
creatorId: keyof UserSchema;
title: string;
createdAt: number;
updatedAt: number;
uniqueSlug: string;
};

export type ResponsePostSchema = PostSchema & {
user: UserSchema;
};

type MediumResponse = {
success: boolean;
payload: {
collection: any;
references: {
Collection: any;
User: Record<string, UserSchema>;
Post: Record<string, PostSchema>;
};
};
};

export async function GET(request: Request) {
const res = await fetch("https://medium.com/gdg-vit?format=json");
const text = await res.text();
const json = JSON.parse(text.substring(text.indexOf("{"))) as MediumResponse;
text.indexOf("{");

const posts = getPosts(json);
return NextResponse.json(posts);
}

const getPosts = (json: MediumResponse): ResponsePostSchema[] => {
const postsJson = json.payload.references.Post;
const arr: PostSchema[] = [];
Object.keys(postsJson).forEach((key) => {
if (postsJson[key]) {
arr.push(postsJson[key]);
}
});

arr.sort((a, b) => b.createdAt - a.createdAt);
const response: ResponsePostSchema[] = arr.map((ele) => {
return { ...ele, user: json.payload.references.User[ele.creatorId] };
});
return response.slice(0, 5);
};
Binary file added web/app/favicon.ico
Binary file not shown.
96 changes: 96 additions & 0 deletions web/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@200;300;400;500;600;700;800;900&display=swap");
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--font-unbounded: "Unbounded", sans-serif;
}

* {
box-sizing: border-box;
}

.horizontal-section,
.horizontal-section2 {
padding: 100px 0;
background-color: pink;
}

.sticky-wrapper,
.sticky-wrapper2 {
position: sticky;
top: 100px;
width: 100%;
overflow: hidden;
}

.element-wrapper,
.element-wrapper2 {
position: relative;
display: flex;
}

.element {
width: 500px;
height: 400px;
background-color: purple;
margin: 0 20px 0 0;
flex-shrink: 0;
}

.overlay {
/* height: 0%; */
width: 100%;
position: fixed;
z-index: 50;
top: 0;
left: 0;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.95);
overflow-y: hidden;
transition: 0.5s;
}

.overlay-content {
position: relative;
width: 100%;
}

.overlay a {
padding: 8px;
text-decoration: none;
font-size: 36px;
color: #818181;
display: block;
transition: 0.3s;
}

.overlay a:hover,
.overlay a:focus {
color: #f1f1f1;
}

.overlay .closebtn {
position: absolute;
top: 20px;
right: 45px;
font-size: 60px;
}
.team-tab-after::after {
content: "";
display: inline-block;
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid; /* You can change the color by specifying a different value here */
margin-left: 8px; /* Adjust the margin as needed for spacing */
}

/* write css to style the page scrollbar to be black background and high z index */
::-webkit-scrollbar {
width: 0px;
background-color: black;
z-index: 100;
}
63 changes: 63 additions & 0 deletions web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import Script from 'next/script';
import './globals.css';
import localFont from 'next/font/local';

const neue_machina = localFont({
src: '/NeueMachina-Regular.otf',
variable: '--font-neuemachina',
});

export const metadata = {
title: 'GDSC VIT',
description: 'Google Developers Students Club VIT',
openGraph: {
type: 'website',
locale: 'en_IE',
url: 'https://dscvit.com',
site_name: 'GDSC VIT',
images: [
{
url: 'https://dscvit.com/projects/default.png',
width: 1200,
height: 630,
alt: 'GDSC VIT',
},
],
},
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html
lang="en"
className={`${neue_machina.variable} text-[10px] md:text-[16px]`}
>
<head>
<Script id="gtag" strategy="afterInteractive">
{`
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-M4WQ5S5N');
`}
</Script>
</head>
<body className="overflow-hidden bg-dark">
<div
dangerouslySetInnerHTML={{
__html: `
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M4WQ5S5N"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
`,
}}
/>
{children}
</body>
</html>
);
}
Loading

0 comments on commit 995a86e

Please sign in to comment.