1+ import React , { useState } from 'react' ;
2+ import { Highlighter } from "@/components/ui/highlighter" ;
3+ import project1Img from '../assets/projects/project1.png' ;
4+ import project2Img from '../assets/projects/project2.png' ;
5+ import project5Img from '../assets/projects/project5.png' ;
6+ import project6Img from '../assets/projects/project6.png' ;
7+ import project7Img from '../assets/projects/project7.png' ;
8+ import project8Img from '../assets/projects/project8.png' ;
9+ import project9Img from '../assets/projects/project9.png' ;
10+
11+ // Use the same data structure as Projects.jsx, including videoUrl
12+ const projectData = [
13+ {
14+ title : 'Sahityaa Sangamm' ,
15+ description : 'A modern e-commerce platform built with Blade and Laravel.' ,
16+ videoUrl : 'https://res.cloudinary.com/dktapziq9/video/upload/v1764394626/1764393871242766_dqfnqn.mp4' ,
17+ imageUrl : project1Img ,
18+ liveUrl : 'https://sahityaasangamm.in' ,
19+ repoUrl : '#' ,
20+ tags : [ 'Blade' , 'Laravel' , 'MySQL' ] ,
21+ } ,
22+ {
23+ title : 'Portfolio Website' ,
24+ description : 'My personal portfolio website built with React and Tailwind CSS.' ,
25+ videoUrl : 'https://res.cloudinary.com/dktapziq9/video/upload/v1764395075/1764395026924189_ij9257.mov' ,
26+ imageUrl : project7Img ,
27+ liveUrl : 'https://ashifelahi.netlify.app' ,
28+ repoUrl : 'https://github.com/Deadcoder001/React-Personal-Portfolio.git' ,
29+ tags : [ 'React' , 'Tailwind CSS' , 'GSAP' , 'Spline' , 'Framer Motion' , 'Lenis' ] ,
30+ } ,
31+ {
32+ title : 'ONS Trading Application' ,
33+ description : 'A real-time trading application using Django and Bootstrap 5.' ,
34+ videoUrl : 'https://res.cloudinary.com/dktapziq9/video/upload/v1764395357/1764395325884939_lrg7f4.mp4' ,
35+ imageUrl : project5Img ,
36+ liveUrl : 'https://ons-trading.onrender.com' ,
37+ repoUrl : 'https://github.com/Deadcoder001/ons_trading.git' ,
38+ tags : [ 'Django' , 'yfinance' , 'Bootstrap 5' ] ,
39+ } ,
40+ {
41+ title : 'Jana Kalyan Swastha sewa' ,
42+ description : 'A Healthcare website built with HTML and php.' ,
43+ imageUrl : project6Img ,
44+ liveUrl : 'https://jkssewa.org' ,
45+ repoUrl : '#' ,
46+ tags : [ 'HTML' , 'CSS' , 'JavaScript' , 'PHP' , 'MySQL' ] ,
47+ } ,
48+ {
49+ title : 'Janaewa' ,
50+ description : 'A NGO website built with HTML, CSS and JavaScript.' ,
51+ imageUrl : project8Img ,
52+ liveUrl : 'https://janasewa.org' ,
53+ repoUrl : '#' ,
54+ tags : [ 'HTML' , 'CSS' , 'JavaScript' ] ,
55+ } ,
56+ {
57+ title : 'Earmacs' ,
58+ description : 'A Hotel Management website built with Wordpress and PHP.' ,
59+ imageUrl : project9Img ,
60+ liveUrl : 'https://earmacs.com' ,
61+ repoUrl : '#' ,
62+ tags : [ 'Wordpress' , 'PHP' ] ,
63+ } ,
64+ ] ;
65+
66+ export default function ProjectsMobile ( ) {
67+ const [ showAll , setShowAll ] = useState ( false ) ;
68+ const displayedProjects = showAll ? projectData : projectData . slice ( 0 , 3 ) ;
69+
70+ return (
71+ < section id = "projects-mobile" className = "w-full bg-white text-black py-12 px-2" >
72+ < div className = "text-center mb-8" >
73+ < h2 className = "text-3xl font-bold font-pixel underline-wavy-yellow inline-block" >
74+ < Highlighter action = "underline" color = "#FFD700" >
75+ Projects 🚀
76+ </ Highlighter >
77+ </ h2 >
78+ </ div >
79+ < div className = "flex flex-col gap-6 max-w-md mx-auto" >
80+ { displayedProjects . map ( ( project , idx ) => (
81+ < div key = { idx } className = "bg-white rounded-xl shadow p-4 flex flex-col" >
82+ < div className = "w-full h-40 rounded-lg overflow-hidden mb-3 bg-gray-100" >
83+ { project . videoUrl ? (
84+ < video
85+ src = { project . videoUrl }
86+ autoPlay
87+ loop
88+ muted
89+ playsInline
90+ className = "w-full h-full object-cover"
91+ poster = { project . imageUrl }
92+ />
93+ ) : (
94+ < img
95+ src = { project . imageUrl }
96+ alt = { project . title }
97+ className = "w-full h-full object-cover"
98+ />
99+ ) }
100+ </ div >
101+ < h3 className = "text-lg font-bold mb-1" > { project . title } </ h3 >
102+ < p className = "text-xs text-gray-600 mb-2" > { project . description } </ p >
103+ < div className = "flex flex-wrap gap-1 mb-2" >
104+ { project . tags && project . tags . map ( ( tag ) => (
105+ < span
106+ key = { tag }
107+ className = "bg-gray-200 text-gray-800 text-[10px] font-semibold px-2 py-0.5 rounded-full"
108+ >
109+ { tag }
110+ </ span >
111+ ) ) }
112+ </ div >
113+ < div className = "flex gap-3 mt-auto" >
114+ < a
115+ href = { project . liveUrl }
116+ target = "_blank"
117+ rel = "noopener noreferrer"
118+ className = "btn !w-auto !h-auto !px-4 !py-2 !text-xs !rounded-lg"
119+ >
120+ Visit Site
121+ </ a >
122+ { project . repoUrl && project . repoUrl !== '#' && (
123+ < a
124+ href = { project . repoUrl }
125+ target = "_blank"
126+ rel = "noopener noreferrer"
127+ className = "btn !w-auto !h-auto !px-4 !py-2 !text-xs !rounded-lg bg-gray-200 text-gray-800 hover:bg-gray-300"
128+ >
129+ View Code
130+ </ a >
131+ ) }
132+ </ div >
133+ </ div >
134+ ) ) }
135+ </ div >
136+ { /* View More / View Less Button */ }
137+ < div className = "text-center mt-8" >
138+ { ! showAll && projectData . length > 3 && (
139+ < button
140+ onClick = { ( ) => setShowAll ( true ) }
141+ className = "btn"
142+ >
143+ View More
144+ </ button >
145+ ) }
146+ { showAll && (
147+ < button
148+ onClick = { ( ) => setShowAll ( false ) }
149+ className = "btn"
150+ >
151+ View Less
152+ </ button >
153+ ) }
154+ </ div >
155+ </ section >
156+ ) ;
157+ }
0 commit comments