From 948fa044f5ac57eca1df07d16dfd55350d9f9737 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Sat, 15 Nov 2025 13:44:29 +0530 Subject: [PATCH 1/4] Improve CSS media queries --- src/components/ourProjects.mobile.css | 99 +++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 13 deletions(-) diff --git a/src/components/ourProjects.mobile.css b/src/components/ourProjects.mobile.css index f4d5a30d..60171e69 100644 --- a/src/components/ourProjects.mobile.css +++ b/src/components/ourProjects.mobile.css @@ -1,19 +1,23 @@ -/* THIS CSS IS ONLY FOR " OUR PROJECT " as the width available for embeded page is extremly small */ +/* THIS CSS IS ONLY FOR " OUR PROJECT " as the width available for embeded page is extremely small */ /* Responsive overrides for embedded preview on small screens */ -/* For widths below 768px: give the card extra height and reduce chrome */ +/* Base mobile styles - for all mobile devices */ @media (max-width: 767px) { .ourprojects-embed-container { - min-height: 82vh !important; + min-height: 400px !important; + padding: 0.5rem !important; } + .ourprojects-embed-card { - height: 82vh !important; - border-radius: 1.25rem !important; /* smaller radius to fit */ + min-height: 380px !important; + border-radius: 0.5rem !important; } + .ourprojects-iframe { - height: 220% !important; /* more scrollable viewport */ + height: 220% !important; } + /* Improve readability on dark previews */ .ourprojects-overlay { background: linear-gradient( @@ -23,40 +27,85 @@ transparent ) !important; } + + /* Show indicator but make it smaller on mobile */ .ourprojects-live-indicator { - display: none !important; /* avoid overlapping text, see red arrow in screenshot */ + font-size: 0.5625rem !important; + padding: 0.25rem 0.5rem !important; + right: 0.5rem !important; + bottom: 0.5rem !important; + } +} + +/* Small mobile devices (480px and below) */ +@media (max-width: 480px) { + .ourprojects-embed-container { + min-height: 350px !important; + padding: 0.5rem !important; + } + + .ourprojects-embed-card { + min-height: 330px !important; + border-radius: 0.5rem !important; + } + + .ourprojects-iframe { + height: 230% !important; } } /* For ultra small widths below 360px (covers 320px phones) */ @media (max-width: 360px) { .ourprojects-embed-container { - min-height: 88vh !important; + min-height: 320px !important; + padding: 0.375rem !important; } + .ourprojects-embed-card { - height: 88vh !important; + min-height: 300px !important; + border-radius: 0.5rem !important; } + .ourprojects-iframe { height: 250% !important; } + .ourprojects-live-indicator { - display: none !important; + font-size: 0.5rem !important; + padding: 0.25rem 0.375rem !important; } } /* Safety for <320px specifically if needed */ @media (max-width: 320px) { .ourprojects-embed-container { - min-height: 92vh !important; + min-height: 300px !important; + padding: 0.375rem !important; } + .ourprojects-embed-card { - height: 92vh !important; + min-height: 280px !important; + border-radius: 0.5rem !important; } + .ourprojects-iframe { height: 280% !important; } + .ourprojects-live-indicator { - display: none !important; + font-size: 0.5rem !important; + padding: 0.25rem !important; + } +} + +/* Tablet adjustments (768px - 1024px) */ +@media (min-width: 768px) and (max-width: 1024px) { + .ourprojects-embed-container { + min-height: 500px !important; + } + + .ourprojects-embed-card { + min-height: 480px !important; } } @@ -65,3 +114,27 @@ .ourprojects-embed-card .text-shadow-soft { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); } + +/* Improve touch targets on mobile */ +@media (max-width: 767px) { + .ourprojects-embed-card { + -webkit-tap-highlight-color: transparent; + } +} + +/* Smooth scrolling for project list on mobile */ +@media (max-width: 767px) { + .no-scrollbar { + -webkit-overflow-scrolling: touch; + scroll-behavior: smooth; + } + + .no-scrollbar::-webkit-scrollbar { + display: none; + } + + .no-scrollbar { + -ms-overflow-style: none; + scrollbar-width: none; + } +} From 15694db4d692bd3231726d70aa9fc487f16494e8 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Sat, 15 Nov 2025 13:45:18 +0530 Subject: [PATCH 2/4] Refactored the component and fixed depreceated API --- src/components/ourProjects.tsx | 382 ++++++++++++++------------------- 1 file changed, 167 insertions(+), 215 deletions(-) diff --git a/src/components/ourProjects.tsx b/src/components/ourProjects.tsx index a52e79fa..cbd1e686 100644 --- a/src/components/ourProjects.tsx +++ b/src/components/ourProjects.tsx @@ -1,20 +1,12 @@ -"use client"; - import { ChevronRight } from "lucide-react"; import { useState } from "react"; import { motion } from "framer-motion"; import React from "react"; import { useSafeColorMode } from "../utils/useSafeColorMode"; -// Mobile-specific overrides for very small screens (<768px and <320px) import "./ourProjects.mobile.css"; -// Import projects data and types -import projectsData from "../data/projects.json"; -import type { ProjectsData, ProjectItem } from "../data/types"; +// Now uses TS config, not legacy/deprecated APIs. +import projectsData from "../database/projects/projects"; -/** - * Legacy interface for backward compatibility - * @deprecated Use ProjectsData from types.ts instead - */ export interface OurProjectsData { tag: string; title: string; @@ -25,76 +17,41 @@ export interface OurProjectsData { }[]; } -/** - * Legacy props interface for backward compatibility - * @deprecated Component now imports data directly - */ -export interface OurProjectsProps { - OurProjectsData?: OurProjectsData; -} - -/** - * OurProjects Component - * - * Displays a showcase of RecodeHive projects with interactive previews. - * Now uses data-driven approach with JSON configuration for better maintainability. - * - * Features: - * - Dynamic project loading from JSON - * - Live website previews for supported projects - * - Responsive design with mobile optimizations - * - Dark/light theme support - * - Interactive hover effects and animations - * - * @param props - Optional props for backward compatibility - */ -const OurProjects: React.FC = ({ - OurProjectsData: legacyData, -}) => { - const { colorMode, isDark } = useSafeColorMode(); +const PROJECT_URLS: Record = { + "Awesome GitHub Profile": + "https://recodehive.github.io/awesome-github-profiles/", + "Machine Learning Repository": "https://machine-learning-repos.vercel.app/", +}; - // Use JSON data by default, fallback to legacy props for backward compatibility - // Convert legacy data to new format if needed - let data: ProjectsData; +const getWebsiteUrl = (title: string) => { + return PROJECT_URLS[title] || "https://github.com/recodehive"; +}; - if (legacyData) { - // Convert legacy format to new format - data = { - tag: legacyData.tag, - title: legacyData.title, - description: legacyData.description, - items: legacyData.items.map((item, index) => ({ - id: index + 1, - title: item.title, - description: `Learn more about ${item.title}`, - image: item.image, - projectUrl: getWebsiteUrl(item.title), - githubUrl: getWebsiteUrl(item.title), - tags: [], - })), - }; - } else { - data = projectsData as ProjectsData; - } +const OurProjects: React.FC = () => { + const { isDark } = useSafeColorMode(); + const data: OurProjectsData = projectsData; return ( -
- - -
+
+ +
+
+ +
+ ); }; -// Heading Component const HeadingComponent = ({ tag, title, @@ -105,116 +62,103 @@ const HeadingComponent = ({ title: string; description: string; isDark: boolean; -}) => { - return ( -
- ( +
+ + + (window.location.href = "https://github.com/recodehive") + } + aria-label="Visit RecodeHive GitHub" > -
- (window.location.href = "https://github.com/recodehive") - } - > - {tag} -
-
+

- {title} -

-
- - - {description} - -
- ); -}; - -// Project URLs configuration -const PROJECT_URLS: Record = { - "Awesome GitHub Profile": - "https://recodehive.github.io/awesome-github-profiles/", - "Machine Learning Repository": "https://machine-learning-repos.vercel.app/", -}; + {title} + +
-// Helper function to get website URLs -const getWebsiteUrl = (title: string) => { - return PROJECT_URLS[title] || "https://github.com/recodehive"; -}; + +

{description}

+
+
+); -// Select Component const SelectComponent = ({ items, isDark, }: { - items: ProjectItem[]; + items: { title: string; image: string }[]; isDark: boolean; }) => { const [activeItem, setActiveItem] = useState(0); - const [isHovered, setIsHovered] = useState(false); + // For demo, if more fields are needed in OurProjectsData, adapt. return (
{items.map((item, index) => ( - setActiveItem(index)} - className={`relative w-40 cursor-pointer rounded-2xl p-2 transition-all duration-300 ease-in-out md:w-4/5 md:rounded-r-full md:p-6 ${ - activeItem === index - ? "bg-gradient-to-r from-blue-600 to-purple-600 text-white" - : isDark - ? "bg-gray-800 text-white hover:bg-gray-700" - : "bg-gray-200 text-black hover:bg-gray-300" - }`} + className={`relative flex min-w-[140px] shrink-0 touch-manipulation select-none rounded-lg p-3 text-left transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 sm:min-w-[160px] sm:p-3.5 md:min-w-0 md:w-full md:rounded-r-full md:p-4 lg:p-5 ${activeItem === index + ? "bg-gradient-to-r from-blue-600 to-purple-600 text-white shadow-lg" + : isDark + ? "bg-gray-800 text-white hover:bg-gray-700" + : "bg-gray-200 text-black hover:bg-gray-300" + }`} + aria-pressed={activeItem === index} + aria-label={`Select ${item.title} project`} > -
+ {item.title} -
-
+
-
+ + + ))}
-
+
{/* Animated Mesh Background */} -
+
- + - 🚀 + 🚀 {/* Holographic Main Browser */} @@ -288,68 +232,69 @@ const SelectComponent = ({ className="perspective-1000 relative z-10" >
{/* Holographic Border Effect */}
{/* Premium Browser Header */}
-
+
🔒 - github.com - / - recodehive - / + + github.com + + / + + recodehive + + / {items[activeItem].title.toLowerCase().replace(/\s+/g, "-")} @@ -358,22 +303,21 @@ const SelectComponent = ({ LIVE
- {/* Ultra-Enhanced Screenshot Display */} + {/* Screenshot or Live Site */}
{items[activeItem].title === "Awesome GitHub Profile" || - items[activeItem].title === "Machine Learning Repository" ? ( - /* Auto-scrolling Website Iframe */ + items[activeItem].title === "Machine Learning Repository" ? ( window.open( getWebsiteUrl(items[activeItem].title), - "_blank", + "_blank" ) } > @@ -398,7 +341,7 @@ const SelectComponent = ({ src={ PROJECT_URLS[items[activeItem].title] || "about:blank" } - className="ourprojects-iframe pointer-events-none h-[220%] w-full origin-top border-0 sm:h-[200%]" + className="ourprojects-iframe pointer-events-none h-[220%] w-full origin-top border-0 sm:h-[210%] md:h-[200%]" initial={{ opacity: 0, y: 0 }} animate={{ opacity: 1, @@ -406,20 +349,25 @@ const SelectComponent = ({ }} transition={{ opacity: { duration: 0.8 }, - y: { duration: 8, repeat: Infinity, ease: "easeInOut" }, + y: { + duration: 8, + repeat: Infinity, + ease: "easeInOut", + }, }} sandbox="allow-scripts allow-popups allow-forms" + title={`Preview of ${items[activeItem].title}`} + loading="lazy" /> ) : ( - /* Interactive Screenshot for other projects */ window.open( getWebsiteUrl(items[activeItem].title), - "_blank", + "_blank" ) } > @@ -433,7 +381,6 @@ const SelectComponent = ({ transition={{ duration: 2, ease: "easeInOut" }} /> - {/* Click to Visit Overlay */}
{items[activeItem].title === "Awesome GitHub Profile" || - items[activeItem].title === "Machine Learning Repository" ? ( + items[activeItem].title === "Machine Learning Repository" ? ( <> -
- Auto-scrolling Live Site +
+ + Auto-scrolling Live Site + + Live ) : ( - "👆 Hover & Click to Explore" + <> + + 👆 Hover & Click to Explore + + 👆 Tap + )}
@@ -515,7 +469,7 @@ const SelectComponent = ({ return (
From acafb041e8cf93f9f33c044d78331afd6a7553e6 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Sat, 15 Nov 2025 13:45:53 +0530 Subject: [PATCH 3/4] Review completed --- package-lock.json | 50 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf9df4f0..89fbbbad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -280,6 +280,7 @@ "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.40.0.tgz", "integrity": "sha512-nlr/MMgoLNUHcfWC5Ns2ENrzKx9x51orPc6wJ8Ignv1DsrUmKm0LUih+Tj3J+kxYofzqQIQRU495d4xn3ozMbg==", "license": "MIT", + "peer": true, "dependencies": { "@algolia/client-common": "5.40.0", "@algolia/requester-browser-xhr": "5.40.0", @@ -440,6 +441,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.4.tgz", "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -2274,6 +2276,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=18" }, @@ -2296,6 +2299,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -2405,6 +2409,7 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", + "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -2826,6 +2831,7 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", + "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -3813,6 +3819,7 @@ "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.9.2.tgz", "integrity": "sha512-C5wZsGuKTY8jEYsqdxhhFOe1ZDjH0uIYJ9T/jebHwkyxqnr4wW0jTkB72OMqNjsoQRcb0JN3PcSeTwFlVgzCZg==", "license": "MIT", + "peer": true, "dependencies": { "@docusaurus/core": "3.9.2", "@docusaurus/logger": "3.9.2", @@ -5921,6 +5928,7 @@ "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", "integrity": "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==", "license": "MIT", + "peer": true, "dependencies": { "@emotion/memoize": "^0.8.1" } @@ -6193,6 +6201,7 @@ "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.9.13.tgz", "integrity": "sha512-GfiI1JxJ7ecluEmDjPzseRXk/PX31hS7+tjgBopL7XjB2hLUdR+0FTMXy2Q3/hXezypDvU6or7gVFizDESrkXw==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@firebase/component": "0.6.4", "@firebase/logger": "0.4.0", @@ -6250,6 +6259,7 @@ "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.13.tgz", "integrity": "sha512-j6ANZaWjeVy5zg6X7uiqh6lM6o3n3LD1+/SJFNs9V781xyryyZWXe+tmnWNWPkP086QfJoNkWN9pMQRqSG4vMg==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@firebase/app": "0.9.13", "@firebase/component": "0.6.4", @@ -6262,7 +6272,8 @@ "version": "0.9.0", "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.0.tgz", "integrity": "sha512-AeweANOIo0Mb8GiYm3xhTEBVCmPwTYAu9Hcd2qSkLuga/6+j9b1Jskl5bpiSQWy9eJ/j5pavxj6eYogmnuzm+Q==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/@firebase/auth": { "version": "0.23.2", @@ -6672,6 +6683,7 @@ "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.3.tgz", "integrity": "sha512-DY02CRhOZwpzO36fHpuVysz6JZrscPiBXD0fXp6qSrL9oNOx5KWICKdR95C0lSITzxp0TZosVyHqzatE8JbcjA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -7288,6 +7300,7 @@ "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.1.tgz", "integrity": "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw==", "license": "MIT", + "peer": true, "dependencies": { "@types/mdx": "^2.0.0" }, @@ -7950,6 +7963,7 @@ "resolved": "https://registry.npmjs.org/@svgr/core/-/core-8.1.0.tgz", "integrity": "sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.21.3", "@svgr/babel-preset": "8.1.0", @@ -8466,7 +8480,8 @@ } ], "hasInstallScript": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@tsparticles/interaction-external-attract": { "version": "3.9.1", @@ -9419,6 +9434,7 @@ "integrity": "sha512-/EEvYBdT3BflCWvTMO7YkYBHVE9Ci6XdqZciZANQgKpaiDRGOLIlRo91jbTNRQjgPFWVaRxcYc0luVNFitz57A==", "devOptional": true, "license": "MIT", + "peer": true, "peerDependencies": { "@types/react": "^19.2.0" } @@ -9596,6 +9612,7 @@ "integrity": "sha512-BnOroVl1SgrPLywqxyqdJ4l3S2MsKVLDVxZvjI1Eoe8ev2r3kGDo+PcMihNmDE+6/KjkTubSJnmqGZZjQSBq/g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.46.2", "@typescript-eslint/types": "8.46.2", @@ -10054,6 +10071,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -10139,6 +10157,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -10184,6 +10203,7 @@ "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.40.0.tgz", "integrity": "sha512-a9aIL2E3Z7uYUPMCmjMFFd5MWhn+ccTubEvnMy7rOTZCB62dXBJtz0R5BZ/TPuX3R9ocBsgWuAbGWQ+Ph4Fmlg==", "license": "MIT", + "peer": true, "dependencies": { "@algolia/abtesting": "1.6.0", "@algolia/client-abtesting": "5.40.0", @@ -10942,6 +10962,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.9", "caniuse-lite": "^1.0.30001746", @@ -11296,6 +11317,7 @@ "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.0.3.tgz", "integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@chevrotain/cst-dts-gen": "11.0.3", "@chevrotain/gast": "11.0.3", @@ -12186,6 +12208,7 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", + "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -12516,6 +12539,7 @@ "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.33.1.tgz", "integrity": "sha512-iJc4TwyANnOGR1OmWhsS9ayRS3s+XQ185FmuHObThD+5AeJCakAAbWv8KimMTt08xCCLNgneQwFp+JRJOr9qGQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10" } @@ -12937,6 +12961,7 @@ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -13530,7 +13555,8 @@ "version": "8.6.0", "resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz", "integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/embla-carousel-autoplay": { "version": "8.6.0", @@ -13916,6 +13942,7 @@ "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -14748,6 +14775,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -14875,6 +14903,7 @@ "resolved": "https://registry.npmjs.org/firebase/-/firebase-9.23.0.tgz", "integrity": "sha512-/4lUVY0lUvBDIaeY1q6dUYhS8Sd18Qb9CgWkPZICUo9IXpJNCEagfNZXBBFCkMTTN5L5gx2Hjr27y21a9NzUcA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@firebase/analytics": "0.10.0", "@firebase/analytics-compat": "0.2.6", @@ -21081,6 +21110,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -21854,6 +21884,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -22757,6 +22788,7 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", + "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -23370,6 +23402,7 @@ "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -23776,6 +23809,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -23788,6 +23822,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -23853,6 +23888,7 @@ "resolved": "https://registry.npmjs.org/@docusaurus/react-loadable/-/react-loadable-6.0.0.tgz", "integrity": "sha512-YMMxTUQV/QFSnbgrP3tjDzLHRg7vsbMn8e9HAa8o/1iXoiomo48b7sk/kkmWEuWNDPJVlKSJRB6Y2fHqdJk+SQ==", "license": "MIT", + "peer": true, "dependencies": { "@types/react": "*" }, @@ -23881,6 +23917,7 @@ "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", "integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.12.13", "history": "^4.9.0", @@ -26376,7 +26413,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/tunnel-agent": { "version": "0.6.0", @@ -26551,6 +26589,7 @@ "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -26945,6 +26984,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -27217,6 +27257,7 @@ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.102.1.tgz", "integrity": "sha512-7h/weGm9d/ywQ6qzJ+Xy+r9n/3qgp/thalBbpOi5i223dPXKi04IBtqPN9nTd+jBc7QKfvDbaBnFipYp4sJAUQ==", "license": "MIT", + "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.8", @@ -28035,6 +28076,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.12.tgz", "integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } From 04614e05f65d77ec52112524c27ee63c38794e34 Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Mon, 17 Nov 2025 18:44:23 +0530 Subject: [PATCH 4/4] Enhance ourProjects component by adding new project links, implementing iframe support for live previews, and refining the UI with improved animations and styles. --- src/components/ourProjects.tsx | 423 +++++++++------------------------ 1 file changed, 112 insertions(+), 311 deletions(-) diff --git a/src/components/ourProjects.tsx b/src/components/ourProjects.tsx index cbd1e686..b96d9084 100644 --- a/src/components/ourProjects.tsx +++ b/src/components/ourProjects.tsx @@ -21,8 +21,17 @@ const PROJECT_URLS: Record = { "Awesome GitHub Profile": "https://recodehive.github.io/awesome-github-profiles/", "Machine Learning Repository": "https://machine-learning-repos.vercel.app/", + "Stack overflow Analysis": "https://github.com/recodehive/Stackoverflow-Analysis", + "Scrape ML Project": "https://github.com/recodehive/Scrape-ML-Project", + "Opensource Project": "https://github.com/recodehive/Opensource-practice", }; +// Projects that support live iframe preview (not GitHub repos due to X-Frame-Options) +const IFRAME_PROJECTS = [ + "Awesome GitHub Profile", + "Machine Learning Repository", +]; + const getWebsiteUrl = (title: string) => { return PROJECT_URLS[title] || "https://github.com/recodehive"; }; @@ -157,178 +166,103 @@ const SelectComponent = ({
- {/* Animated Mesh Background */} -
-
-
-
- - {/* Particle System */} -
- {[...Array(12)].map((_, i) => ( - - ))} -
- - {/* Advanced Floating Icons */} - - - - -
-
- - - - - - - 🚀 - - - {/* Holographic Main Browser */} + {/* Clean Preview Card */}
- {/* Holographic Border Effect */} -
- {/* Premium Browser Header */} + {/* Clean Browser Header */}
-
- -
-
- -
-
- +
+
+
+
+
+
-
- -
+ 🔒 + {(() => { + const url = getWebsiteUrl(items[activeItem].title); + const urlObj = new URL(url); + const pathParts = urlObj.pathname.split("/").filter(Boolean); -
-
- - 🔒 - - - github.com - - / - - recodehive - - / - - {items[activeItem].title.toLowerCase().replace(/\s+/g, "-")} - + if (urlObj.hostname.includes("github.com")) { + return ( + <> + + github.com + + / + + {pathParts[0] || "recodehive"} + + {pathParts[1] && ( + <> + / + + {pathParts[1]} + + + )} + + ); + } else { + return ( + <> + + {urlObj.hostname.replace("www.", "")} + + {pathParts.length > 0 && ( + <> + / + + {pathParts.join("/")} + + + )} + + ); + } + })()} +
- - - - LIVE - + {IFRAME_PROJECTS.includes(items[activeItem].title) && ( +
+
+ LIVE +
+ )}
- {/* Screenshot or Live Site */} -
- - {items[activeItem].title === "Awesome GitHub Profile" || - items[activeItem].title === "Machine Learning Repository" ? ( - +
+ {IFRAME_PROJECTS.includes(items[activeItem].title) ? ( +
window.open( getWebsiteUrl(items[activeItem].title), @@ -350,20 +284,22 @@ const SelectComponent = ({ transition={{ opacity: { duration: 0.8 }, y: { - duration: 8, + duration: 10, repeat: Infinity, ease: "easeInOut", }, }} - sandbox="allow-scripts allow-popups allow-forms" + sandbox="allow-scripts allow-popups allow-forms allow-same-origin allow-top-navigation-by-user-activation allow-presentation" + allow="fullscreen; autoplay; encrypted-media; picture-in-picture" title={`Preview of ${items[activeItem].title}`} loading="lazy" + referrerPolicy="no-referrer-when-downgrade" /> - +
+
) : ( - window.open( getWebsiteUrl(items[activeItem].title), @@ -372,162 +308,27 @@ const SelectComponent = ({ } > - -
- - 🔗 Click to Visit Repository - +
+
+
+ 🔗 Click to Visit Repository +
+
- +
)} - - {/* Dynamic Indicator */} - - {items[activeItem].title === "Awesome GitHub Profile" || - items[activeItem].title === "Machine Learning Repository" ? ( - <> -
- - Auto-scrolling Live Site - - Live - - ) : ( - <> - - 👆 Hover & Click to Explore - - 👆 Tap - - )} -
- - {/* Holographic Overlay */} -
-
-
-
+
- - {/* 3D Floating Background Mockups */} -
- {items.map((item, index) => { - if (index === activeItem) return null; - const positions = [ - { - top: "8%", - left: "2%", - rotate: "-15deg", - scale: "0.25", - z: "-50px", - }, - { - top: "65%", - left: "5%", - rotate: "12deg", - scale: "0.22", - z: "-30px", - }, - { - top: "15%", - right: "3%", - rotate: "18deg", - scale: "0.28", - z: "-40px", - }, - { - bottom: "12%", - right: "6%", - rotate: "-10deg", - scale: "0.20", - z: "-60px", - }, - ]; - const pos = positions[index % positions.length]; - - return ( - - -
-
-
-
-
-
-
-
- {item.title} -
-
-
-
- ); - })} -
);