From cf0b211dc063fa5f21471cb79058081d82eb1f68 Mon Sep 17 00:00:00 2001 From: Brandon <137568790+Brandondiaz19@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:52:53 -0300 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20a=C3=B1adir=20Motion=20Experience?= =?UTF-8?q?=20V1=20a=20la=20landing=20SPIDOCODE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SimpleLanding.css | 35 ++++++++++++++ src/SimpleLanding.tsx | 109 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 136 insertions(+), 8 deletions(-) diff --git a/src/SimpleLanding.css b/src/SimpleLanding.css index 3be4fc9..f6fb65e 100644 --- a/src/SimpleLanding.css +++ b/src/SimpleLanding.css @@ -1,5 +1,40 @@ /* Simple Lightbot-style Landing Styles for SpidoCode */ +/* Motion Experience V1: contenido visible por defecto, sin capas que intercepten enlaces. */ +.motion-label { position:relative; display:inline-block; } +.motion-label > span:first-child { opacity:0; } +.motion-label-display { position:absolute; inset:0; } +.motion-experience a:focus-visible, +.motion-experience button:focus-visible { outline:3px solid var(--color-soft-green-dark); outline-offset:5px; } +.motion-star-border { position:relative; isolation:isolate; } +.motion-star-border::before { content:''; position:absolute; inset:-2px; border-radius:inherit; padding:2px; pointer-events:none; background:linear-gradient(110deg,#7cbb8944 25%,#b7f5c3aa 45%,#7cbb8944 65%); background-size:300% 100%; mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); mask-composite:exclude; } +@media (prefers-reduced-motion:no-preference) { + .motion-experience .sec-hero-title { animation:motion-hero-title 650ms cubic-bezier(.2,.7,.3,1) both; } + .motion-experience .sec-hero-subtitle { animation:motion-arrive 550ms 120ms ease-out both; } + .motion-experience .sec-hero-actions { animation:motion-arrive 550ms 220ms ease-out both; } + .motion-experience .sec-hero-face-standalone { animation:motion-float 7s ease-in-out infinite; } + .motion-experience .motion-star-border::before { animation:motion-star 6s linear infinite; } + .motion-experience a, + .motion-experience button { transition:background-color 180ms ease,color 180ms ease,box-shadow 180ms ease,transform 180ms ease; } + .motion-experience a:active, + .motion-experience button:active { transform:translateY(1px); } + .motion-experience .sec-hero-copy:focus-within .sec-hero-actions { animation:none; } +} +@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) { + .motion-experience [data-motion-card] { transition:transform 180ms ease-out,box-shadow 180ms ease-out; } + .motion-experience [data-motion-card]:hover { box-shadow:0 12px 26px #16182118; } + .motion-experience [data-motion-card]:focus-within { transform:none !important; } +} +@keyframes motion-hero-title { from { opacity:0; filter:blur(5px); transform:translateY(8px); } to { opacity:1; filter:blur(0); transform:translateY(0); } } +@keyframes motion-arrive { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } } +@keyframes motion-float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-5px); } } +@keyframes motion-star { to { background-position:150% 0; } } +@media (prefers-reduced-motion:reduce) { + .motion-experience { scroll-behavior:auto; } + .motion-experience *, .motion-experience *::before, .motion-experience *::after { animation:none !important; transition:none !important; } + .motion-experience [data-motion-card] { transform:none !important; } +} + :root { --color-light-gray: #9ea0b3; --color-light-bg: #eef1f6; diff --git a/src/SimpleLanding.tsx b/src/SimpleLanding.tsx index de4f7b8..42dd8bb 100644 --- a/src/SimpleLanding.tsx +++ b/src/SimpleLanding.tsx @@ -7,6 +7,36 @@ const BETA_DOWNLOAD_URL = 'https://github.com/SpidoCode/spido-code/releases/download/v1.0.0-beta/SPIDOCODE-Windows-x64-v1.0.0-beta.zip' const BETA_RELEASE_URL = 'https://github.com/SpidoCode/spido-code/releases/tag/v1.0.0-beta' +// El texto real siempre permanece en el árbol accesible; solo cambia su copia decorativa. +function EncryptedLabel({ text }: { text: string }) { + const label = useRef(null) + const [display, setDisplay] = useState(text) + useEffect(() => { + const element = label.current + const reduced = window.matchMedia('(prefers-reduced-motion: reduce)') + if (!element || reduced.matches || !('IntersectionObserver' in window)) return + let timer: ReturnType | undefined + const finish = () => { clearInterval(timer); setDisplay(text) } + const observer = new IntersectionObserver(entries => { + if (!entries.some(entry => entry.isIntersecting)) return + observer.disconnect() + let step = 0 + timer = setInterval(() => { + step += 1 + if (step >= 9) { finish(); return } + setDisplay([...text].map((character, index) => + character === ' ' || index < text.length * step / 9 + ? character : '01<>/+'[(index + step) % 6]).join('')) + }, 45) + }, { threshold: 0.5 }) + const onPreference = () => { if (reduced.matches) { observer.disconnect(); finish() } } + reduced.addEventListener('change', onPreference) + observer.observe(element) + return () => { observer.disconnect(); clearInterval(timer); reduced.removeEventListener('change', onPreference) } + }, [text]) + return {text} +} + // Generador de pintas y destellos verdes neón para la Sección 3 function NeonSpeckles({ count = 16 }: { count?: number }) { const speckles = useMemo( @@ -135,12 +165,75 @@ function Nav() { } export default function SimpleLanding() { + const site = useRef(null) + useEffect(() => { + const root = site.current + if (!root) return + const reduced = window.matchMedia('(prefers-reduced-motion: reduce)') + const pointer = window.matchMedia('(hover: hover) and (pointer: fine)') + const revealed = new WeakSet() + let dispose = () => {} + const setup = () => { + dispose() + if (reduced.matches) { dispose = () => {}; return } + const animations: Animation[] = [] + const cleanups: Array<() => void> = [] + if ('IntersectionObserver' in window && typeof root.animate === 'function') { + const observer = new IntersectionObserver(entries => { + entries.forEach(entry => { + if (!entry.isIntersecting) return + observer.unobserve(entry.target) + if (revealed.has(entry.target)) return + revealed.add(entry.target) + if (entry.target.contains(document.activeElement)) return + animations.push(entry.target.animate([ + { opacity: 0, transform: 'translateY(12px)' }, + { opacity: 1, transform: 'translateY(0)' }, + ], { duration: 520, easing: 'cubic-bezier(.2,.7,.3,1)' })) + }) + }, { threshold: 0.08 }) + root.querySelectorAll('main > section:not(#inicio)').forEach(section => observer.observe(section)) + cleanups.push(() => observer.disconnect()) + } + if (pointer.matches) root.querySelectorAll('[data-motion-card]').forEach(card => { + let frame = 0 + let bounds: DOMRect | undefined + const reset = () => { cancelAnimationFrame(frame); card.style.removeProperty('transform'); bounds = undefined } + const move = (event: PointerEvent) => { + if (event.pointerType !== 'mouse' || card.matches(':focus-within')) return + bounds ??= card.getBoundingClientRect() + const x = Math.max(-1, Math.min(1, (event.clientX - bounds.left) / bounds.width * 2 - 1)) + const y = Math.max(-1, Math.min(1, (event.clientY - bounds.top) / bounds.height * 2 - 1)) + cancelAnimationFrame(frame) + frame = requestAnimationFrame(() => { card.style.transform = `perspective(1000px) rotateX(${-y * 4}deg) rotateY(${x * 4}deg)` }) + } + card.addEventListener('pointermove', move) + card.addEventListener('pointerleave', reset) + card.addEventListener('pointercancel', reset) + card.addEventListener('focusin', reset) + cleanups.push(() => { + reset() + card.removeEventListener('pointermove', move) + card.removeEventListener('pointerleave', reset) + card.removeEventListener('pointercancel', reset) + card.removeEventListener('focusin', reset) + }) + }) + const stopOnFocus = () => animations.forEach(animation => animation.cancel()) + root.addEventListener('focusin', stopOnFocus) + dispose = () => { cleanups.forEach(cleanup => cleanup()); stopOnFocus(); root.removeEventListener('focusin', stopOnFocus) } + } + setup() + reduced.addEventListener('change', setup) + pointer.addEventListener('change', setup) + return () => { dispose(); reduced.removeEventListener('change', setup); pointer.removeEventListener('change', setup) } + }, []) function scrollToTop() { window.scrollTo({ top: 0, behavior: 'smooth' }) } return ( -
+