Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions components/GallerySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const GALLERY_ITEMS: GalleryPhoto[] = [
id: "mem-2",
imageSrc: "/gallery/event-2.webp",
title: "Microservices Workshop",
caption: "Hands-on microservice architectures, containers, and deployments.",
caption:
"Hands-on microservice architectures, containers, and deployments.",
frameSrc: "/frames/frame-oval.webp",
frameStyle: "gold",
width: 200,
Expand All @@ -53,7 +54,8 @@ const GALLERY_ITEMS: GalleryPhoto[] = [
id: "mem-3",
imageSrc: "/gallery/event-3.webp",
title: "Git & GitHub Labs",
caption: "Demystifying commits, branching, pull requests, and interactive rebasing.",
caption:
"Demystifying commits, branching, pull requests, and interactive rebasing.",
frameSrc: "/frames/frame-gothic.webp",
frameStyle: "gold",
width: 165,
Expand Down Expand Up @@ -209,7 +211,10 @@ export default function GallerySection() {
};

return (
<section id="gallery" className="relative w-full min-h-[110vh] bg-[#0E081F] overflow-hidden select-none py-16 px-4">
<section
id="gallery"
className="relative w-full min-h-[110vh] bg-[#0E081F] overflow-hidden select-none py-16 px-4"
>
{/* Background glow effects */}
<div className="absolute top-1/3 left-1/2 -translate-x-1/2 w-[700px] h-[700px] bg-purple-900/20 rounded-full blur-[140px] pointer-events-none" />
<div className="absolute bottom-10 left-1/3 w-[450px] h-[450px] bg-amber-600/10 rounded-full blur-[100px] pointer-events-none" />
Expand Down Expand Up @@ -250,9 +255,6 @@ export default function GallerySection() {
{GALLERY_ITEMS.map((item, index) => (
<motion.div
key={item.id}
drag
dragConstraints={containerRef}
dragElastic={0.2}
whileHover={{ scale: 1.08, y: -4, zIndex: 55 }}
whileTap={{ scale: 0.98 }}
animate={{
Expand Down Expand Up @@ -293,7 +295,8 @@ export default function GallerySection() {
<img
src={item.imageSrc}
alt={item.title}
className="w-full h-full object-cover object-[center_25%] pointer-events-none transition-transform duration-300 hover:scale-105"
draggable={false}
className="w-full h-full object-cover object-[center_25%] pointer-events-none select-none transition-transform duration-300 hover:scale-105"
/>
</div>

Expand All @@ -303,8 +306,8 @@ export default function GallerySection() {
item.frameStyle === "silver"
? "border-[9px] border-[#b0b8c2] shadow-[0_18px_45px_rgba(0,0,0,0.95),0_0_25px_rgba(200,220,255,0.25),inset_0_0_0_2px_#ffffff,inset_0_0_0_5px_#262a30,inset_0_0_14px_rgba(0,0,0,0.85)]"
: item.frameStyle === "bronze"
? "border-[7px] border-[#9c6e3b] shadow-[0_12px_28px_rgba(0,0,0,0.85),inset_0_0_0_2px_#e3cbb1,inset_0_0_0_4px_#42260d,inset_0_0_10px_rgba(0,0,0,0.8)]"
: "border-[7px] border-[#d4af37] shadow-[0_12px_28px_rgba(0,0,0,0.85),inset_0_0_0_2px_#fff3bf,inset_0_0_0_4px_#5a3e0b,inset_0_0_10px_rgba(0,0,0,0.8)]"
? "border-[7px] border-[#9c6e3b] shadow-[0_12px_28px_rgba(0,0,0,0.85),inset_0_0_0_2px_#e3cbb1,inset_0_0_0_4px_#42260d,inset_0_0_10px_rgba(0,0,0,0.8)]"
: "border-[7px] border-[#d4af37] shadow-[0_12px_28px_rgba(0,0,0,0.85),inset_0_0_0_2px_#fff3bf,inset_0_0_0_4px_#5a3e0b,inset_0_0_10px_rgba(0,0,0,0.8)]"
}`}
/>
</motion.div>
Expand Down Expand Up @@ -343,7 +346,11 @@ export default function GallerySection() {
<div className="relative w-[320px] h-[220px] md:w-[520px] md:h-[350px] flex items-center justify-center filter drop-shadow-[0_20px_50px_rgba(0,0,0,0.9)]">
{/* Sliding Photo Mask */}
<div className="absolute w-[74%] h-[67%] rounded-sm overflow-hidden z-10 bg-black/50">
<AnimatePresence initial={false} custom={direction} mode="popLayout">
<AnimatePresence
initial={false}
custom={direction}
mode="popLayout"
>
<motion.img
key={selectedIndex}
src={GALLERY_ITEMS[selectedIndex].imageSrc}
Expand All @@ -353,14 +360,8 @@ export default function GallerySection() {
initial="enter"
animate="center"
exit="exit"
drag="x"
dragConstraints={{ left: 0, right: 0 }}
dragElastic={0.4}
onDragEnd={(_, info) => {
if (info.offset.x > 80) paginate(-1);
else if (info.offset.x < -80) paginate(1);
}}
className="w-full h-full object-cover cursor-grab active:cursor-grabbing"
draggable={false}
className="w-full h-full object-cover select-none pointer-events-none"
/>
</AnimatePresence>
</div>
Expand Down
14 changes: 12 additions & 2 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="Ornate Rectangular Master Frame"
width="1320"
height="885"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down Expand Up @@ -514,6 +515,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="The Gathering"
width="165"
height="190"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down Expand Up @@ -546,6 +548,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="Microservices Workshop"
width="200"
height="135"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down Expand Up @@ -578,6 +581,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="Git & GitHub Labs"
width="165"
height="190"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down Expand Up @@ -610,6 +614,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="Terminal Sorcery"
width="165"
height="215"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down Expand Up @@ -644,6 +649,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="The Grand Assembly"
width="220"
height="280"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down Expand Up @@ -676,6 +682,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="Code & Collaboration"
width="165"
height="215"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand All @@ -684,7 +691,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
</div>
</div>

<!-- Portrait 7 (Bottom-Left: The Mentorship Circle - Hagrid Position) -->
<!-- Portrait 7 (Bottom-Left: The Learning Circle - Hagrid Position) -->
<div
class="gallery-portrait"
data-gallery-item
Expand All @@ -705,9 +712,10 @@ <h2 class="stop__title">The Hall of Memories</h2>
<div class="gallery-portrait__photo">
<img
src="/gallery/event-7.webp"
alt="The Mentorship Circle"
alt="The Learning Circle"
width="165"
height="220"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down Expand Up @@ -740,6 +748,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="Open Source Odyssey"
width="200"
height="125"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down Expand Up @@ -772,6 +781,7 @@ <h2 class="stop__title">The Hall of Memories</h2>
alt="The Finale"
width="165"
height="220"
draggable="false"
loading="lazy"
decoding="async"
/>
Expand Down
20 changes: 6 additions & 14 deletions frontend/src/components/GallerySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ const GALLERY_ITEMS: GalleryPhoto[] = [
{
id: 'mem-7',
imageSrc: '/gallery/event-7.webp',
title: 'The Mentorship Circle',
caption: 'Senior engineers guiding newcomers through their first contributions.',
title: 'The Learning Circle',
caption: 'Guiding newcomers through their first contributions.',
frameSrc: '/frames/frame-square.webp',
frameStyle: 'bronze',
width: 165,
Expand Down Expand Up @@ -250,9 +250,6 @@ export default function GallerySection() {
{GALLERY_ITEMS.map((item, index) => (
<motion.div
key={item.id}
drag
dragConstraints={containerRef}
dragElastic={0.2}
whileHover={{ scale: 1.08, y: -4, zIndex: 55 }}
whileTap={{ scale: 0.98 }}
animate={{
Expand Down Expand Up @@ -293,7 +290,8 @@ export default function GallerySection() {
<img
src={item.imageSrc}
alt={item.title}
className="w-full h-full object-cover object-[center_25%] pointer-events-none transition-transform duration-300 hover:scale-105"
draggable={false}
className="w-full h-full object-cover object-[center_25%] pointer-events-none select-none transition-transform duration-300 hover:scale-105"
/>
</div>

Expand Down Expand Up @@ -353,14 +351,8 @@ export default function GallerySection() {
initial="enter"
animate="center"
exit="exit"
drag="x"
dragConstraints={{ left: 0, right: 0 }}
dragElastic={0.4}
onDragEnd={(_, info) => {
if (info.offset.x > 80) paginate(-1);
else if (info.offset.x < -80) paginate(1);
}}
className="w-full h-full object-cover cursor-grab active:cursor-grabbing"
draggable={false}
className="w-full h-full object-cover select-none pointer-events-none"
/>
</AnimatePresence>
</div>
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/scripts/emailApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
* Sends registration confirmation emails through the Node.js Nodemailer backend.
*/

const BACKEND_URL = (
import.meta.env?.VITE_BACKEND_URL ||
import.meta.env?.VITE_EMAIL_API_URL ||
''
)
const BACKEND_URL = (import.meta.env?.VITE_BACKEND_URL || import.meta.env?.VITE_EMAIL_API_URL || '')
.trim()
.replace(/\/+$/, '');

Expand Down
72 changes: 6 additions & 66 deletions frontend/src/scripts/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export const GALLERY_ITEMS = [
{
id: 'mem-7',
imageSrc: '/gallery/event-7.webp',
title: 'The Mentorship Circle',
caption: 'Senior engineers guiding newcomers through their first contributions.',
title: 'The Learning Circle',
caption: 'Guiding newcomers through their first contributions.',
frameSrc: '/frames/frame-square.webp',
frameStyle: 'bronze',
width: 165,
Expand Down Expand Up @@ -158,72 +158,12 @@ export function initGallery(root) {
let currentIndex = 0;
let isAnimating = false;

// Set up dragging on floating portraits
// Set up click listeners on floating portraits to open lightbox
const portraits = canvas.querySelectorAll('[data-gallery-item]');
portraits.forEach((portrait, index) => {
let startX = 0;
let startY = 0;
let initialLeft = 0;
let initialTop = 0;
let hasDragged = false;
let isDragging = false;

portrait.addEventListener('pointerdown', (e) => {
// Only primary mouse button or touch
if (e.button !== 0) return;
isDragging = true;
hasDragged = false;
startX = e.clientX;
startY = e.clientY;

const rect = portrait.getBoundingClientRect();
const parentRect = canvas.getBoundingClientRect();
initialLeft = rect.left - parentRect.left;
initialTop = rect.top - parentRect.top;

portrait.setPointerCapture(e.pointerId);
portrait.addEventListener('click', () => {
openLightbox(index);
});

portrait.addEventListener('pointermove', (e) => {
if (!isDragging) return;
const dx = e.clientX - startX;
const dy = e.clientY - startY;

if (!hasDragged && Math.hypot(dx, dy) > 6) {
hasDragged = true;
portrait.classList.add('is-dragging');
portrait.style.left = `${initialLeft}px`;
portrait.style.top = `${initialTop}px`;
}

if (hasDragged) {
const newX = initialLeft + dx;
const newY = initialTop + dy;
portrait.style.left = `${newX}px`;
portrait.style.top = `${newY}px`;
}
});

const finishDrag = (e) => {
if (!isDragging) return;
isDragging = false;
portrait.classList.remove('is-dragging');
try {
if (portrait.hasPointerCapture(e.pointerId)) {
portrait.releasePointerCapture(e.pointerId);
}
} catch {
// Pointer capture release safeguard
}

// If user simply clicked (no significant movement), open lightbox
if (!hasDragged) {
openLightbox(index);
}
};

portrait.addEventListener('pointerup', finishDrag);
portrait.addEventListener('pointercancel', finishDrag);
});

function updateModalMeta(idx) {
Expand Down Expand Up @@ -353,7 +293,7 @@ export function initGallery(root) {
let diffX = 0;

modalMask.addEventListener('pointerdown', (e) => {
if (e.button !== 0 || isAnimating) return;
if (e.pointerType === 'mouse' || e.button !== 0 || isAnimating) return;
isMaskDragging = true;
diffX = 0;
maskStartX = e.clientX;
Expand Down
15 changes: 5 additions & 10 deletions frontend/src/styles/sections/gallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
0 35px 100px rgba(0, 0, 0, 0.95),
0 0 50px rgba(255, 122, 0, 0.15),
inset 0 0 100px rgba(0, 0, 0, 0.92);
touch-action: none;
touch-action: pan-y;
flex-shrink: 0;
transform: scale(0.66) !important;
transform-origin: top center !important;
Expand All @@ -130,7 +130,7 @@
/* Individual Floating Portrait Item */
.gallery-portrait {
position: absolute;
cursor: grab;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
Expand Down Expand Up @@ -178,9 +178,7 @@
drop-shadow(0 0 32px rgba(255, 190, 50, 0.55));
}

.gallery-portrait:active,
.gallery-portrait.is-dragging {
cursor: grabbing;
.gallery-portrait:active {
transform: scale(0.98);
}

Expand Down Expand Up @@ -241,6 +239,8 @@
object-position: center 25%;
pointer-events: none;
user-select: none;
-webkit-user-drag: none;
user-drag: none;
transition:
transform 0.4s ease,
filter 0.4s ease;
Expand Down Expand Up @@ -453,14 +453,9 @@
overflow: hidden;
z-index: 10;
background-color: rgba(0, 0, 0, 0.6);
cursor: grab;
touch-action: pan-y;
}

.gallery-modal__mask:active {
cursor: grabbing;
}

.gallery-modal__slider {
position: relative;
width: 100%;
Expand Down
Loading