Subir achivos

This commit is contained in:
Gabriel
2026-10-08 22:12:37 -06:00
parent c326ef5a41
commit 5a78517a68
13 changed files with 324 additions and 50 deletions
+3 -3
View File
@@ -204,7 +204,7 @@ $xmartica_platforms = array(
<?php echo esc_html__( '01 · Soluciones', 'html5blank' ); ?>
</p>
<h2 id="solutions-title" class="m-0 text-[55px] font-semibold leading-[60px] md:text-[46px] md:leading-[50px] sm:text-[38px] sm:leading-[43px]" data-anime-scroll-title data-node-id="332:1156">
<span><?php echo esc_html__( 'Siete ', 'html5blank' ); ?></span><span class="bg-gradient-to-r from-color-2 from-[33.654%] to-white bg-clip-text text-transparent"><?php echo esc_html__( 'áreas de práctica', 'html5blank' ); ?></span><span>.</span>
<span><?php echo esc_html__( 'Siete ', 'html5blank' ); ?></span><span class="bg-gradient-to-r from-color-2 from-[33.654%] to-white bg-clip-text text-transparent" data-anime-title-gradient-continuous><?php echo esc_html__( 'áreas de práctica', 'html5blank' ); ?></span><span>.</span>
</h2>
</div>
<p class="m-0 w-full text-sm font-light leading-normal" data-node-id="332:1157">
@@ -252,7 +252,7 @@ $xmartica_platforms = array(
</p>
<h2 id="platforms-title" class="m-0 text-center text-[55px] font-semibold leading-normal md:text-[44px] md:leading-[49px] sm:text-[36px] sm:leading-[41px]" data-anime-scroll-title data-node-id="332:1008">
<span><?php echo esc_html__( 'Plataformas ', 'html5blank' ); ?></span><span class="bg-gradient-to-r from-color-2 from-[74.519%] to-black bg-clip-text text-transparent"><?php echo esc_html__( 'con las que trabajamos', 'html5blank' ); ?></span><span>.</span>
<span><?php echo esc_html__( 'Plataformas ', 'html5blank' ); ?></span><span class="bg-gradient-to-r from-color-2 from-[74.519%] to-black bg-clip-text text-transparent" data-anime-title-gradient-continuous><?php echo esc_html__( 'con las que trabajamos', 'html5blank' ); ?></span><span>.</span>
</h2>
<p class="m-0 w-[606px] max-w-full text-center text-sm font-light leading-normal" data-node-id="332:1011">
@@ -303,7 +303,7 @@ $xmartica_platforms = array(
</p>
<h2 id="faq-title" class="mb-[50px] mt-[15px] text-center text-[55px] font-semibold leading-[60px] md:text-[46px] md:leading-[50px] sm:text-[38px] sm:leading-[43px]" data-anime-scroll-title data-node-id="332:1004">
<?php echo esc_html__( 'FAQs', 'html5blank' ); ?>
<span class="bg-gradient-to-r from-color-2 to-white bg-clip-text text-transparent" data-anime-title-gradient-continuous><?php echo esc_html__( 'FAQs', 'html5blank' ); ?></span>
</h2>
<div class="home-faq__shortcode w-full max-w-[1080px]" data-node-id="333:3035">
+1
View File
@@ -18,6 +18,7 @@ require_once get_template_directory() . '/parts/animated-background/animated-bac
require_once get_template_directory() . '/parts/spotlight-cursor/spotlight-cursor.php';
require_once get_template_directory() . '/parts/solutions-title-animation/solutions-title-animation.php';
require_once get_template_directory() . '/parts/practice-card-tilt/practice-card-tilt.php';
require_once get_template_directory() . '/parts/platform-card-tilt/platform-card-tilt.php';
/*------------------------------------*\
Theme Support
+2 -2
View File
@@ -95,10 +95,10 @@ $xmartica_header_service_links = array(
<ul class="xmartica-menu flex items-center gap-2.5 lg:w-full lg:flex-col lg:items-stretch lg:gap-1">
<li class="xmartica-menu__solutions menu-item-has-children">
<a href="<?php echo esc_url( home_url( '/#soluciones' ) ); ?>" aria-haspopup="true"><?php echo esc_html__( 'Soluciones', 'html5blank' ); ?></a>
<button class="xmartica-menu__submenu-toggle" type="button" aria-expanded="false" aria-controls="xmartica-solutions-submenu" aria-label="<?php echo esc_attr__( 'Mostrar soluciones', 'html5blank' ); ?>">
<button class="xmartica-menu__submenu-toggle" type="button" aria-expanded="true" aria-controls="xmartica-solutions-submenu" aria-label="<?php echo esc_attr__( 'Ocultar soluciones', 'html5blank' ); ?>">
<svg viewBox="0 0 12 8" width="12" height="8" aria-hidden="true" focusable="false"><path d="M1 1.25 6 6.25l5-5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></svg>
</button>
<ul id="xmartica-solutions-submenu" class="xmartica-menu__submenu" aria-label="<?php echo esc_attr__( 'Soluciones', 'html5blank' ); ?>">
<ul id="xmartica-solutions-submenu" class="xmartica-menu__submenu is-open" aria-label="<?php echo esc_attr__( 'Soluciones', 'html5blank' ); ?>">
<?php foreach ( $xmartica_header_service_links as $xmartica_header_service_link ) : ?>
<li>
<a href="<?php echo esc_url( home_url( $xmartica_header_service_link['path'] ) ); ?>"><?php echo esc_html( $xmartica_header_service_link['label'] ); ?></a>
+4
View File
@@ -28,6 +28,10 @@ document.addEventListener('DOMContentLoaded', function () {
toggle.classList.toggle('is-open', isOpen);
toggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
toggle.setAttribute('aria-label', isOpen ? 'Cerrar menú' : 'Abrir menú');
if (isOpen && window.innerWidth <= mobileBreakpoint) {
setSubmenuState(true);
}
}
function closeMenu() {
@@ -0,0 +1,48 @@
#tecnologias .platform-marquee__group {
perspective: 900px;
perspective-origin: center;
}
#tecnologias .platform-marquee__card {
position: relative;
z-index: 1;
overflow: hidden;
transform-style: preserve-3d;
transform-origin: center;
backface-visibility: hidden;
background:
linear-gradient(#f8fdff, #f8fdff) padding-box,
linear-gradient(135deg, #00acff 0%, rgba(79, 172, 217, 0.22) 35%, rgba(79, 172, 217, 0.3) 68%, #00acff 100%) border-box;
box-shadow: 0 8px 24px rgba(18, 69, 100, 0.08);
}
#tecnologias .platform-marquee__card.platform-card-tilt-ready {
will-change: transform;
}
#tecnologias .platform-marquee__card:hover,
#tecnologias .platform-marquee__card.is-platform-tilting {
z-index: 4;
}
#tecnologias .platform-marquee__logo {
position: relative;
z-index: 3;
transform: translateZ(18px);
transition: transform 260ms ease;
}
#tecnologias .platform-marquee__card:hover .platform-marquee__logo,
#tecnologias .platform-marquee__card.is-platform-tilting .platform-marquee__logo {
transform: translateZ(28px) scale(1.035);
}
@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
#tecnologias .platform-marquee__card {
transform: none !important;
}
#tecnologias .platform-marquee__logo {
transform: none;
}
}
@@ -0,0 +1,74 @@
import { animate } from '../../assets/vendor/animejs/modules/animation/index.js';
import { remove, set } from '../../assets/vendor/animejs/modules/utils/index.js';
const cards = document.querySelectorAll('#tecnologias .platform-marquee__card');
const canTilt = window.matchMedia('(hover: hover) and (pointer: fine)').matches;
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (cards.length && canTilt && !reduceMotion) {
cards.forEach((card) => {
const maxRotation = 7;
let bounds = null;
let frame = 0;
let pointerX = 0;
let pointerY = 0;
set(card, { rotateX: 0, rotateY: 0, scale: 1 });
card.classList.add('platform-card-tilt-ready');
const renderTilt = () => {
frame = 0;
if (!bounds) {
return;
}
const normalizedX = Math.max(-1, Math.min(1, ((pointerX - bounds.left) / bounds.width) * 2 - 1));
const normalizedY = Math.max(-1, Math.min(1, ((pointerY - bounds.top) / bounds.height) * 2 - 1));
remove(card);
animate(card, {
rotateX: normalizedY * -maxRotation,
rotateY: normalizedX * maxRotation,
scale: 1.055,
duration: 320,
ease: 'out(3)',
});
};
card.addEventListener('pointerenter', (event) => {
bounds = card.getBoundingClientRect();
pointerX = event.clientX;
pointerY = event.clientY;
card.classList.add('is-platform-tilting');
renderTilt();
});
card.addEventListener('pointermove', (event) => {
pointerX = event.clientX;
pointerY = event.clientY;
if (!frame) {
frame = window.requestAnimationFrame(renderTilt);
}
});
card.addEventListener('pointerleave', () => {
if (frame) {
window.cancelAnimationFrame(frame);
frame = 0;
}
bounds = null;
card.classList.remove('is-platform-tilting');
remove(card);
animate(card, {
rotateX: 0,
rotateY: 0,
scale: 1,
duration: 620,
ease: 'out(4)',
});
});
});
}
@@ -0,0 +1,42 @@
<?php
/**
* Anime.js tilt interaction for the front-page platform cards.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function xmartica_platform_card_tilt_assets() {
if ( ! is_front_page() ) {
return;
}
$dir = get_template_directory() . '/parts/platform-card-tilt';
$uri = get_template_directory_uri() . '/parts/platform-card-tilt';
wp_enqueue_style(
'xmartica-platform-card-tilt',
$uri . '/platform-card-tilt.css',
array(),
filemtime( $dir . '/platform-card-tilt.css' )
);
wp_enqueue_script(
'xmartica-platform-card-tilt',
$uri . '/platform-card-tilt.js',
array(),
filemtime( $dir . '/platform-card-tilt.js' ),
true
);
}
add_action( 'wp_enqueue_scripts', 'xmartica_platform_card_tilt_assets' );
function xmartica_platform_card_tilt_module_tag( $tag, $handle, $src ) {
if ( 'xmartica-platform-card-tilt' !== $handle ) {
return $tag;
}
return '<script type="module" src="' . esc_url( $src ) . '"></script>';
}
add_filter( 'script_loader_tag', 'xmartica_platform_card_tilt_module_tag', 10, 3 );
@@ -20,58 +20,51 @@
#soluciones [data-practice-card-tilt]:focus-within {
border-color: #fff;
box-shadow: 0 18px 46px rgba(0, 172, 255, 0.16);
background-color: rgba(14, 27, 45, 0.2);
-webkit-backdrop-filter: blur(18px) saturate(125%);
backdrop-filter: blur(18px) saturate(125%);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.22),
0 18px 46px rgba(0, 172, 255, 0.16);
}
#soluciones [data-practice-card-tilt] {
--practice-glare-x: 50%;
--practice-glare-y: 50%;
position: relative;
background-color: #0e1b2d;
background-image: linear-gradient(121.587deg, rgba(79, 172, 217, 0.5) 3.4209%, rgba(0, 0, 0, 0.5) 122.06%);
-webkit-backdrop-filter: blur(0) saturate(100%);
backdrop-filter: blur(0) saturate(100%);
box-shadow: none;
transform-style: preserve-3d;
transform-origin: center;
backface-visibility: hidden;
z-index: 1;
transition: border-color 260ms ease, box-shadow 260ms ease;
}
#soluciones [data-practice-card-tilt]::after {
content: "";
position: absolute;
inset: 0;
z-index: 2;
border-radius: inherit;
background: radial-gradient(
circle at var(--practice-glare-x) var(--practice-glare-y),
rgba(157, 225, 255, 0.2) 0%,
rgba(79, 172, 217, 0.08) 26%,
transparent 58%
);
opacity: 0;
pointer-events: none;
transition: opacity 260ms ease;
transition:
border-color 260ms ease,
box-shadow 260ms ease,
background-color 260ms ease,
-webkit-backdrop-filter 260ms ease,
backdrop-filter 260ms ease;
}
#soluciones [data-practice-card-tilt].practice-card-tilt-ready {
will-change: transform;
}
#soluciones [data-practice-card-tilt].is-tilting::after {
opacity: 1;
}
#soluciones [data-practice-card-tilt]:hover,
#soluciones [data-practice-card-tilt].is-tilting {
z-index: 3;
border-color: #fff;
box-shadow: 0 18px 46px rgba(0, 172, 255, 0.16);
background-color: rgba(14, 27, 45, 0.2);
-webkit-backdrop-filter: blur(18px) saturate(125%);
backdrop-filter: blur(18px) saturate(125%);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.22),
0 18px 46px rgba(0, 172, 255, 0.16);
}
@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
#soluciones [data-practice-card-tilt] {
transform: none !important;
}
#soluciones [data-practice-card-tilt]::after {
display: none;
}
}
@@ -23,8 +23,6 @@ if (cards.length && canTilt && !reduceMotion) {
const rotateX = normalizedY * -maxRotation;
const rotateY = normalizedX * maxRotation;
card.style.setProperty('--practice-glare-x', `${((normalizedX + 1) / 2) * 100}%`);
card.style.setProperty('--practice-glare-y', `${((normalizedY + 1) / 2) * 100}%`);
remove(card);
animate(card, {
rotateX,
@@ -11,6 +11,10 @@
color: transparent;
}
[data-anime-scroll-title] [data-anime-title-gradient-continuous] [data-word] {
background-repeat: no-repeat;
}
@media (prefers-reduced-motion: reduce) {
[data-anime-scroll-title] [data-word] {
opacity: 1 !important;
@@ -12,6 +12,7 @@ if (titles.length && !reduceMotion) {
return {
index,
backgroundImage: window.getComputedStyle(element).backgroundImage,
continuous: element.hasAttribute('data-anime-title-gradient-continuous'),
};
});
@@ -30,11 +31,41 @@ if (titles.length && !reduceMotion) {
title.classList.add('anime-scroll-title-ready');
gradientSources.forEach((gradient) => {
title.querySelectorAll(`[data-anime-title-gradient="${gradient.index}"] [data-word]`).forEach((word) => {
word.style.backgroundImage = gradient.backgroundImage;
const applyTitleGradients = () => {
gradientSources.forEach((gradient) => {
const gradientElement = Array.from(
title.querySelectorAll(`[data-anime-title-gradient="${gradient.index}"]`)
).find((element) => element.querySelector('[data-word]'));
if (!gradientElement) {
return;
}
const gradientRect = gradientElement.getBoundingClientRect();
gradientElement.querySelectorAll('[data-word]').forEach((word) => {
word.style.backgroundImage = gradient.backgroundImage;
if (!gradient.continuous || gradientRect.width <= 0) {
return;
}
const wordRect = word.getBoundingClientRect();
word.style.backgroundSize = `${gradientRect.width}px 100%`;
word.style.backgroundPosition = `${gradientRect.left - wordRect.left}px 0`;
word.style.backgroundRepeat = 'no-repeat';
});
});
});
};
applyTitleGradients();
if ('ResizeObserver' in window && gradientSources.some((gradient) => gradient.continuous)) {
const gradientResizeObserver = new ResizeObserver(() => {
window.requestAnimationFrame(applyTitleGradients);
});
gradientResizeObserver.observe(title);
}
set(words, { opacity: 0, y: '110%' });
@@ -4,10 +4,71 @@
position: fixed;
top: 0;
left: 0;
z-index: 9999;
z-index: 20;
width: 100%;
height: 100%;
opacity: 1;
pointer-events: none;
transition: opacity 120ms ease;
}
.spotlight-cursor.is-hidden {
opacity: 0;
}
/* The ambient background stylesheet gives <main> its own stacking context.
Release it on the front page so text can sit above this fixed overlay while
section backgrounds remain below it. */
body.front-page > main,
body.front-page > footer {
z-index: auto;
}
/* Keep readable front-page content above the light while the transparent space
around it still lets the spotlight illuminate backgrounds and media. */
body.front-page #primary :where(h1, h2, h3, h4, h5, h6, p, a, button, label, li, dt, dd, figcaption, blockquote, legend, summary, small, strong, em, b, span, input, textarea, select),
body.front-page > footer :where(h1, h2, h3, h4, h5, h6, p, a, button, label, li, dt, dd, figcaption, blockquote, legend, summary, small, strong, em, b, span, input, textarea, select) {
position: relative;
z-index: 21;
}
/* Tailwind's `isolate`, the hero copy layers and sticky positioning create
nested stacking contexts. Flatten/raise those specific contexts so their
text is not tinted when the spotlight passes underneath. */
body.front-page .home-hero {
isolation: auto;
}
body.front-page .home-hero__background {
z-index: 0 !important;
}
body.front-page .home-hero__copy {
isolation: auto;
}
body.front-page .home-hero__copy > :not(.home-hero__copy-glow),
body.front-page .home-hero__metrics {
position: relative;
z-index: 21;
}
body.front-page #soluciones > div > .sticky {
z-index: 21;
}
body.front-page #soluciones .practice-card-list {
position: relative;
z-index: 21;
}
body.front-page #soluciones [data-practice-card-tilt] {
z-index: 21 !important;
}
body.front-page #soluciones [data-practice-card-tilt]:hover,
body.front-page #soluciones [data-practice-card-tilt].is-tilting {
z-index: 23 !important;
}
.spotlight-cursor canvas {
@@ -5,7 +5,7 @@
return;
}
var spotlightSize = 150;
var spotlightSize = 250;
var fadeSpeed = 0.95;
var pulseSpeed = 3200;
@@ -20,6 +20,7 @@
var ctx = canvas.getContext('2d');
var spotlightPos = { x: window.innerWidth / 2, y: window.innerHeight / 2 };
var targetPos = { x: spotlightPos.x, y: spotlightPos.y };
var lastVisibilityCheck = 0;
function resizeCanvas() {
canvas.width = window.innerWidth;
@@ -33,9 +34,25 @@
function handleMouseMove(event) {
targetPos.x = event.clientX;
targetPos.y = event.clientY;
updateSpotlightVisibility(event.target);
}
function render() {
function updateSpotlightVisibility(target) {
var isOverExcludedSection = target instanceof Element && Boolean(target.closest('#tecnologias'));
root.classList.toggle('is-hidden', isOverExcludedSection);
}
function updateSpotlightVisibilityAtCursor() {
updateSpotlightVisibility(document.elementFromPoint(targetPos.x, targetPos.y));
}
function render(timestamp) {
if (timestamp - lastVisibilityCheck >= 120) {
updateSpotlightVisibilityAtCursor();
lastVisibilityCheck = timestamp;
}
spotlightPos.x = lerp(spotlightPos.x, targetPos.x, fadeSpeed);
spotlightPos.y = lerp(spotlightPos.y, targetPos.y, fadeSpeed);
@@ -53,11 +70,11 @@
currentSpotlightSize * 1.25
);
glowGradient.addColorStop(0, 'rgba(40, 90, 155, 0.58)');
glowGradient.addColorStop(0.24, 'rgba(39, 87, 148, 0.46)');
glowGradient.addColorStop(0.5, 'rgba(33, 73, 125, 0.31)');
glowGradient.addColorStop(0.74, 'rgba(27, 54, 90, 0.17)');
glowGradient.addColorStop(1, 'rgba(21, 39, 66, 0)');
glowGradient.addColorStop(0, 'rgba(0, 166, 255, 0.68)');
glowGradient.addColorStop(0.24, 'rgba(0, 145, 242, 0.55)');
glowGradient.addColorStop(0.5, 'rgba(0, 116, 214, 0.38)');
glowGradient.addColorStop(0.74, 'rgba(0, 88, 174, 0.19)');
glowGradient.addColorStop(1, 'rgba(0, 70, 145, 0)');
ctx.fillStyle = glowGradient;
ctx.beginPath();
ctx.arc(spotlightPos.x, spotlightPos.y, currentSpotlightSize * 1.25, 0, Math.PI * 2);
@@ -68,6 +85,7 @@
resizeCanvas();
window.addEventListener('resize', resizeCanvas);
window.addEventListener('scroll', updateSpotlightVisibilityAtCursor, { passive: true });
document.addEventListener('mousemove', handleMouseMove);
render();
window.requestAnimationFrame(render);
}());