1
+ import React , { useRef , useEffect } from 'react' ;
2
+ import { Link } from 'react-router-dom' ;
3
+
4
+ const ImageGallery = ( ) => {
5
+ const scrollRef = useRef ( null ) ;
6
+
7
+ useEffect ( ( ) => {
8
+ const scrollContainer = scrollRef . current ;
9
+ let isDown = false ;
10
+ let startX ;
11
+ let scrollLeft ;
12
+
13
+ const handleMouseDown = ( e ) => {
14
+ isDown = true ;
15
+ scrollContainer . classList . add ( 'active' ) ;
16
+ startX = e . pageX - scrollContainer . offsetLeft ;
17
+ scrollLeft = scrollContainer . scrollLeft ;
18
+ } ;
19
+
20
+ const handleMouseLeave = ( ) => {
21
+ isDown = false ;
22
+ scrollContainer . classList . remove ( 'active' ) ;
23
+ } ;
24
+
25
+ const handleMouseUp = ( ) => {
26
+ isDown = false ;
27
+ scrollContainer . classList . remove ( 'active' ) ;
28
+ } ;
29
+
30
+ const handleMouseMove = ( e ) => {
31
+ if ( ! isDown ) return ;
32
+ e . preventDefault ( ) ;
33
+ const x = e . pageX - scrollContainer . offsetLeft ;
34
+ const walk = ( x - startX ) * 2 ;
35
+ scrollContainer . scrollLeft = scrollLeft - walk ;
36
+ } ;
37
+
38
+ if ( scrollContainer ) {
39
+ scrollContainer . addEventListener ( 'mousedown' , handleMouseDown ) ;
40
+ scrollContainer . addEventListener ( 'mouseleave' , handleMouseLeave ) ;
41
+ scrollContainer . addEventListener ( 'mouseup' , handleMouseUp ) ;
42
+ scrollContainer . addEventListener ( 'mousemove' , handleMouseMove ) ;
43
+ }
44
+
45
+ return ( ) => {
46
+ if ( scrollContainer ) {
47
+ scrollContainer . removeEventListener ( 'mousedown' , handleMouseDown ) ;
48
+ scrollContainer . removeEventListener ( 'mouseleave' , handleMouseLeave ) ;
49
+ scrollContainer . removeEventListener ( 'mouseup' , handleMouseUp ) ;
50
+ scrollContainer . removeEventListener ( 'mousemove' , handleMouseMove ) ;
51
+ }
52
+ } ;
53
+ } , [ ] ) ;
54
+
55
+ const images = [
56
+ {
57
+ src : '/gallery/Docker-9th-birthday.JPG' ,
58
+ alt : 'Docker 9th Birthday Celebration' ,
59
+ caption : 'Docker 9th Birthday Community Celebration'
60
+ } ,
61
+ {
62
+ src : '/gallery/k8s-forum-blr-2020.jpg' ,
63
+ alt : 'Kubernetes Forum Bangalore' ,
64
+ caption : 'Kubernetes Forum Bangalore 2020'
65
+ } ,
66
+ {
67
+ src : '/gallery/CNCF-Thane.jpg' ,
68
+ alt : 'CNCF Thane Event' ,
69
+ caption : 'CNCF Community Event at Thane'
70
+ } ,
71
+ {
72
+ src : '/gallery/CSA-Banglore-2023.jpg' ,
73
+ alt : 'CSA Bangalore Event' ,
74
+ caption : 'Cloud Security Alliance Bangalore 2023'
75
+ } ,
76
+ {
77
+ src : '/gallery/Citrix-R&D.jpg' ,
78
+ alt : 'Citrix R&D Event' ,
79
+ caption : 'Cloud Native Session at Citrix R&D'
80
+ } ,
81
+ {
82
+ src : '/gallery/DellEMC.jpg' ,
83
+ alt : 'Dell EMC Event' ,
84
+ caption : 'Container Technology Workshop at Dell EMC'
85
+ } ,
86
+ {
87
+ src : '/gallery/DevRel-Docker_2016.jpg' ,
88
+ alt : 'Docker DevRel 2016' ,
89
+ caption : 'Docker Developer Relations Event 2016'
90
+ } ,
91
+ {
92
+ src : '/gallery/Docker-Extension.JPG' ,
93
+ alt : 'Docker Extension Workshop' ,
94
+ caption : 'Docker Extension Development Workshop'
95
+ } ,
96
+ {
97
+ src : '/gallery/Docker-Pune-2018.jpg' ,
98
+ alt : 'Docker Pune 2018' ,
99
+ caption : 'Docker Community Event Pune 2018'
100
+ } ,
101
+ {
102
+ src : '/gallery/Docker-Pune-2023.jpg' ,
103
+ alt : 'Docker Pune 2023' ,
104
+ caption : 'Docker Community Event Pune 2023'
105
+ } ,
106
+ {
107
+ src : '/gallery/GDG-Nagpur.jpg' ,
108
+ alt : 'GDG Nagpur' ,
109
+ caption : 'Google Developer Group Nagpur'
110
+ } ,
111
+ {
112
+ src : '/gallery/GPS-Docker.jpg' ,
113
+ alt : 'GPS Docker Event' ,
114
+ caption : 'Docker Workshop at GPS'
115
+ } ,
116
+ {
117
+ src : '/gallery/IMG_7612.JPG' ,
118
+ alt : 'Community Event' ,
119
+ caption : 'Cloud Native Community Meetup'
120
+ } ,
121
+ {
122
+ src : '/gallery/JFROG_K8s.jpg' ,
123
+ alt : 'JFrog Kubernetes Workshop' ,
124
+ caption : 'JFrog Kubernetes Workshop'
125
+ } ,
126
+ {
127
+ src : '/gallery/Jfrog.jpg' ,
128
+ alt : 'JFrog Event' ,
129
+ caption : 'Cloud Native Session at JFrog'
130
+ } ,
131
+ {
132
+ src : '/gallery/KL_University.JPG' ,
133
+ alt : 'KL University Event' ,
134
+ caption : 'Cloud Native Workshop at KL University'
135
+ } ,
136
+ {
137
+ src : '/gallery/Rakuten.JPG' ,
138
+ alt : 'Rakuten Event' ,
139
+ caption : 'Cloud Native Session at Rakuten'
140
+ } ,
141
+ {
142
+ src : '/gallery/Rancher.jpg' ,
143
+ alt : 'Rancher Event' ,
144
+ caption : 'Kubernetes Workshop with Rancher'
145
+ } ,
146
+ {
147
+ src : '/gallery/SAPLAB1.jpg' ,
148
+ alt : 'SAP Labs Event' ,
149
+ caption : 'Container Technology at SAP Labs'
150
+ } ,
151
+ {
152
+ src : '/gallery/SAPLAB2020-team.jpg' ,
153
+ alt : 'SAP Labs Team 2020' ,
154
+ caption : 'SAP Labs Cloud Native Team 2020'
155
+ } ,
156
+ {
157
+ src : '/gallery/SAP_LAB_AWARD.jpg' ,
158
+ alt : 'SAP Labs Award' ,
159
+ caption : 'Recognition at SAP Labs'
160
+ } ,
161
+ {
162
+ src : '/gallery/SAP_LAB_KO_google.jpg' ,
163
+ alt : 'SAP Labs Google Event' ,
164
+ caption : 'SAP Labs & Google Cloud Event'
165
+ } ,
166
+ {
167
+ src : '/gallery/VISA.jpg' ,
168
+ alt : 'VISA Event' ,
169
+ caption : 'Cloud Native Workshop at VISA'
170
+ } ,
171
+ {
172
+ src : '/gallery/brainanalaytics.jpg' ,
173
+ alt : 'Brain Analytics Event' ,
174
+ caption : 'Tech Session at Brain Analytics'
175
+ } ,
176
+ {
177
+ src : '/gallery/docker-on-aws-gps2017.jpg' ,
178
+ alt : 'Docker on AWS GPS 2017' ,
179
+ caption : 'Docker on AWS Workshop GPS 2017'
180
+ } ,
181
+ {
182
+ src : '/gallery/mayadata.jpg' ,
183
+ alt : 'MayaData Event' ,
184
+ caption : 'Cloud Native Session at MayaData'
185
+ } ,
186
+ {
187
+ src : '/gallery/microsoft-reactor.jpg' ,
188
+ alt : 'Microsoft Reactor Event' ,
189
+ caption : 'Cloud Native Workshop at Microsoft Reactor'
190
+ } ,
191
+ {
192
+ src : '/gallery/okteto.jpg' ,
193
+ alt : 'Okteto Event' ,
194
+ caption : 'Cloud Development with Okteto'
195
+ } ,
196
+ {
197
+ src : '/gallery/st-paloti-nagpur.JPG' ,
198
+ alt : 'St. Paloti Nagpur' ,
199
+ caption : 'Tech Workshop at St. Paloti Nagpur'
200
+ } ,
201
+ {
202
+ src : '/gallery/thoughtworks.jpg' ,
203
+ alt : 'ThoughtWorks Event' ,
204
+ caption : 'Container Workshop at ThoughtWorks'
205
+ } ,
206
+ {
207
+ src : '/gallery/walmartlabs.jpg' ,
208
+ alt : 'Walmart Labs Event' ,
209
+ caption : 'Cloud Native Session at Walmart Labs'
210
+ }
211
+ ] ;
212
+
213
+ return (
214
+ < section className = "py-16 bg-white" >
215
+ < div className = "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8" >
216
+ < div className = "text-center mb-12" >
217
+ < h2 className = "text-3xl font-extrabold text-gray-900 sm:text-4xl" >
218
+ Learn Together. Grow Together.
219
+ </ h2 >
220
+ < p className = "mt-4 text-xl text-gray-600" >
221
+ A Journey Through Our Global Tech Community Events
222
+ </ p >
223
+ </ div >
224
+
225
+ { /* Scroll Container */ }
226
+ < div
227
+ ref = { scrollRef }
228
+ className = "flex gap-6 overflow-x-auto pb-8 cursor-grab active:cursor-grabbing scroll-smooth hide-scrollbar"
229
+ style = { {
230
+ WebkitOverflowScrolling : 'touch' ,
231
+ scrollSnapType : 'x mandatory' ,
232
+ msOverflowStyle : 'none' ,
233
+ scrollbarWidth : 'none'
234
+ } }
235
+ >
236
+ { images . map ( ( image , index ) => (
237
+ < div
238
+ key = { index }
239
+ className = "flex-none w-[300px] group relative overflow-hidden rounded-lg shadow-lg transition-all duration-300 hover:shadow-xl scroll-snap-align-start"
240
+ >
241
+ < div className = "aspect-w-16 aspect-h-9" >
242
+ < img
243
+ src = { image . src }
244
+ alt = { image . alt }
245
+ className = "h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
246
+ />
247
+ </ div >
248
+ < div className = "absolute inset-0 bg-gradient-to-t from-black/70 to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100" >
249
+ < div className = "absolute bottom-0 left-0 right-0 p-4" >
250
+ < p className = "text-white text-lg font-semibold" >
251
+ { image . caption }
252
+ </ p >
253
+ </ div >
254
+ </ div >
255
+ </ div >
256
+ ) ) }
257
+ </ div >
258
+
259
+ { /* Scroll Indicator */ }
260
+ < div className = "mt-8 flex justify-center" >
261
+ < div className = "text-sm text-gray-500" >
262
+ ← Scroll or drag to see more photos →
263
+ </ div >
264
+ </ div >
265
+ </ div >
266
+
267
+ < style jsx > { `
268
+ .hide-scrollbar::-webkit-scrollbar {
269
+ display: none;
270
+ }
271
+ .scroll-snap-align-start {
272
+ scroll-snap-align: start;
273
+ }
274
+ ` } </ style >
275
+ </ section >
276
+ ) ;
277
+ } ;
278
+
279
+ export default ImageGallery ;
0 commit comments