diff --git a/src/frontend/src/app/core/tokens/api-config.token.ts b/src/frontend/src/app/core/tokens/api-config.token.ts index 1b56806..b826bac 100644 --- a/src/frontend/src/app/core/tokens/api-config.token.ts +++ b/src/frontend/src/app/core/tokens/api-config.token.ts @@ -3,7 +3,11 @@ import { InjectionToken } from '@angular/core'; export const API_BASE_URL = new InjectionToken('API_BASE_URL', { providedIn: 'root', factory: () => { - if (typeof window !== 'undefined' && window.location.hostname.includes('bryan-bano.com')) { + if ( + typeof window !== 'undefined' && + (window.location.hostname.includes('bryan-bano.com') || + window.location.hostname.includes('pages.dev')) + ) { return 'https://api.bryan-bano.com/api/v1'; } return 'http://localhost:5000/api/v1'; diff --git a/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.css b/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.css index 8436543..09e1d58 100644 --- a/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.css +++ b/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.css @@ -23,6 +23,58 @@ 50% { opacity: 1; transform: scale(1.15); } } +.zen-scroll-hint { + position: absolute; + bottom: 28px; + left: 50%; + transform: translateX(-50%); + display: flex; + align-items: center; + gap: 10px; + padding: 6px 14px; + background: rgba(12, 14, 20, 0.7); + backdrop-filter: blur(8px); + border: 1px solid var(--zen-border-subtle); + border-radius: var(--zen-radius-xs); + z-index: 20; + transition: opacity 0.4s ease, transform 0.4s ease; + pointer-events: none; +} +.zen-scroll-hint.faded { + opacity: 0; + transform: translate(-50%, 12px); +} +.scroll-mouse-icon { + width: 14px; + height: 22px; + border: 1.5px solid var(--zen-accent-kintsugi); + border-radius: 8px; + position: relative; + display: block; +} +.scroll-wheel-dot { + width: 2.5px; + height: 4px; + background: var(--zen-accent-kintsugi); + border-radius: 1px; + position: absolute; + top: 4px; + left: 50%; + transform: translateX(-50%); + animation: scrollWheelPulse 1.6s infinite ease-in-out; +} +@keyframes scrollWheelPulse { + 0% { transform: translate(-50%, 0); opacity: 1; } + 100% { transform: translate(-50%, 8px); opacity: 0; } +} +.scroll-hint-text { + font-family: var(--font-mono); + font-size: 0.6875rem; + font-weight: 600; + letter-spacing: 0.1em; + color: var(--zen-text-secondary); +} + .lateral-panel { position: absolute; z-index: 10; width: min(100%, 25rem); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s; diff --git a/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.html b/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.html index fa5df04..7d37802 100644 --- a/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.html +++ b/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.html @@ -130,6 +130,14 @@ + + + diff --git a/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.ts b/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.ts index 6d2e953..b7456e7 100644 --- a/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.ts +++ b/src/frontend/src/app/presentation/features/hero-3d/hero-3d.component.ts @@ -50,11 +50,10 @@ export class Hero3dComponent implements OnInit, AfterViewInit, OnDestroy { private mediaQueryList?: MediaQueryList; ngOnInit(): void { - const isBottom = this.initialPosition() === 'bottom'; - this.targetFrame = isBottom ? TOTAL_FRAMES : 1; - this.currentInterpolatedFrame = isBottom ? TOTAL_FRAMES : 1; - this.lastRenderedFrame = isBottom ? TOTAL_FRAMES : 1; - this.activePhase.set(isBottom ? 3 : 1); + this.targetFrame = 1; + this.currentInterpolatedFrame = 1; + this.lastRenderedFrame = 1; + this.activePhase.set(1); this.checkReducedMotion(); if (typeof window !== 'undefined' && window.innerWidth <= 900) { @@ -91,41 +90,9 @@ export class Hero3dComponent implements OnInit, AfterViewInit, OnDestroy { }); if (typeof window !== 'undefined' && window.innerWidth > 900) { - const container = this.containerRef.nativeElement; - const isBottom = this.initialPosition() === 'bottom'; - - if (isBottom) { - const scrollableDistance = container.offsetHeight - window.innerHeight; - window.scrollTo({ top: scrollableDistance > 0 ? scrollableDistance : 3000, behavior: 'instant' }); - this.targetFrame = TOTAL_FRAMES; - this.currentInterpolatedFrame = TOTAL_FRAMES; - this.lastRenderedFrame = TOTAL_FRAMES; - this.activePhase.set(3); - } else { - window.scrollTo({ top: 0, behavior: 'instant' }); - this.targetFrame = 1; - this.currentInterpolatedFrame = 1; - this.lastRenderedFrame = 1; - this.activePhase.set(1); - } - this.onResize(); + this.onScroll(); this.renderFrame(Math.round(this.currentInterpolatedFrame)); - - // Reasegurar la posición al desbloquear el scroll - if (isBottom) { - setTimeout(() => { - const maxDist = container.offsetHeight - window.innerHeight; - if (maxDist > 0) { - window.scrollTo({ top: maxDist, behavior: 'instant' }); - } - this.targetFrame = TOTAL_FRAMES; - this.currentInterpolatedFrame = TOTAL_FRAMES; - this.lastRenderedFrame = TOTAL_FRAMES; - this.activePhase.set(3); - this.renderFrame(TOTAL_FRAMES); - }, 780); - } } } diff --git a/src/frontend/src/app/presentation/features/landing/landing.component.css b/src/frontend/src/app/presentation/features/landing/landing.component.css index 9a6a31a..40ba1e0 100644 --- a/src/frontend/src/app/presentation/features/landing/landing.component.css +++ b/src/frontend/src/app/presentation/features/landing/landing.component.css @@ -9,18 +9,16 @@ .landing-container { display: flex; flex-direction: column; + width: 100%; min-height: 100vh; position: relative; background-color: #121517; } -.landing-container.transitioning-lock { - overflow: hidden !important; - height: 100vh !important; - max-height: 100vh !important; -} +/* ============================================================================== + HEADER MINIMALISTA FLOTANTE (Glassmorphism & Cyber-Zen) + ============================================================================== */ -/* Header Minimalista Flotante */ .zen-header { position: fixed; top: 0; @@ -32,7 +30,7 @@ justify-content: space-between; height: 56px; padding: 0 clamp(0.75rem, 2vw, 2rem); - background: rgba(10, 10, 11, 0.85); + background: rgba(10, 10, 11, 0.88); backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid var(--zen-border-subtle); gap: var(--space-3); @@ -47,6 +45,11 @@ display: flex; align-items: center; flex-shrink: 0; + transition: transform 0.2s ease; +} + +.brand-block-btn:hover { + transform: scale(1.05); } .brand-logo { @@ -77,7 +80,7 @@ font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 600; - padding: 5px 10px; + padding: 5px 12px; border-radius: var(--zen-radius-xs); cursor: pointer; transition: all 0.2s ease; @@ -86,19 +89,13 @@ .nav-item:hover { color: var(--zen-text-primary); - background: rgba(255, 255, 255, 0.04); + background: rgba(255, 255, 255, 0.05); } .nav-item.active { color: var(--zen-accent-kintsugi); - background: rgba(197, 155, 39, 0.1); - border-color: rgba(197, 155, 39, 0.35); -} - -.nav-item.nav-all { - font-family: var(--font-mono); - font-size: 0.75rem; - opacity: 0.85; + background: rgba(197, 155, 39, 0.12); + border-color: rgba(197, 155, 39, 0.4); } .header-right-group { @@ -133,7 +130,7 @@ font-family: var(--font-sans); font-size: 0.75rem; font-weight: 700; - color: var(--zen-text-primary); + color: var(--zen-text-secondary); background: var(--zen-bg-surface); border: 1px solid var(--zen-border-subtle); border-radius: var(--zen-radius-xs); @@ -148,144 +145,78 @@ background: var(--zen-bg-elevated); } -.hero-container { - width: 100%; -} - -/* Vista Aislada (Single Component View) */ -.isolated-view { - min-height: calc(100vh - 56px); - padding-top: calc(56px + var(--space-4)); - box-sizing: border-box; - background-color: #121517; - flex: 1 0 auto; - animation: zenViewEnter 0.32s cubic-bezier(0.16, 1, 0.3, 1) both; -} - -@keyframes zenViewEnter { - from { - opacity: 0; - transform: translateY(8px); - } - to { - opacity: 1; - transform: translateY(0); - } -} - -.hero-container.isolated-view { - padding-top: 0; - background-color: #000000; - animation: none; -} - -.interactive-stage.isolated-view { - height: 100vh; - min-height: 100vh; - max-height: 100vh; - overflow: hidden; - padding: 56px clamp(1rem, 3vw, 2.5rem) 0 clamp(1rem, 3vw, 2.5rem); - display: flex; - align-items: center; - justify-content: center; - box-sizing: border-box; -} - -.interactive-stage.isolated-view .stage-grid { - height: 100%; - max-height: calc(100vh - 72px); - align-items: center; -} - -.interactive-stage.isolated-view .retro-module-card { - height: 100%; - max-height: calc(100vh - 72px); - display: flex; - align-items: center; - justify-content: center; -} - -.interactive-stage.isolated-view .retro-module-card app-retro-os { - display: flex; - align-items: center; - justify-content: center; - height: 100%; - max-height: 100%; - width: 100%; -} - -.interactive-stage.isolated-view .vintage-monitor-wrapper { - max-height: calc(100vh - 90px); - width: auto; - aspect-ratio: 1398 / 1564; -} - -.interactive-stage.isolated-view .profile-module-card { - max-height: calc(100vh - 72px); - overflow: hidden; - display: flex; - justify-content: center; -} - -@media (max-width: 960px) { - .hero-container.isolated-view { - padding: calc(56px + var(--space-4)) clamp(0.75rem, 3vw, 1.5rem) var(--space-8); - background-color: #121517; - min-height: calc(100vh - 56px); - height: auto; - overflow-y: visible; - display: block; - } - - .interactive-stage.isolated-view { - height: auto; - min-height: calc(100vh - 56px); - max-height: none; - overflow-y: visible; - display: block; - padding: calc(56px + var(--space-4)) clamp(0.75rem, 3vw, 1.5rem) var(--space-12) clamp(0.75rem, 3vw, 1.5rem); - } - - .interactive-stage.isolated-view .stage-grid { - display: flex; - flex-direction: column; - height: auto; - max-height: none; - gap: var(--space-8); - } - - .interactive-stage.isolated-view .retro-module-card { - order: 1; - height: auto; - max-height: none; - width: 100%; - } - - .interactive-stage.isolated-view .profile-module-card { - order: 2; - height: auto; - max-height: none; - overflow: visible; - width: 100%; - } - - .interactive-stage.isolated-view .vintage-monitor-wrapper { - max-height: none; - width: 100%; - max-width: 520px; - margin: 0 auto; - } -} - /* ============================================================================== - MÓDULOS INTERACTIVOS (50/50 HORIZONTAL) + ESTRUCTURA DE SECCIONES CONTINUAS (Single Page Scroll Flow) ============================================================================== */ -.interactive-stage { +.landing-section { width: 100%; - padding: var(--space-16) clamp(1rem, 3vw, 2.5rem) var(--space-12) clamp(1rem, 3vw, 2.5rem); - background-color: #121517; - background: linear-gradient(180deg, #000000 0%, #121517 var(--space-12)); + position: relative; + box-sizing: border-box; +} + +.section-container { + width: 100%; + max-width: 1540px; + margin: 0 auto; + padding: 0 clamp(1rem, 3vw, 2.5rem); + box-sizing: border-box; +} + +/* Cabeceras de Sección Cyber-Zen */ +.section-lead-header { + display: flex; + flex-direction: column; + gap: 8px; + margin-bottom: var(--space-8); + padding-bottom: var(--space-3); + border-bottom: 1px solid var(--zen-border-subtle); +} + +.section-badge { + display: inline-flex; + align-items: center; + gap: 8px; +} + +.badge-dot { + width: 7px; + height: 7px; + border-radius: 50%; + background-color: var(--zen-accent-kintsugi); + box-shadow: 0 0 10px var(--zen-accent-kintsugi); +} + +.badge-text { + font-family: var(--font-mono); + font-size: 0.6875rem; + font-weight: 700; + letter-spacing: 0.12em; + color: var(--zen-accent-kintsugi); + text-transform: uppercase; +} + +.section-main-title { + margin: 0; + font-family: var(--font-sans); + font-size: clamp(1.75rem, 3.2vw, 2.5rem); + font-weight: 800; + letter-spacing: -0.02em; + color: var(--zen-text-primary); + line-height: 1.15; +} + +/* 01. HERO SECTION */ +.hero-section { + background-color: #000000; + width: 100%; +} + +/* 02. RETRO OS & PROFILE */ +.interactive-stage { + padding: var(--space-16) 0 var(--space-12) 0; + background: linear-gradient(180deg, #000000 0%, #121517 120px); + border-bottom: 1px solid var(--zen-border-subtle); } .stage-grid { @@ -293,397 +224,106 @@ grid-template-columns: 1fr 1fr; gap: var(--space-8); width: 100%; - align-items: stretch; -} - -@media (max-width: 960px) { - .stage-grid { - grid-template-columns: 1fr; - } + align-items: center; } .module-card { - background: var(--zen-bg-surface); - border: 1px solid var(--zen-border-subtle); - border-radius: var(--zen-radius-sm); - overflow: hidden; - box-shadow: var(--zen-shadow-sm); -} - -.retro-module-card { - background: #121517; - border: none; - box-shadow: none; -} - -.profile-module-card { background: transparent; border: none; box-shadow: none; - height: 100%; - display: flex; - flex-direction: column; + overflow: visible; } -.profile-module-card app-technical-profile { - display: block; - height: 100%; -} - -/* ============================================================================== - SECCIÓN DE PROYECTOS DESTACADOS - ============================================================================== */ - -.projects-stage { - width: 100%; - padding: var(--space-16) clamp(1rem, 3vw, 2.5rem); - background-color: #121517; - box-sizing: border-box; -} - -.projects-stage.isolated-view { - min-height: calc(100vh - 56px); - padding-top: calc(56px + var(--space-6)); - padding-bottom: var(--space-8); +.profile-module-card { display: flex; flex-direction: column; justify-content: center; +} + +.retro-module-card { + display: flex; align-items: center; + justify-content: center; +} + +.retro-module-card app-retro-os { + display: block; + width: 100%; + max-width: 680px; + margin: 0 auto; +} + +/* 03. PROJECTS SECTION */ +.projects-stage { + padding: var(--space-16) 0; background-color: #121517; + border-bottom: 1px solid var(--zen-border-subtle); } .projects-stage-inner { width: 100%; - max-width: 1540px; - margin: 0 auto; } -/* ============================================================================== - SECCIÓN: SIMULADOR DE RESPUESTA A INCIDENTES CLOUD - ============================================================================== */ - +/* 04. SIMULATOR SECTION */ .simulator-stage { - width: 100%; - padding: var(--space-12) clamp(1rem, 3vw, 2.5rem); - background-color: #121517; - box-sizing: border-box; + padding: var(--space-16) 0; + background-color: #0e1114; + border-bottom: 1px solid var(--zen-border-subtle); } -.simulator-stage.isolated-view { - min-height: calc(100vh - 56px); - padding-top: calc(56px + var(--space-4)); - padding-bottom: var(--space-6); - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - background-color: #121517; - box-sizing: border-box; -} - -/* ============================================================================== - SECCIÓN: TERMINAL ARCH LINUX - ============================================================================== */ - +/* 05. TERMINAL SECTION */ .terminal-stage { - width: 100%; - padding: var(--space-16) clamp(1rem, 3vw, 2.5rem); + padding: var(--space-16) 0; background-color: #121517; - box-sizing: border-box; -} - -.terminal-stage.isolated-view { - min-height: calc(100vh - 56px); - padding-top: calc(56px + var(--space-4)); - padding-bottom: var(--space-6); - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - background-color: #121517; - box-sizing: border-box; + border-bottom: 1px solid var(--zen-border-subtle); } .terminal-stage-inner { - max-width: 1540px; - margin: 0 auto; width: 100%; - display: flex; - flex-direction: column; - gap: var(--space-4); } -/* Cabecera Normalizada de Sección */ -.terminal-section-header { - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - padding-bottom: var(--space-2); - border-bottom: 1px solid var(--zen-border-subtle); - margin-bottom: var(--space-1); -} - -.terminal-section-header .header-left, -.terminal-section-header .title-with-badge { - display: flex; - align-items: center; - gap: var(--space-3); -} - -.terminal-section-header .pulse-indicator { - width: 10px; - height: 10px; - border-radius: 50%; - background-color: var(--zen-accent-kintsugi); - box-shadow: 0 0 12px var(--zen-accent-kintsugi); - flex-shrink: 0; -} - -.terminal-section-header .section-title { - margin: 0; - font-family: var(--font-sans); - font-size: clamp(1.6rem, 3vw, 2.25rem); - font-weight: 800; - letter-spacing: -0.01em; - color: var(--zen-text-primary); - line-height: 1.15; - text-transform: uppercase; -} - -/* ============================================================================== - SECCIÓN: CONTACTO - ============================================================================== */ - +/* 06. CONTACT SECTION */ .contact-stage { - width: 100%; - background-color: #121517; -} - -.contact-stage.isolated-view { - min-height: calc(100vh - 56px); - padding-top: 56px; - background-color: #121517; + padding: var(--space-16) 0; + background-color: #0e1114; } /* ============================================================================== - FLECHAS SUTILES FLOTANTES DE NAVEGACIÓN (DEBAJO DEL NAVBAR) + ADAPTABILIDAD RESPONSIVA (Tablet & Mobile) ============================================================================== */ -.zen-floating-nav-controls { - position: fixed; - top: 68px; - left: 0; - right: 0; - width: 100%; - pointer-events: none; - z-index: 950; - display: flex; - justify-content: space-between; - padding: 0 clamp(0.75rem, 2.5vw, 2.5rem); - box-sizing: border-box; +@media (max-width: 960px) { + .stage-grid { + grid-template-columns: 1fr; + gap: var(--space-10); + } + + .retro-module-card { + order: 1; + max-width: 520px; + margin: 0 auto; + } + + .profile-module-card { + order: 2; + } + + .section-lead-header { + margin-bottom: var(--space-6); + } } -.zen-nav-arrow-btn { - pointer-events: auto; - display: inline-flex; - align-items: center; - gap: 8px; - background: rgba(10, 13, 20, 0.75); - backdrop-filter: blur(12px) saturate(160%); - border: 1px solid rgba(255, 255, 255, 0.08); - border-radius: 999px; - padding: 6px 14px; - color: #9aa5b8; - font-family: var(--font-mono, monospace); - font-size: 0.75rem; - font-weight: 600; - cursor: pointer; - transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); - opacity: 1; -} - -.zen-nav-arrow-btn:hover:not(:disabled) { - color: #f0f3f8; - border-color: rgba(197, 155, 39, 0.5); - background: rgba(18, 22, 32, 0.9); - transform: translateY(-1px); - box-shadow: 0 0 14px rgba(197, 155, 39, 0.25); -} - -.zen-nav-arrow-btn.disabled, -.zen-nav-arrow-btn:disabled { - opacity: 0; - pointer-events: none; - transform: scale(0.92); -} - -.nav-arrow-svg { - width: 14px; - height: 14px; - stroke: #c59b27; - flex-shrink: 0; - transition: transform 0.2s ease; -} - -.nav-arrow-left:hover:not(:disabled) .nav-arrow-svg { - transform: translateX(-3px); -} - -.nav-arrow-right:hover:not(:disabled) .nav-arrow-svg { - transform: translateX(3px); -} - -.nav-arrow-label { - letter-spacing: 0.02em; - white-space: nowrap; -} - -/* ============================================================================== - TELÓN DE TRANSICIÓN SUAVE Y SCANLINE ZEN - ============================================================================== */ - -.zen-transition-curtain { - position: fixed; - inset: 0; - z-index: 9999; - background: rgba(8, 10, 14, 0.94); - backdrop-filter: blur(10px); - pointer-events: none; - opacity: 0; - overflow: hidden; - transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1); - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.zen-transition-curtain.visible { - opacity: 1; - pointer-events: auto; -} - -.curtain-logo-wrapper { - position: relative; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - gap: 14px; - animation: logoWrapperEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; -} - -.logo-glow-ring { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 120px; - height: 120px; - border-radius: 50%; - background: radial-gradient(circle, rgba(197, 155, 39, 0.5) 0%, rgba(56, 189, 248, 0.2) 50%, transparent 70%); - filter: blur(16px); - animation: logoPulseGlow 1.2s ease-in-out infinite alternate; - pointer-events: none; -} - -.logo-image-container { - position: relative; - width: 78px; - height: 78px; - border-radius: 14px; - overflow: hidden; - border: 1px solid rgba(197, 155, 39, 0.5); - box-shadow: 0 0 28px rgba(197, 155, 39, 0.35), 0 8px 32px rgba(0, 0, 0, 0.85); - background: #000000; - display: flex; - align-items: center; - justify-content: center; -} - -.curtain-logo-img { - width: 100%; - height: 100%; - object-fit: cover; - transform: scale(0.92); - animation: logoBreath 1.2s ease-in-out infinite alternate; -} - -.logo-shimmer-sweep { - position: absolute; - inset: 0; - background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.45) 50%, transparent 75%); - transform: translateX(-100%); - animation: logoShimmer 1.0s cubic-bezier(0.4, 0, 0.2, 1) infinite; - pointer-events: none; -} - -@keyframes logoWrapperEnter { - from { opacity: 0; transform: scale(0.92); } - to { opacity: 1; transform: scale(1); } -} - -@keyframes logoPulseGlow { - 0% { transform: scale(0.85); opacity: 0.4; } - 100% { transform: scale(1.3); opacity: 0.95; } -} - -@keyframes logoBreath { - 0% { transform: scale(0.88); filter: drop-shadow(0 0 4px rgba(197, 155, 39, 0.3)); } - 100% { transform: scale(0.96); filter: drop-shadow(0 0 12px rgba(197, 155, 39, 0.7)); } -} - -@keyframes logoShimmer { - 0% { transform: translateX(-100%); } - 100% { transform: translateX(100%); } -} - -@media (max-width: 768px) { +@media (max-width: 640px) { .zen-header { - padding: 0 8px; - gap: 6px; - height: 50px; + padding: 0 0.75rem; } .time-location-block { display: none; } - .zen-nav { - gap: 3px; - padding: 3px 6px; - background: rgba(255, 255, 255, 0.03); - border: 1px solid rgba(255, 255, 255, 0.06); - border-radius: 20px; - flex: 1; - min-width: 0; - scroll-behavior: smooth; - } - .nav-item { - padding: 4px 7px; - font-size: 0.6875rem; - border-radius: 14px; - flex-shrink: 0; - } - - .lang-toggle-btn { - padding: 3px 6px; - font-size: 0.6875rem; - } - - .zen-floating-nav-controls { - top: 58px; - padding: 0 10px; - } - - .nav-arrow-label { - display: none; - } - - .zen-nav-arrow-btn { - padding: 6px 10px; + font-size: 0.75rem; + padding: 4px 8px; } } diff --git a/src/frontend/src/app/presentation/features/landing/landing.component.html b/src/frontend/src/app/presentation/features/landing/landing.component.html index 1483663..318aa16 100644 --- a/src/frontend/src/app/presentation/features/landing/landing.component.html +++ b/src/frontend/src/app/presentation/features/landing/landing.component.html @@ -1,7 +1,12 @@ -
+
- @@ -12,7 +17,7 @@ class="nav-item" data-nav="hero" [class.active]="activeSection() === 'hero'" - (click)="setSection('hero')" + (click)="scrollToSection('hero')" > {{ i18n.t().navHome }} @@ -22,7 +27,7 @@ class="nav-item" data-nav="retro" [class.active]="activeSection() === 'retro'" - (click)="setSection('retro')" + (click)="scrollToSection('retro')" > {{ i18n.t().navRetro }} @@ -32,7 +37,7 @@ class="nav-item" data-nav="projects" [class.active]="activeSection() === 'projects'" - (click)="setSection('projects')" + (click)="scrollToSection('projects')" > {{ i18n.t().navProjects }} @@ -42,7 +47,7 @@ class="nav-item" data-nav="simulator" [class.active]="activeSection() === 'simulator'" - (click)="setSection('simulator')" + (click)="scrollToSection('simulator')" > {{ i18n.t().navSimulator }} @@ -52,7 +57,7 @@ class="nav-item" data-nav="terminal" [class.active]="activeSection() === 'terminal'" - (click)="setSection('terminal')" + (click)="scrollToSection('terminal')" > {{ i18n.t().navTerminal }} @@ -62,7 +67,7 @@ class="nav-item" data-nav="contact" [class.active]="activeSection() === 'contact'" - (click)="setSection('contact')" + (click)="scrollToSection('contact')" > {{ i18n.t().navContact }} @@ -76,126 +81,111 @@ {{ i18n.t().location }}
-
- - + +
+
+
+
+ + // 01 ARCHITECTURE & RETRO COMPUTING +
+

{{ i18n.t().navRetro }}

+
- - - - - @if (activeSection() === 'hero') { -
- -
- } - - - @if (activeSection() === 'retro') { -
- +
-
- } +
+
+ + +
+
+
+
+ + // 02 ENTERPRISE SYSTEMS +
+

{{ i18n.t().navProjects }}

+
- - @if (activeSection() === 'projects') { -
-
- } +
+
+ + +
+
+
+
+ + // 03 CLOUD TELEMETRY & SECURITY +
+

{{ i18n.t().navSimulator }}

+
- - @if (activeSection() === 'simulator') { -
-
- } +
+
- - @if (activeSection() === 'terminal') { -
+ +
+
- -
-
-
- -

{{ i18n.t().navTerminal }}

-
+
+
+ + // 04 INTERACTIVE CLI ENGINE
+

{{ i18n.t().navTerminal }}

+
-
- } + +
+ + +
+
+
+
+ + // 05 CONNECT & GUESTBOOK +
+

{{ i18n.t().navContact }}

+
- - @if (activeSection() === 'contact') { -
-
- } +
+
- \ No newline at end of file + diff --git a/src/frontend/src/app/presentation/features/landing/landing.component.ts b/src/frontend/src/app/presentation/features/landing/landing.component.ts index 113da41..7b08861 100644 --- a/src/frontend/src/app/presentation/features/landing/landing.component.ts +++ b/src/frontend/src/app/presentation/features/landing/landing.component.ts @@ -1,4 +1,14 @@ -import { Component, ChangeDetectionStrategy, OnInit, OnDestroy, signal, computed, inject, ViewChild, ElementRef } from '@angular/core'; +import { + Component, + ChangeDetectionStrategy, + OnInit, + AfterViewInit, + OnDestroy, + signal, + inject, + ElementRef, + ViewChild +} from '@angular/core'; import { Hero3dComponent } from '../hero-3d/hero-3d.component'; import { RetroOsComponent } from '../retro-os/retro-os.component'; import { TerminalComponent } from '../terminal/terminal.component'; @@ -39,305 +49,118 @@ export const LANDING_SECTIONS: readonly LandingSection[] = [ styleUrl: './landing.component.css', changeDetection: ChangeDetectionStrategy.OnPush }) -export class LandingComponent implements OnInit, OnDestroy { +export class LandingComponent implements OnInit, AfterViewInit, OnDestroy { protected readonly i18n = inject(I18nService); protected readonly currentYear = signal(new Date().getFullYear()); protected readonly currentTime = signal(''); protected readonly activeSection = signal('hero'); - protected readonly heroEntryPosition = signal<'top' | 'bottom'>('top'); - protected readonly isCurtainVisible = signal(false); - protected readonly transitionTargetSection = signal('hero'); - - protected readonly hasPrevSection = computed(() => { - return LANDING_SECTIONS.indexOf(this.activeSection()) > 0; - }); - - protected readonly hasNextSection = computed(() => { - return LANDING_SECTIONS.indexOf(this.activeSection()) < LANDING_SECTIONS.length - 1; - }); - - protected readonly prevSectionName = computed(() => { - const idx = LANDING_SECTIONS.indexOf(this.activeSection()); - return idx > 0 ? this.getSectionTitle(LANDING_SECTIONS[idx - 1]) : ''; - }); - - protected readonly nextSectionName = computed(() => { - const idx = LANDING_SECTIONS.indexOf(this.activeSection()); - return idx < LANDING_SECTIONS.length - 1 ? this.getSectionTitle(LANDING_SECTIONS[idx + 1]) : ''; - }); - - protected readonly transitionTargetTitle = computed(() => { - return this.getSectionTitle(this.transitionTargetSection()); - }); private clockInterval: ReturnType | null = null; - private readonly timeFormatter = new Intl.DateTimeFormat('en-GB', { - timeZone: 'America/Guayaquil', - hour: '2-digit', - minute: '2-digit', - second: '2-digit', - hour12: false - }); + private sectionObserver?: IntersectionObserver; + private isUserClickScrolling = false; + private clickScrollTimer: ReturnType | null = null; @ViewChild('navContainer') private navContainerRef?: ElementRef; - private isTransitioning = false; - private touchStartY = 0; - private touchStartX = 0; - private touchStartAtTop = false; - private touchStartAtBottom = false; - private wheelDeltaAccum = 0; - private wheelGestureArmed = false; - private lastWheelAt = 0; - private transitionTimer: ReturnType | null = null; - ngOnInit(): void { this.updateClock(); this.clockInterval = setInterval(() => this.updateClock(), 1000); + } + + ngAfterViewInit(): void { + this.setupIntersectionObserver(); this.parseInitialHash(); - this.setupScrollTransitions(); } - getSectionTitle(section: LandingSection): string { - const dict = this.i18n.t(); - switch (section) { - case 'hero': return dict.navHome; - case 'retro': return dict.navRetro; - case 'projects': return dict.navProjects; - case 'simulator': return dict.navSimulator; - case 'terminal': return dict.navTerminal; - case 'contact': return dict.navContact; + ngOnDestroy(): void { + if (this.clockInterval) clearInterval(this.clockInterval); + if (this.clickScrollTimer) clearTimeout(this.clickScrollTimer); + if (this.sectionObserver) { + this.sectionObserver.disconnect(); } } - setSection(section: LandingSection, entryPosition: 'top' | 'bottom' = 'top'): void { - if (this.activeSection() === section || this.isTransitioning) return; - this.isTransitioning = true; - this.transitionTargetSection.set(section); - this.isCurtainVisible.set(true); + scrollToSection(section: LandingSection): void { + this.activeSection.set(section); + this.isUserClickScrolling = true; + if (this.clickScrollTimer) clearTimeout(this.clickScrollTimer); + this.clickScrollTimer = setTimeout(() => { + this.isUserClickScrolling = false; + }, 900); - if (typeof document !== 'undefined') { - document.documentElement.style.overflow = 'hidden'; - document.body.style.overflow = 'hidden'; + if (typeof window === 'undefined') return; + + if (section === 'hero') { + window.scrollTo({ top: 0, behavior: 'smooth' }); + } else { + const el = document.getElementById(section); + if (el) { + const headerOffset = 64; + const elementPosition = el.getBoundingClientRect().top; + const offsetPosition = elementPosition + window.pageYOffset - headerOffset; + window.scrollTo({ top: offsetPosition, behavior: 'smooth' }); + } } - if (this.transitionTimer) clearTimeout(this.transitionTimer); + const hash = section === 'hero' ? '' : `#${section}`; + const url = window.location.pathname + window.location.search + hash; + window.history.replaceState(null, '', url); + this.scrollActiveNavIntoView(section); + } - // Initial phase: show curtain and animated logo - this.transitionTimer = setTimeout(() => { - if (section === 'hero') { - this.heroEntryPosition.set(entryPosition); - } + private setupIntersectionObserver(): void { + if (typeof window === 'undefined' || !('IntersectionObserver' in window)) return; - this.activeSection.set(section); + this.sectionObserver = new IntersectionObserver((entries) => { + if (this.isUserClickScrolling) return; - if (typeof window !== 'undefined') { - const hash = section === 'hero' ? '' : `#${section}`; - const url = window.location.pathname + window.location.search + hash; - window.history.replaceState(null, '', url); - this.scrollActiveNavIntoView(section); - - if (entryPosition === 'bottom') { - const maxScroll = Math.max(0, document.documentElement.scrollHeight - window.innerHeight); - window.scrollTo({ top: maxScroll, behavior: 'instant' }); - } else { - window.scrollTo({ top: 0, behavior: 'instant' }); - } - } - - // Appreciate the animated logo for a full animation cycle before smoothly fading out - setTimeout(() => { - this.isCurtainVisible.set(false); - if (typeof document !== 'undefined') { - document.documentElement.style.overflow = ''; - document.body.style.overflow = ''; - } - - if (typeof window !== 'undefined') { - if (entryPosition === 'bottom') { - const maxScroll = Math.max(0, document.documentElement.scrollHeight - window.innerHeight); - window.scrollTo({ top: maxScroll, behavior: 'instant' }); - } else { - window.scrollTo({ top: 0, behavior: 'instant' }); + for (const entry of entries) { + if (entry.isIntersecting) { + const id = entry.target.id as LandingSection; + if (LANDING_SECTIONS.includes(id)) { + this.activeSection.set(id); + const hash = id === 'hero' ? '' : `#${id}`; + window.history.replaceState(null, '', window.location.pathname + window.location.search + hash); + this.scrollActiveNavIntoView(id); } } - - setTimeout(() => { - this.isTransitioning = false; - }, 300); - }, 550); - }, 220); - } - - private setupScrollTransitions(): void { - if (typeof window === 'undefined') return; - window.addEventListener('wheel', this.onWheel, { passive: false }); - window.addEventListener('touchstart', this.onTouchStart, { passive: true }); - window.addEventListener('touchend', this.onTouchEnd, { passive: true }); - } - - private onWheel = (e: WheelEvent): void => { - if (this.isTransitioning || this.isCurtainVisible()) { - e.preventDefault(); - return; - } - - // Ignorar si el usuario está interactuando con un modal - const target = e.target as HTMLElement | null; - if (target?.closest('.project-detail-overlay')) { - return; - } - - const now = performance.now(); - const isNewGesture = now - this.lastWheelAt > 160; - this.lastWheelAt = now; - - const scrollY = window.scrollY || window.pageYOffset; - const maxScroll = Math.max(0, document.documentElement.scrollHeight - window.innerHeight); - const goingDown = e.deltaY > 0; - const atBoundary = goingDown ? scrollY >= maxScroll - 6 : scrollY <= 6; - const innerCanScroll = atBoundary && this.canInnerScroll(target, goingDown); - - if (innerCanScroll) { - this.wheelDeltaAccum = 0; - this.wheelGestureArmed = false; - return; - } - - if (isNewGesture) { - this.wheelDeltaAccum = 0; - this.wheelGestureArmed = atBoundary; - } - - if (!this.wheelGestureArmed || !atBoundary) { - this.wheelDeltaAccum = 0; - return; - } - - this.wheelDeltaAccum += e.deltaY; - if (Math.abs(this.wheelDeltaAccum) > 160) { - this.wheelDeltaAccum = 0; - this.wheelGestureArmed = false; - if (goingDown) { - this.goToNextSection(); - } else { - this.goToPrevSection(); } - } - }; + }, { + rootMargin: '-20% 0px -60% 0px', + threshold: 0 + }); - private canInnerScroll(target: HTMLElement | null, goingDown: boolean): boolean { - for (let el = target; el && el !== document.documentElement; el = el.parentElement) { - const overflowY = getComputedStyle(el).overflowY; - if (overflowY !== 'auto' && overflowY !== 'scroll') continue; - if (goingDown ? el.scrollTop + el.clientHeight < el.scrollHeight - 1 : el.scrollTop > 0) { - return true; - } - } - return false; - } - - private onTouchStart = (e: TouchEvent): void => { - if (this.isTransitioning || this.isCurtainVisible()) return; - if (e.touches.length > 0) { - this.touchStartY = e.touches[0].clientY; - this.touchStartX = e.touches[0].clientX; - - const scrollY = window.scrollY || window.pageYOffset; - const maxScroll = Math.max(0, document.documentElement.scrollHeight - window.innerHeight); - const target = e.target as HTMLElement | null; - this.touchStartAtTop = scrollY <= 10 && !this.canInnerScroll(target, false); - this.touchStartAtBottom = scrollY >= maxScroll - 10 && !this.canInnerScroll(target, true); - } - }; - - private onTouchEnd = (e: TouchEvent): void => { - if (this.isTransitioning || this.isCurtainVisible() || e.changedTouches.length === 0) return; - - const target = e.target as HTMLElement | null; - if (target?.closest('.project-detail-overlay')) { - return; - } - - const touchEndY = e.changedTouches[0].clientY; - const touchEndX = e.changedTouches[0].clientX; - const diffY = this.touchStartY - touchEndY; - const diffX = this.touchStartX - touchEndX; - - if (Math.abs(diffY) > 50 && Math.abs(diffY) > Math.abs(diffX) * 1.3) { - if (diffY > 0 && this.touchStartAtBottom) { - this.goToNextSection(); - } else if (diffY < 0 && this.touchStartAtTop) { - this.goToPrevSection(); - } - } - }; - - protected goToNextSection(): void { - const currentIndex = LANDING_SECTIONS.indexOf(this.activeSection()); - if (currentIndex >= 0 && currentIndex < LANDING_SECTIONS.length - 1) { - const next = LANDING_SECTIONS[currentIndex + 1]; - this.setSection(next, 'top'); - } - } - - protected goToPrevSection(): void { - const currentIndex = LANDING_SECTIONS.indexOf(this.activeSection()); - if (currentIndex > 0) { - const prev = LANDING_SECTIONS[currentIndex - 1]; - this.setSection(prev, 'bottom'); - } - } - - private scrollActiveNavIntoView(section: LandingSection): void { - if (typeof window === 'undefined') return; - setTimeout(() => { - if (!this.navContainerRef) return; - const activeEl = this.navContainerRef.nativeElement.querySelector(`[data-nav="${section}"]`); - if (activeEl) { - activeEl.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' }); - } - }, 60); + LANDING_SECTIONS.forEach(id => { + const el = document.getElementById(id); + if (el) this.sectionObserver?.observe(el); + }); } private parseInitialHash(): void { if (typeof window === 'undefined') return; - const hash = window.location.hash.toLowerCase().replace('#', ''); - let targetSection: LandingSection = 'hero'; - if (hash === 'retro' || hash === 'desktop') { - targetSection = 'retro'; - } else if (hash === 'projects' || hash === 'proyectos') { - targetSection = 'projects'; - } else if (hash === 'simulator' || hash === 'simulador') { - targetSection = 'simulator'; - } else if (hash === 'terminal') { - targetSection = 'terminal'; - } else if (hash === 'contact' || hash === 'contacto') { - targetSection = 'contact'; + const hash = window.location.hash.replace('#', '') as LandingSection; + if (LANDING_SECTIONS.includes(hash)) { + setTimeout(() => this.scrollToSection(hash), 120); + } + } + + private scrollActiveNavIntoView(section: LandingSection): void { + if (!this.navContainerRef) return; + const navEl = this.navContainerRef.nativeElement; + const activeBtn = navEl.querySelector(`[data-nav="${section}"]`) as HTMLElement | null; + if (activeBtn) { + activeBtn.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' }); } - this.activeSection.set(targetSection); - this.scrollActiveNavIntoView(targetSection); } private updateClock(): void { - this.currentTime.set(this.timeFormatter.format(new Date())); - } - - ngOnDestroy(): void { - if (this.clockInterval !== null) { - clearInterval(this.clockInterval); - } - if (this.transitionTimer !== null) { - clearTimeout(this.transitionTimer); - } - if (typeof document !== 'undefined') { - document.documentElement.style.overflow = ''; - document.body.style.overflow = ''; - } - if (typeof window !== 'undefined') { - window.removeEventListener('wheel', this.onWheel); - window.removeEventListener('touchstart', this.onTouchStart); - window.removeEventListener('touchend', this.onTouchEnd); - } + const formatter = new Intl.DateTimeFormat('en-GB', { + timeZone: 'America/Guayaquil', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: false + }); + this.currentTime.set(formatter.format(new Date())); } } diff --git a/src/frontend/src/styles.css b/src/frontend/src/styles.css index b256cd4..fb4d194 100644 --- a/src/frontend/src/styles.css +++ b/src/frontend/src/styles.css @@ -120,6 +120,11 @@ padding: 0; } +html { + scroll-behavior: smooth; + scroll-padding-top: 64px; +} + html, body { width: 100%; min-height: 100vh;