Selected Works · 3D Merry-Go-Round Carousel
:root {
--bg-cream: #faf9f6;
--card-bg: rgba(255, 255, 255, 0.96);
--card-border: #dedad4;
--card-border-active: #1a1a1a;
--text-main: #181816;
--text-muted: #74716c;
--accent: #a39281;
}
body {
background-color: var(--bg-cream);
color: var(--text-main);
font-family: 'Plus Jakarta Sans', sans-serif;
overflow-x: hidden;
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
}
.font-serif-title {
font-family: 'Playfair Display', serif;
}
/* === 3D Perspective Stage === */
.viewport-3d-scene {
perspective: 1300px;
perspective-origin: 50% 48%;
transform-style: preserve-3d;
position: relative;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
user-select: none;
}
/* Merry-go-round revolving ring center */
.merry-go-round-stage {
position: absolute;
width: 100%;
height: 100%;
transform-style: preserve-3d;
display: flex;
align-items: center;
justify-content: center;
will-change: transform;
}
/* Individual Merry-go-round Card */
.carousel-card {
position: absolute;
width: clamp(420px, 65vw, 100px);
left: 50%;
top: 50%;
transform-origin: center center;
transform-style: preserve-3d;
will-change: transform, opacity, filter;
text-decoration: none;
color: inherit;
background: var(--card-bg);
border: 1px solid var(--card-border);
border-radius: 4px;
padding: 16px;
cursor: pointer;
box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.carousel-card:hover {
border-color: var(--accent);
box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.12);
}
.carousel-card.is-front {
border-color: var(--card-border-active);
box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(26, 26, 26, 0.08);
}
/* Architectural Line Frame Box */
.inner-line-box {
border: 1px solid #ebe7df;
padding: 12px;
border-radius: 2px;
position: relative;
background: #ffffff;
}
.frame-corner {
position: absolute;
width: 5px;
height: 5px;
border-color: #b8b0a5;
pointer-events: none;
}
.corner-tl { top: -1px; left: -1px; border-top: 1.5px solid; border-left: 1.5px solid; }
.corner-tr { top: -1px; right: -1px; border-top: 1.5px solid; border-right: 1.5px solid; }
.corner-bl { bottom: -1px; left: -1px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.corner-br { bottom: -1px; right: -1px; border-bottom: 1.5px solid; border-right: 1.5px solid; }
/* Carousel circular floor visual depth ring */
.orbit-shadow-ring {
position: absolute;
width: clamp(520px, 60vw, 880px);
height: clamp(240px, 30vw, 420px);
border: 1px dashed rgba(184, 176, 165, 0.28);
border-radius: 50%;
top: 50%;
left: 50%;
transform: translate(-50%, 90px) rotateX(75deg);
pointer-events: none;
z-index: 0;
}
.nav-dot {
transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing !important; }
Curated works in constant rotation.
01 · Branding
Scroll or Drag to Orbit
(function() {
'use strict';
// ── Portfolio Disciplines Data ──
const projects = [
{
title: 'Marketing',
category: 'Identity Systems',
desc: 'Monolithic logotypes, typographic scales, and complete corporate visual identities.',
count: '14 Projects',
url: '#marketing',
img: 'http://nayeli.ttuicube.com/wp-content/uploads/2026/10/mockup1-scaled.png'
},
{
title: 'Branding',
category: 'Print & Publication',
desc: 'Archival book editions, exhibition catalogues, and limited hardcover monographs.',
count: '09 Projects',
url: '#Marketing',
img: 'http://nayeli.ttuicube.com/wp-content/uploads/2026/11/bag-packaging-Camera-e1793902015762.png'
},
{
title: 'Editorial',
category: 'Campaign & Strategy',
desc: 'Multichannel campaign rollouts, billboard typography, and spatial launches.',
count: '18 Projects',
url: '#branding',
img: 'http://nayeli.ttuicube.com/wp-content/uploads/2026/11/Book_Mockup_4-scaled-e1794432267881.png'
},
{
title: 'Illustration',
category: 'Structural & Tactile',
desc: 'Embossed foiling, structural packaging engineering, and sustainable materials.',
count: '11 Projects',
url: '#packaging',
img: 'http://nayeli.ttuicube.com/wp-content/uploads/2026/11/mockup-1-scaled-e1794432427377.png'
},
{
title: 'Motion',
category: 'Structural & Tactile',
desc: 'Embossed foiling, structural packaging engineering, and sustainable materials.',
count: '11 Projects',
url: '#packaging',
img: 'https://images.unsplash.com/photo-1589939705384-5185137a7f0f?q=80&w=700&auto=format&fit=crop'
}
];
const numCards = projects.length;
const anglePerCard = (2 * Math.PI) / numCards; // radians per segment (60 deg)
// DOM Elements
const track = document.getElementById('carousel-track');
const stage = document.getElementById('merryGoRoundStage');
const dotNav = document.getElementById('dotNav');
const statusLabel = document.getElementById('currentStatusLabel');
const viewport = document.getElementById('trackViewport');
const cardEls = [];
const dotEls = [];
// ── Build Line-Frame Box Cards ──
projects.forEach((proj, idx) => {
const card = document.createElement('a');
card.href = proj.url;
card.className = 'carousel-card';
card.setAttribute('aria-label', `${proj.title} Category: ${proj.desc}`);
card.innerHTML = `
0${idx + 1}
${proj.title}
${proj.count}
${proj.category}
${proj.desc}
View Collection
→
`;
stage.appendChild(card);
cardEls.push(card);
// Dot Navigation
const dot = document.createElement('button');
dot.className = 'nav-dot h-2 w-2 rounded-full bg-neutral-300 hover:bg-neutral-500';
dot.setAttribute('aria-label', `Navigate to ${proj.title}`);
dot.addEventListener('click', (e) => {
e.preventDefault();
scrollToIndex(idx);
});
dotNav.appendChild(dot);
dotEls.push(dot);
});
// ── Merry-Go-Round Geometric Radii ──
function getRadii() {
const w = window.innerWidth;
if (w < 480) {
return { radiusX: 200, radiusZ: 380 };
} else if (w < 768) {
return { radiusX: 300, radiusZ: 380 };
} else if (w < 1200) {
return { radiusX: 420, radiusZ: 460 };
}
return { radiusX: 520, radiusZ: 520 }; // True circular merry-go-round radius on desktop
}
// State Variables
let targetProgress = 0; // Floating progress index [0 .. numCards - 1]
let currentProgress = 0; // Smoothly interpolated value
let isAnimating = false;
let dragOffset = 0;
let isDragging = false;
let startX = 0;
let previousDragProgress = 0;
// ── Scroll to Target Progress ──
function calculateScrollProgress() {
const rect = track.getBoundingClientRect();
const totalScrollable = track.offsetHeight - window.innerHeight;
if (totalScrollable {
// Angle around the merry-go-round circle
// 0 radians = directly facing front/camera
let angle = (idx * anglePerCard) - progressAngle;
// Normalize angle to [-PI, PI]
angle = ((angle + Math.PI) % (2 * Math.PI) + (2 * Math.PI)) % (2 * Math.PI) - Math.PI;
const absAngle = Math.abs(angle);
if (absAngle scale = 1, blur = 0, opacity = 1
// Back (angle = ±PI): depthRatio = 0 -> scale = 0.58, blur = 8.5px, opacity = 0.28
const depthRatio = (Math.cos(angle) + 1) / 2; // Smooth cosine curve [0, 1]
const scale = 0.58 + (0.42 * depthRatio);
const opacity = 0.26 + (0.74 * Math.pow(depthRatio, 1.3));
const blur = (1 - depthRatio) * 8.5;
const el = cardEls[idx];
// Center-offset of card width/height
const halfW = el.offsetWidth ? el.offsetWidth / 2 : 140;
const halfH = el.offsetHeight ? el.offsetHeight / 2 : 190;
// Apply 3D circular transformation
el.style.transform = `
translate3d(${x - halfW}px, ${-halfH}px, ${z}px)
rotateY(${rotY.toFixed(2)}deg)
scale(${scale.toFixed(3)})
`;
el.style.opacity = opacity.toFixed(3);
el.style.filter = `blur(${blur.toFixed(1)}px)`;
// Layer stacking: items in front naturally render above items circling in the background
const zIndex = Math.round(depthRatio * 100);
el.style.zIndex = zIndex;
// Active foreground interaction
if (absAngle < 0.35) {
el.classList.add('is-front');
el.style.pointerEvents = 'auto';
} else {
el.classList.remove('is-front');
// Background cards disable pointer events when obscured in distance
el.style.pointerEvents = depthRatio {
if (idx === closestIdx) {
dot.className = 'nav-dot h-2 w-6 rounded-full bg-neutral-900';
} else {
dot.className = 'nav-dot h-2 w-2 rounded-full bg-neutral-300 hover:bg-neutral-500';
}
});
}
// ── Smooth Spring Interpolation Loop ──
function render() {
const effectiveTarget = targetProgress + dragOffset;
const delta = effectiveTarget - currentProgress;
currentProgress += delta * 0.085;
updateMerryGoRound(currentProgress);
if (Math.abs(delta) > 0.0005 || isDragging) {
requestAnimationFrame(render);
} else {
isAnimating = false;
}
}
function requestRender() {
if (!isAnimating) {
isAnimating = true;
requestAnimationFrame(render);
}
}
// Scroll Event
function onScroll() {
targetProgress = calculateScrollProgress();
requestRender();
}
window.addEventListener('scroll', onScroll, { passive: true });
window.addEventListener('resize', () => {
targetProgress = calculateScrollProgress();
updateMerryGoRound(currentProgress);
});
// ── Touch & Pointer Horizontal Drag Support ──
function onPointerDown(e) {
isDragging = true;
startX = e.clientX || (e.touches && e.touches[0].clientX) || 0;
previousDragProgress = dragOffset;
viewport.classList.add('cursor-grabbing');
requestRender();
}
function onPointerMove(e) {
if (!isDragging) return;
const currentX = e.clientX || (e.touches && e.touches[0].clientX) || 0;
const diffX = currentX - startX;
// Horizontal drag converts to carousel progress
dragOffset = previousDragProgress - (diffX * 0.0035);
requestRender();
}
function onPointerUp() {
if (!isDragging) return;
isDragging = false;
viewport.classList.remove('cursor-grabbing');
}
viewport.addEventListener('mousedown', onPointerDown);
window.addEventListener('mousemove', onPointerMove);
window.addEventListener('mouseup', onPointerUp);
viewport.addEventListener('touchstart', onPointerDown, { passive: true });
window.addEventListener('touchmove', onPointerMove, { passive: true });
window.addEventListener('touchend', onPointerUp);
// Keyboard left/right / up/down navigation
window.addEventListener('keydown', (e) => {
const rect = track.getBoundingClientRect();
if (rect.top > window.innerHeight || rect.bottom < 0) return;
const currentIdx = Math.round(currentProgress);
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
e.preventDefault();
scrollToIndex(Math.min(currentIdx + 1, numCards - 1));
} else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
e.preventDefault();
scrollToIndex(Math.max(currentIdx - 1, 0));
}
});
// Initial setup
targetProgress = calculateScrollProgress();
currentProgress = targetProgress;
updateMerryGoRound(currentProgress);
})();