Skip to content

Commit

Permalink
Merge pull request #16 from upayanmazumder/PWA
Browse files Browse the repository at this point in the history
Pwa
  • Loading branch information
upayanmazumder authored Dec 15, 2024
2 parents c01947e + e9786de commit 9a37690
Show file tree
Hide file tree
Showing 18 changed files with 11,843 additions and 9,662 deletions.
Binary file added app/public/icons/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/icon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/icon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/icons/icon-64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions app/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "Upayan",
"short_name": "Upayan",
"description": "Upayan's portfolio site",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#4f80b6",
"icons": [
{
"src": "/icons/icon-16x16.png",
"sizes": "16x16",
"type": "image/png"
},
{
"src": "/icons/icon-32x32.png",
"sizes": "32x32",
"type": "image/png"
},
{
"src": "/icons/icon-64x64.png",
"sizes": "64x64",
"type": "image/png"
},
{
"src": "/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "/icons/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
12 changes: 12 additions & 0 deletions app/public/service-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
self.addEventListener('install', (event) => {
console.log('Service Worker installing.');
});

self.addEventListener('activate', (event) => {
console.log('Service Worker activating.');
});

self.addEventListener('fetch', (event) => {
console.log('Fetching:', event.request.url);
event.respondWith(fetch(event.request));
});
21,067 changes: 11,432 additions & 9,635 deletions app/public/upayan.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions app/src/app/RootLayoutClient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"use client"

import { Analytics } from "@vercel/analytics/react"
import React from "react";
import Header from "../components/header/header";
import Navbar from "../components/navbar/navbar";
import Footer from "../components/footer/footer";
import "./globals.css";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});

import localFont from "next/font/local";


export default function RootLayoutClient({ children }) {

return (
<html lang="en">
<head>
<link rel="manifest" href="/manifest.json" />
</head>
<body className={`${geistSans.variable} ${geistMono.variable}`}>
<Header />
<Navbar />
{children}
<Analytics />
<Footer />
</body>
</html>
);
}
Binary file modified app/src/app/favicon.ico
Binary file not shown.
29 changes: 5 additions & 24 deletions app/src/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
import localFont from "next/font/local";
import "./globals.css";
import { Analytics } from "@vercel/analytics/react"
import Header from "../components/header/header";
import Navbar from "../components/navbar/navbar";
import Footer from "../components/footer/footer";

const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});
import RootLayoutClient from "./RootLayoutClient";

import React from "react";
export const metadata = {
title: "Upayan",
description: "Explore my page",
};

export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable}`}>
<Header />
<Navbar />
{children}
<Analytics />
<Footer />
<html lang="en" suppressHydrationWarning>
<body>
<RootLayoutClient>{children}</RootLayoutClient>
</body>
</html>
);
Expand Down
4 changes: 3 additions & 1 deletion app/src/app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import SocialMediaWork from "../components/social-media/work/work";
import Activity from "../components/activity/activity";
import Carousel from "../components/carousel/carousel";
import Details from "../components/details/details";
import Projects from "../components/projects/projects";

export default function Home() {
return (
Expand All @@ -14,8 +15,9 @@ export default function Home() {
<SocialMediaWork />
<Activity />
<Carousel />
<Projects />
<Details />
</main>
</div>
);
}
}
130 changes: 130 additions & 0 deletions app/src/components/projects/projects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import React, { useState } from 'react';
import styles from './projects.module.css';
import projects from '../../shared/projects.json';

const ProjectsDisplay = () => {
return (
<section className={styles.container}>
<header>
<h3 className={styles.heading}>My Projects</h3>
</header>
<div className={styles.projectsWrapper}>
{projects.map((project, index) => (
<ProjectCard key={index} project={project} />
))}
</div>
</section>
);
};

const ProjectCard = ({ project }) => {
const [showLinks, setShowLinks] = useState(false);
const [showPackages, setShowPackages] = useState(false);

return (
<article className={styles.projectCard}>
{/* Project Icon */}
{project.icon && (
<figure className={styles.iconWrapper}>
<img
src={project.icon}
alt={`${project.name} icon`}
className={styles.icon}
/>
</figure>
)}

{/* Project Name */}
<h2 className={styles.projectName}>{project.name}</h2>

{/* Project Description */}
{project.description && (
<p className={styles.description}>{project.description}</p>
)}

{/* Links Section */}
<div className={styles.linksSection}>
<button
onClick={() => setShowLinks(!showLinks)}
className={styles.dropdownButton}
>
{showLinks ? 'Hide Links' : 'Show Links'}
</button>

{showLinks && (
<div className={styles.linksWrapper}>
{project.github && (
<p>
<a
href={project.github}
target="_blank"
rel="noopener noreferrer"
className={styles.link}
>
GitHub Repository
</a>
</p>
)}
{project.deploymentUrl && (
<p>
<a
href={project.deploymentUrl}
target="_blank"
rel="noopener noreferrer"
className={styles.link}
>
Deployed Application
</a>
</p>
)}
{project.apiUrl && (
<p>
<a
href={project.apiUrl}
target="_blank"
rel="noopener noreferrer"
className={styles.link}
>
API Documentation
</a>
</p>
)}
</div>
)}
</div>

{/* Package Links */}
{project.packageLinks && project.packageLinks.length > 0 && (
<div className={styles.packagesSection}>
<button
onClick={() => setShowPackages(!showPackages)}
className={styles.dropdownButton}
>
{showPackages ? 'Hide Packages' : 'Show Packages'}
</button>

{showPackages && (
<section>
<ul className={styles.packageList}>
{project.packageLinks.map((link, idx) => (
<li key={idx}>
<a
href={link}
target="_blank"
rel="noopener noreferrer"
className={styles.link}
>
{link}
</a>
</li>
))}
</ul>
</section>
)}
</div>
)}
</article>
);
};

export default ProjectsDisplay;
Loading

0 comments on commit 9a37690

Please sign in to comment.