efecto fluid
This commit is contained in:
@@ -9,6 +9,9 @@
|
|||||||
<link rel="stylesheet" href="style/main.css">
|
<link rel="stylesheet" href="style/main.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="fluid-bg" aria-hidden="true">
|
||||||
|
<canvas id="fluidCanvas"></canvas>
|
||||||
|
</div>
|
||||||
<div id="menu-container"></div>
|
<div id="menu-container"></div>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|||||||
+8
-9
@@ -16,7 +16,7 @@
|
|||||||
<!-- SECCIÓN 1: HERO / FILOSOFÍA -->
|
<!-- SECCIÓN 1: HERO / FILOSOFÍA -->
|
||||||
<section class="hero-section nosotros-hero">
|
<section class="hero-section nosotros-hero">
|
||||||
<div class="hero-content">
|
<div class="hero-content">
|
||||||
<h1 class="hero-title">Amor & Roma</h1>
|
<h1 class="hero-title">Amor&Roma</h1>
|
||||||
<p class="hero-subtitle">
|
<p class="hero-subtitle">
|
||||||
No somos una agencia tradicional. <br>Combinamos el arte del marketing digital con la ciencia de los datos.
|
No somos una agencia tradicional. <br>Combinamos el arte del marketing digital con la ciencia de los datos.
|
||||||
</p>
|
</p>
|
||||||
@@ -38,13 +38,13 @@
|
|||||||
<div class="card-icon icon-amor"></div>
|
<div class="card-icon icon-amor"></div>
|
||||||
<h3>Amor</h3>
|
<h3>Amor</h3>
|
||||||
<span class="card-tag">La Pasión y el Arte</span>
|
<span class="card-tag">La Pasión y el Arte</span>
|
||||||
<p>Representa la chispa creativa, la intuición visual, la dirección de arte meticulosa, la empatía con la visión del cliente y la estética no negociable. Es el alma y la identidad de cada marca.</p>
|
<p>Representa el instinto creativo, la intuición visual, la dirección de arte meticulosa, la empatía con la visión del cliente y la estética no negociable. <br>Es el alma y la identidad de cada marca.</p>
|
||||||
</article>
|
</article>
|
||||||
<article class="dualidad-card card-roma">
|
<article class="dualidad-card card-roma">
|
||||||
<div class="card-icon icon-roma"></div>
|
<div class="card-icon icon-roma"></div>
|
||||||
<h3>Roma</h3>
|
<h3>Roma</h3>
|
||||||
<span class="card-tag">La Construcción y la Estructura</span>
|
<span class="card-tag">La Construcción y la Estructura</span>
|
||||||
<p>Representa la arquitectura, la solidez, la ingeniería de procesos, la estrategia a largo plazo y la infraestructura digital orientada a resultados. Es el imperio que sostiene esa visión.</p>
|
<p>Representa la arquitectura, el método, la ingeniería de procesos, la estrategia a largo plazo y la infraestructura digital orientada a resultados. <br>Es el imperio que sostiene esa visión.</p>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -77,8 +77,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="equipo-colaboradores">
|
<p class="equipo-colaboradores">
|
||||||
Como todo equipo en crecimiento, sumamos colaboradores según el proyecto — diseñadores, redactores y especialistas que se suman cuando hace falta.
|
Trabajamos en equipo ayudando a las PyMEs a competir y crecer. </p>
|
||||||
</p>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- SECCIÓN 3: PRINCIPIOS BOUTIQUE -->
|
<!-- SECCIÓN 3: PRINCIPIOS BOUTIQUE -->
|
||||||
@@ -172,7 +171,7 @@
|
|||||||
<!-- ARQUETIPO 1 -->
|
<!-- ARQUETIPO 1 -->
|
||||||
<article class="caso-card">
|
<article class="caso-card">
|
||||||
<div class="caso-header">
|
<div class="caso-header">
|
||||||
<span class="caso-badge">Arquetipo 1</span>
|
<span class="caso-badge">Mordi - El mundo en un bocado</span>
|
||||||
<h3 class="caso-titulo">Identidad Integral</h3>
|
<h3 class="caso-titulo">Identidad Integral</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="caso-descripcion">Desarrollo de marca completo, mascota propia y administración continua de redes.</p>
|
<p class="caso-descripcion">Desarrollo de marca completo, mascota propia y administración continua de redes.</p>
|
||||||
@@ -184,7 +183,7 @@
|
|||||||
<!-- ARQUETIPO 2 -->
|
<!-- ARQUETIPO 2 -->
|
||||||
<article class="caso-card">
|
<article class="caso-card">
|
||||||
<div class="caso-header">
|
<div class="caso-header">
|
||||||
<span class="caso-badge">Arquetipo 2</span>
|
<span class="caso-badge">ArWorks - higiene y seguridad</span>
|
||||||
<h3 class="caso-titulo">Infraestructura B2B</h3>
|
<h3 class="caso-titulo">Infraestructura B2B</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="caso-descripcion">Consultora de Seguridad: Sitio web corporativo a medida y arquitectura sobria.</p>
|
<p class="caso-descripcion">Consultora de Seguridad: Sitio web corporativo a medida y arquitectura sobria.</p>
|
||||||
@@ -196,7 +195,7 @@
|
|||||||
<!-- ARQUETIPO 3 (INSÍGNIA) -->
|
<!-- ARQUETIPO 3 (INSÍGNIA) -->
|
||||||
<article class="caso-card caso-insignia">
|
<article class="caso-card caso-insignia">
|
||||||
<div class="caso-header">
|
<div class="caso-header">
|
||||||
<span class="caso-badge caso-badge-insignia">Arquetipo 3 (Insígnia)</span>
|
<span class="caso-badge caso-badge-insignia">vetta io</span>
|
||||||
<h3 class="caso-titulo">Ecosistema Digital Completo</h3>
|
<h3 class="caso-titulo">Ecosistema Digital Completo</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="caso-descripcion">Empresa de Tecnología: Branding + Web a medida + RRSS activas.</p>
|
<p class="caso-descripcion">Empresa de Tecnología: Branding + Web a medida + RRSS activas.</p>
|
||||||
@@ -208,7 +207,7 @@
|
|||||||
<!-- ARQUETIPO 4 -->
|
<!-- ARQUETIPO 4 -->
|
||||||
<article class="caso-card">
|
<article class="caso-card">
|
||||||
<div class="caso-header">
|
<div class="caso-header">
|
||||||
<span class="caso-badge">Arquetipo 4</span>
|
<span class="caso-badge">ide - consultores</span>
|
||||||
<h3 class="caso-titulo">Profesionalización de Servicios</h3>
|
<h3 class="caso-titulo">Profesionalización de Servicios</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="caso-descripcion">Consultores Independientes: Web a medida + Gestión estratégica de RRSS.</p>
|
<p class="caso-descripcion">Consultores Independientes: Web a medida + Gestión estratégica de RRSS.</p>
|
||||||
|
|||||||
+217
-239
@@ -11,22 +11,66 @@ const config = {
|
|||||||
SPLAT_RADIUS: 0.003
|
SPLAT_RADIUS: 0.003
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ===== COLORES DE MARCA (Modo Claro / Oscuro) =====
|
||||||
|
function getBrandColors() {
|
||||||
|
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||||
|
if (isDark) {
|
||||||
|
// Tonos luminiscentes y vibrantes para contrastar sobre #110916
|
||||||
|
return [
|
||||||
|
[0.920, 0.120, 0.420], // Carmesí brillante (#EA1E6B)
|
||||||
|
[0.050, 0.680, 0.780], // Teal cian luminoso (#0DAEC7)
|
||||||
|
[0.850, 0.550, 0.700] // Rosa suave (#D98CB3)
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
// Tonos puros y elegantes para teñir el fondo claro sin ensuciarlo
|
||||||
|
return [
|
||||||
|
[0.729, 0.071, 0.302], // Bordo de marca (#BA124D)
|
||||||
|
[0.000, 0.320, 0.420], // Teal medio (#00526B)
|
||||||
|
[0.780, 0.280, 0.400] // Rosa carmesí (#C74766)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let brandColors = getBrandColors();
|
||||||
|
let currentColor = brandColors[0];
|
||||||
|
let targetColor = brandColors[1];
|
||||||
|
let transitionProgress = 0;
|
||||||
|
const transitionSpeed = 0.008;
|
||||||
|
|
||||||
|
// Observar cambios de tema: actualiza paleta y reinicia transición de color.
|
||||||
|
// El fondo CSS cambia automáticamente (el canvas es transparente, el fondo del <html> se ve a través).
|
||||||
|
const themeObserver = new MutationObserver(() => {
|
||||||
|
brandColors = getBrandColors();
|
||||||
|
currentColor = brandColors[0];
|
||||||
|
targetColor = brandColors[1];
|
||||||
|
transitionProgress = 0;
|
||||||
|
});
|
||||||
|
themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });
|
||||||
|
|
||||||
|
function lerpColor(colorA, colorB, t) {
|
||||||
|
return [
|
||||||
|
colorA[0] + (colorB[0] - colorA[0]) * t,
|
||||||
|
colorA[1] + (colorB[1] - colorA[1]) * t,
|
||||||
|
colorA[2] + (colorB[2] - colorA[2]) * t
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
// ===== INICIALIZAR CANVAS =====
|
// ===== INICIALIZAR CANVAS =====
|
||||||
let canvas = document.getElementById("fluidCanvas");
|
let canvas = document.getElementById("fluidCanvas");
|
||||||
console.log("Canvas encontrado:", canvas);
|
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
console.error("ERROR: No se encontró el canvas con id 'fluidCanvas'");
|
console.error("ERROR: No se encontró el canvas con id 'fluidCanvas'");
|
||||||
|
} else {
|
||||||
|
canvas.width = window.innerWidth;
|
||||||
|
canvas.height = window.innerHeight;
|
||||||
}
|
}
|
||||||
canvas.width = window.innerWidth;
|
|
||||||
canvas.height = window.innerHeight;
|
|
||||||
|
|
||||||
// ===== CONTEXTO WEBGL =====
|
// ===== CONTEXTO WEBGL =====
|
||||||
let pointers = [];
|
let pointers = [];
|
||||||
let splatStack = [];
|
|
||||||
|
|
||||||
function getWebGLContext(canvas) {
|
function getWebGLContext(canvas) {
|
||||||
let params = {
|
let params = {
|
||||||
alpha: false,
|
alpha: true, // Canvas transparente: el fondo CSS se ve a través
|
||||||
|
premultipliedAlpha: false, // CLAVE: colores sin premultiplicar para composición correcta
|
||||||
depth: false,
|
depth: false,
|
||||||
stencil: false,
|
stencil: false,
|
||||||
antialias: false
|
antialias: false
|
||||||
@@ -34,20 +78,23 @@ function getWebGLContext(canvas) {
|
|||||||
let gl = canvas.getContext("webgl2", params);
|
let gl = canvas.getContext("webgl2", params);
|
||||||
let isWebGL2 = !!gl;
|
let isWebGL2 = !!gl;
|
||||||
if (!isWebGL2)
|
if (!isWebGL2)
|
||||||
gl =
|
gl = canvas.getContext("webgl", params) || canvas.getContext("experimental-webgl", params);
|
||||||
canvas.getContext("webgl", params) ||
|
|
||||||
canvas.getContext("experimental-webgl", params);
|
|
||||||
let halfFloat = gl.getExtension("OES_texture_half_float");
|
let halfFloat = gl.getExtension("OES_texture_half_float");
|
||||||
let support_linear_float = gl.getExtension("OES_texture_half_float_linear");
|
let support_linear_float = gl.getExtension("OES_texture_half_float_linear");
|
||||||
if (isWebGL2) {
|
if (isWebGL2) {
|
||||||
gl.getExtension("EXT_color_buffer_float");
|
gl.getExtension("EXT_color_buffer_float");
|
||||||
support_linear_float = gl.getExtension("OES_texture_float_linear");
|
support_linear_float = gl.getExtension("OES_texture_float_linear");
|
||||||
}
|
}
|
||||||
gl.clearColor(0.0, 0.0, 0.0, 1.0);
|
|
||||||
|
// ✅ CLAVE: Fondo transparente para que se vea el color del body
|
||||||
|
gl.clearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
|
|
||||||
let internalFormat = isWebGL2 ? gl.RGBA16F : gl.RGBA;
|
let internalFormat = isWebGL2 ? gl.RGBA16F : gl.RGBA;
|
||||||
let internalFormatRG = isWebGL2 ? gl.RG16F : gl.RGBA;
|
let internalFormatRG = isWebGL2 ? gl.RG16F : gl.RGBA;
|
||||||
let formatRG = isWebGL2 ? gl.RG : gl.RGBA;
|
let formatRG = isWebGL2 ? gl.RG : gl.RGBA;
|
||||||
let texType = isWebGL2 ? gl.HALF_FLOAT : halfFloat.HALF_FLOAT_OES;
|
let texType = isWebGL2 ? gl.HALF_FLOAT : halfFloat.HALF_FLOAT_OES;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
gl: gl,
|
gl: gl,
|
||||||
ext: {
|
ext: {
|
||||||
@@ -74,29 +121,24 @@ function pointerPrototype() {
|
|||||||
this.dy = 0;
|
this.dy = 0;
|
||||||
this.down = false;
|
this.down = false;
|
||||||
this.moved = false;
|
this.moved = false;
|
||||||
this.color = [30, 0, 300];
|
this.color = [0.729, 0.071, 0.302];
|
||||||
}
|
}
|
||||||
pointers.push(new pointerPrototype());
|
pointers.push(new pointerPrototype());
|
||||||
|
|
||||||
// ===== SHADERS =====
|
// ===== SHADERS =====
|
||||||
let GLProgram = (function () {
|
let GLProgram = (function () {
|
||||||
function GLProgram(vertexShader, fragmentShader) {
|
function GLProgram(vertexShader, fragmentShader) {
|
||||||
if (!(this instanceof GLProgram))
|
if (!(this instanceof GLProgram)) throw new TypeError("Cannot call a class as a function");
|
||||||
throw new TypeError("Cannot call a class as a function");
|
|
||||||
this.uniforms = {};
|
this.uniforms = {};
|
||||||
this.program = gl.createProgram();
|
this.program = gl.createProgram();
|
||||||
gl.attachShader(this.program, vertexShader);
|
gl.attachShader(this.program, vertexShader);
|
||||||
gl.attachShader(this.program, fragmentShader);
|
gl.attachShader(this.program, fragmentShader);
|
||||||
gl.linkProgram(this.program);
|
gl.linkProgram(this.program);
|
||||||
if (!gl.getProgramParameter(this.program, gl.LINK_STATUS))
|
if (!gl.getProgramParameter(this.program, gl.LINK_STATUS)) throw gl.getProgramInfoLog(this.program);
|
||||||
throw gl.getProgramInfoLog(this.program);
|
|
||||||
let uniformCount = gl.getProgramParameter(this.program, gl.ACTIVE_UNIFORMS);
|
let uniformCount = gl.getProgramParameter(this.program, gl.ACTIVE_UNIFORMS);
|
||||||
for (let i = 0; i < uniformCount; i++) {
|
for (let i = 0; i < uniformCount; i++) {
|
||||||
let uniformName = gl.getActiveUniform(this.program, i).name;
|
let uniformName = gl.getActiveUniform(this.program, i).name;
|
||||||
this.uniforms[uniformName] = gl.getUniformLocation(
|
this.uniforms[uniformName] = gl.getUniformLocation(this.program, uniformName);
|
||||||
this.program,
|
|
||||||
uniformName
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GLProgram.prototype.bind = function bind() {
|
GLProgram.prototype.bind = function bind() {
|
||||||
@@ -109,66 +151,90 @@ function compileShader(type, source) {
|
|||||||
let shader = gl.createShader(type);
|
let shader = gl.createShader(type);
|
||||||
gl.shaderSource(shader, source);
|
gl.shaderSource(shader, source);
|
||||||
gl.compileShader(shader);
|
gl.compileShader(shader);
|
||||||
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))
|
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw gl.getShaderInfoLog(shader);
|
||||||
throw gl.getShaderInfoLog(shader);
|
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== VERTEX SHADER =====
|
|
||||||
let baseVertexShader = compileShader(
|
let baseVertexShader = compileShader(
|
||||||
gl.VERTEX_SHADER,
|
gl.VERTEX_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; attribute vec2 aPosition; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform vec2 texelSize; void main () { vUv = aPosition * 0.5 + 0.5; vL = vUv - vec2(texelSize.x, 0.0); vR = vUv + vec2(texelSize.x, 0.0); vT = vUv + vec2(0.0, texelSize.y); vB = vUv - vec2(0.0, texelSize.y); gl_Position = vec4(aPosition, 0.0, 1.0); }"
|
"precision highp float; precision mediump sampler2D; attribute vec2 aPosition; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform vec2 texelSize; void main () { vUv = aPosition * 0.5 + 0.5; vL = vUv - vec2(texelSize.x, 0.0); vR = vUv + vec2(texelSize.x, 0.0); vT = vUv + vec2(0.0, texelSize.y); vB = vUv - vec2(0.0, texelSize.y); gl_Position = vec4(aPosition, 0.0, 1.0); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
// ===== FRAGMENT SHADERS =====
|
|
||||||
let clearShader = compileShader(
|
let clearShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uTexture; uniform float value; void main () { gl_FragColor = value * texture2D(uTexture, vUv); }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uTexture; uniform float value; void main () { gl_FragColor = value * texture2D(uTexture, vUv); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
let displayShader = compileShader(
|
let displayShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uTexture; void main () { gl_FragColor = texture2D(uTexture, vUv); }"
|
`precision highp float;
|
||||||
|
precision mediump sampler2D;
|
||||||
|
varying vec2 vUv;
|
||||||
|
uniform sampler2D uTexture;
|
||||||
|
uniform float uIsDark;
|
||||||
|
|
||||||
|
void main () {
|
||||||
|
vec4 c = texture2D(uTexture, vUv);
|
||||||
|
float maxC = max(c.r, max(c.g, c.b));
|
||||||
|
if (maxC < 0.001) {
|
||||||
|
gl_FragColor = vec4(0.0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Normalizamos el tono cromático para conservar la saturación original
|
||||||
|
vec3 nColor = c.rgb / maxC;
|
||||||
|
|
||||||
|
if (uIsDark > 0.5) {
|
||||||
|
// MODO OSCURO: fluido con mayor presencia y brillo
|
||||||
|
float alpha = clamp(maxC * 2.5, 0.0, 0.70);
|
||||||
|
vec3 glow = clamp(nColor * 1.2, 0.0, 1.0);
|
||||||
|
gl_FragColor = vec4(glow, alpha);
|
||||||
|
} else {
|
||||||
|
// MODO CLARO: tinte traslúcido suave que no satura el fondo sage-light
|
||||||
|
float alpha = clamp(maxC * 1.5, 0.0, 0.35);
|
||||||
|
gl_FragColor = vec4(nColor, alpha);
|
||||||
|
}
|
||||||
|
}`
|
||||||
);
|
);
|
||||||
|
|
||||||
let splatShader = compileShader(
|
let splatShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uTarget; uniform float aspectRatio; uniform vec3 color; uniform vec2 point; uniform float radius; void main () { vec2 p = vUv - point.xy; p.x *= aspectRatio; vec3 splat = exp(-dot(p, p) / radius) * color; vec3 base = texture2D(uTarget, vUv).xyz; gl_FragColor = vec4(base + splat, 1.0); }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uTarget; uniform float aspectRatio; uniform vec3 color; uniform vec2 point; uniform float radius; void main () { vec2 p = vUv - point.xy; p.x *= aspectRatio; vec3 splat = exp(-dot(p, p) / radius) * color; vec3 base = texture2D(uTarget, vUv).xyz; gl_FragColor = vec4(base + splat, 1.0); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
let advectionManualFilteringShader = compileShader(
|
let advectionManualFilteringShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uVelocity; uniform sampler2D uSource; uniform vec2 texelSize; uniform float dt; uniform float dissipation; vec4 bilerp (in sampler2D sam, in vec2 p) { vec4 st; st.xy = floor(p - 0.5) + 0.5; st.zw = st.xy + 1.0; vec4 uv = st * texelSize.xyxy; vec4 a = texture2D(sam, uv.xy); vec4 b = texture2D(sam, uv.zy); vec4 c = texture2D(sam, uv.xw); vec4 d = texture2D(sam, uv.zw); vec2 f = p - st.xy; return mix(mix(a, b, f.x), mix(c, d, f.x), f.y); } void main () { vec2 coord = gl_FragCoord.xy - dt * texture2D(uVelocity, vUv).xy; gl_FragColor = dissipation * bilerp(uSource, coord); gl_FragColor.a = 1.0; }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uVelocity; uniform sampler2D uSource; uniform vec2 texelSize; uniform float dt; uniform float dissipation; vec4 bilerp (in sampler2D sam, in vec2 p) { vec4 st; st.xy = floor(p - 0.5) + 0.5; st.zw = st.xy + 1.0; vec4 uv = st * texelSize.xyxy; vec4 a = texture2D(sam, uv.xy); vec4 b = texture2D(sam, uv.zy); vec4 c = texture2D(sam, uv.xw); vec4 d = texture2D(sam, uv.zw); vec2 f = p - st.xy; return mix(mix(a, b, f.x), mix(c, d, f.x), f.y); } void main () { vec2 coord = gl_FragCoord.xy - dt * texture2D(uVelocity, vUv).xy; gl_FragColor = dissipation * bilerp(uSource, coord); gl_FragColor.a = 1.0; }"
|
||||||
);
|
);
|
||||||
|
|
||||||
let advectionShader = compileShader(
|
let advectionShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uVelocity; uniform sampler2D uSource; uniform vec2 texelSize; uniform float dt; uniform float dissipation; void main () { vec2 coord = vUv - dt * texture2D(uVelocity, vUv).xy * texelSize; gl_FragColor = dissipation * texture2D(uSource, coord); }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; uniform sampler2D uVelocity; uniform sampler2D uSource; uniform vec2 texelSize; uniform float dt; uniform float dissipation; void main () { vec2 coord = vUv - dt * texture2D(uVelocity, vUv).xy * texelSize; gl_FragColor = dissipation * texture2D(uSource, coord); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
let divergenceShader = compileShader(
|
let divergenceShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uVelocity; vec2 sampleVelocity (in vec2 uv) { vec2 multiplier = vec2(1.0, 1.0); if (uv.x < 0.0) { uv.x = 0.0; multiplier.x = -1.0; } if (uv.x > 1.0) { uv.x = 1.0; multiplier.x = -1.0; } if (uv.y < 0.0) { uv.y = 0.0; multiplier.y = -1.0; } if (uv.y > 1.0) { uv.y = 1.0; multiplier.y = -1.0; } return multiplier * texture2D(uVelocity, uv).xy; } void main () { float L = sampleVelocity(vL).x; float R = sampleVelocity(vR).x; float T = sampleVelocity(vT).y; float B = sampleVelocity(vB).y; float div = 0.5 * (R - L + T - B); gl_FragColor = vec4(div, 0.0, 0.0, 1.0); }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uVelocity; vec2 sampleVelocity (in vec2 uv) { vec2 multiplier = vec2(1.0, 1.0); if (uv.x < 0.0) { uv.x = 0.0; multiplier.x = -1.0; } if (uv.x > 1.0) { uv.x = 1.0; multiplier.x = -1.0; } if (uv.y < 0.0) { uv.y = 0.0; multiplier.y = -1.0; } if (uv.y > 1.0) { uv.y = 1.0; multiplier.y = -1.0; } return multiplier * texture2D(uVelocity, uv).xy; } void main () { float L = sampleVelocity(vL).x; float R = sampleVelocity(vR).x; float T = sampleVelocity(vT).y; float B = sampleVelocity(vB).y; float div = 0.5 * (R - L + T - B); gl_FragColor = vec4(div, 0.0, 0.0, 1.0); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
let curlShader = compileShader(
|
let curlShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uVelocity; void main () { float L = texture2D(uVelocity, vL).y; float R = texture2D(uVelocity, vR).y; float T = texture2D(uVelocity, vT).x; float B = texture2D(uVelocity, vB).x; float vorticity = R - L - T + B; gl_FragColor = vec4(vorticity, 0.0, 0.0, 1.0); }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uVelocity; void main () { float L = texture2D(uVelocity, vL).y; float R = texture2D(uVelocity, vR).y; float T = texture2D(uVelocity, vT).x; float B = texture2D(uVelocity, vB).x; float vorticity = R - L - T + B; gl_FragColor = vec4(vorticity, 0.0, 0.0, 1.0); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
let vorticityShader = compileShader(
|
let vorticityShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uVelocity; uniform sampler2D uCurl; uniform float curl; uniform float dt; void main () { float L = texture2D(uCurl, vL).y; float R = texture2D(uCurl, vR).y; float T = texture2D(uCurl, vT).x; float B = texture2D(uCurl, vB).x; float C = texture2D(uCurl, vUv).x; vec2 force = vec2(abs(T) - abs(B), abs(R) - abs(L)); force *= 1.0 / length(force + 0.00001) * curl * C; vec2 vel = texture2D(uVelocity, vUv).xy; gl_FragColor = vec4(vel + force * dt, 0.0, 1.0); }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uVelocity; uniform sampler2D uCurl; uniform float curl; uniform float dt; void main () { float L = texture2D(uCurl, vL).y; float R = texture2D(uCurl, vR).y; float T = texture2D(uCurl, vT).x; float B = texture2D(uCurl, vB).x; float C = texture2D(uCurl, vUv).x; vec2 force = vec2(abs(T) - abs(B), abs(R) - abs(L)); force *= 1.0 / length(force + 0.00001) * curl * C; vec2 vel = texture2D(uVelocity, vUv).xy; gl_FragColor = vec4(vel + force * dt, 0.0, 1.0); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
let pressureShader = compileShader(
|
let pressureShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uPressure; uniform sampler2D uDivergence; vec2 boundary (in vec2 uv) { uv = min(max(uv, 0.0), 1.0); return uv; } void main () { float L = texture2D(uPressure, boundary(vL)).x; float R = texture2D(uPressure, boundary(vR)).x; float T = texture2D(uPressure, boundary(vT)).x; float B = texture2D(uPressure, boundary(vB)).x; float C = texture2D(uPressure, vUv).x; float divergence = texture2D(uDivergence, vUv).x; float pressure = (L + R + B + T - divergence) * 0.25; gl_FragColor = vec4(pressure, 0.0, 0.0, 1.0); }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uPressure; uniform sampler2D uDivergence; vec2 boundary (in vec2 uv) { uv = min(max(uv, 0.0), 1.0); return uv; } void main () { float L = texture2D(uPressure, boundary(vL)).x; float R = texture2D(uPressure, boundary(vR)).x; float T = texture2D(uPressure, boundary(vT)).x; float B = texture2D(uPressure, boundary(vB)).x; float C = texture2D(uPressure, vUv).x; float divergence = texture2D(uDivergence, vUv).x; float pressure = (L + R + B + T - divergence) * 0.25; gl_FragColor = vec4(pressure, 0.0, 0.0, 1.0); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
let gradientSubtractShader = compileShader(
|
let gradientSubtractShader = compileShader(
|
||||||
gl.FRAGMENT_SHADER,
|
gl.FRAGMENT_SHADER,
|
||||||
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uPressure; uniform sampler2D uVelocity; vec2 boundary (in vec2 uv) { uv = min(max(uv, 0.0), 1.0); return uv; } void main () { float L = texture2D(uPressure, boundary(vL)).x; float R = texture2D(uPressure, boundary(vR)).x; float T = texture2D(uPressure, boundary(vT)).x; float B = texture2D(uPressure, boundary(vB)).x; vec2 velocity = texture2D(uVelocity, vUv).xy; velocity.xy -= vec2(R - L, T - B); gl_FragColor = vec4(velocity, 0.0, 1.0); }"
|
"precision highp float; precision mediump sampler2D; varying vec2 vUv; varying vec2 vL; varying vec2 vR; varying vec2 vT; varying vec2 vB; uniform sampler2D uPressure; uniform sampler2D uVelocity; vec2 boundary (in vec2 uv) { uv = min(max(uv, 0.0), 1.0); return uv; } void main () { float L = texture2D(uPressure, boundary(vL)).x; float R = texture2D(uPressure, boundary(vR)).x; float T = texture2D(uPressure, boundary(vT)).x; float B = texture2D(uPressure, boundary(vB)).x; vec2 velocity = texture2D(uVelocity, vUv).xy; velocity.xy -= vec2(R - L, T - B); gl_FragColor = vec4(velocity, 0.0, 1.0); }"
|
||||||
);
|
);
|
||||||
|
|
||||||
// ===== FRAMEBUFFERS =====
|
// ===== FRAMEBUFFERS =====
|
||||||
@@ -182,51 +248,11 @@ function initFramebuffers() {
|
|||||||
let iFormatRG = ext.internalFormatRG;
|
let iFormatRG = ext.internalFormatRG;
|
||||||
let formatRG = ext.formatRG;
|
let formatRG = ext.formatRG;
|
||||||
let texType = ext.texType;
|
let texType = ext.texType;
|
||||||
density = createDoubleFBO(
|
density = createDoubleFBO(0, textureWidth, textureHeight, iFormat, gl.RGBA, texType, support_linear_float ? gl.LINEAR : gl.NEAREST);
|
||||||
0,
|
velocity = createDoubleFBO(2, textureWidth, textureHeight, iFormatRG, formatRG, texType, support_linear_float ? gl.LINEAR : gl.NEAREST);
|
||||||
textureWidth,
|
divergence = createFBO(4, textureWidth, textureHeight, iFormatRG, formatRG, texType, gl.NEAREST);
|
||||||
textureHeight,
|
curl = createFBO(5, textureWidth, textureHeight, iFormatRG, formatRG, texType, gl.NEAREST);
|
||||||
iFormat,
|
pressure = createDoubleFBO(6, textureWidth, textureHeight, iFormatRG, formatRG, texType, gl.NEAREST);
|
||||||
gl.RGBA,
|
|
||||||
texType,
|
|
||||||
support_linear_float ? gl.LINEAR : gl.NEAREST
|
|
||||||
);
|
|
||||||
velocity = createDoubleFBO(
|
|
||||||
2,
|
|
||||||
textureWidth,
|
|
||||||
textureHeight,
|
|
||||||
iFormatRG,
|
|
||||||
formatRG,
|
|
||||||
texType,
|
|
||||||
support_linear_float ? gl.LINEAR : gl.NEAREST
|
|
||||||
);
|
|
||||||
divergence = createFBO(
|
|
||||||
4,
|
|
||||||
textureWidth,
|
|
||||||
textureHeight,
|
|
||||||
iFormatRG,
|
|
||||||
formatRG,
|
|
||||||
texType,
|
|
||||||
gl.NEAREST
|
|
||||||
);
|
|
||||||
curl = createFBO(
|
|
||||||
5,
|
|
||||||
textureWidth,
|
|
||||||
textureHeight,
|
|
||||||
iFormatRG,
|
|
||||||
formatRG,
|
|
||||||
texType,
|
|
||||||
gl.NEAREST
|
|
||||||
);
|
|
||||||
pressure = createDoubleFBO(
|
|
||||||
6,
|
|
||||||
textureWidth,
|
|
||||||
textureHeight,
|
|
||||||
iFormatRG,
|
|
||||||
formatRG,
|
|
||||||
texType,
|
|
||||||
gl.NEAREST
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createFBO(texId, w, h, internalFormat, format, type, param) {
|
function createFBO(texId, w, h, internalFormat, format, type, param) {
|
||||||
@@ -240,13 +266,7 @@ function createFBO(texId, w, h, internalFormat, format, type, param) {
|
|||||||
gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, w, h, 0, format, type, null);
|
gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, w, h, 0, format, type, null);
|
||||||
let fbo = gl.createFramebuffer();
|
let fbo = gl.createFramebuffer();
|
||||||
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
|
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
|
||||||
gl.framebufferTexture2D(
|
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
|
||||||
gl.FRAMEBUFFER,
|
|
||||||
gl.COLOR_ATTACHMENT0,
|
|
||||||
gl.TEXTURE_2D,
|
|
||||||
texture,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
gl.viewport(0, 0, w, h);
|
gl.viewport(0, 0, w, h);
|
||||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||||
return [texture, fbo, texId];
|
return [texture, fbo, texId];
|
||||||
@@ -256,17 +276,9 @@ function createDoubleFBO(texId, w, h, internalFormat, format, type, param) {
|
|||||||
let fbo1 = createFBO(texId, w, h, internalFormat, format, type, param);
|
let fbo1 = createFBO(texId, w, h, internalFormat, format, type, param);
|
||||||
let fbo2 = createFBO(texId + 1, w, h, internalFormat, format, type, param);
|
let fbo2 = createFBO(texId + 1, w, h, internalFormat, format, type, param);
|
||||||
return {
|
return {
|
||||||
get first() {
|
get first() { return fbo1; },
|
||||||
return fbo1;
|
get second() { return fbo2; },
|
||||||
},
|
swap: function swap() { let temp = fbo1; fbo1 = fbo2; fbo2 = temp; }
|
||||||
get second() {
|
|
||||||
return fbo2;
|
|
||||||
},
|
|
||||||
swap: function swap() {
|
|
||||||
let temp = fbo1;
|
|
||||||
fbo1 = fbo2;
|
|
||||||
fbo2 = temp;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,33 +288,19 @@ initFramebuffers();
|
|||||||
let clearProgram = new GLProgram(baseVertexShader, clearShader);
|
let clearProgram = new GLProgram(baseVertexShader, clearShader);
|
||||||
let displayProgram = new GLProgram(baseVertexShader, displayShader);
|
let displayProgram = new GLProgram(baseVertexShader, displayShader);
|
||||||
let splatProgram = new GLProgram(baseVertexShader, splatShader);
|
let splatProgram = new GLProgram(baseVertexShader, splatShader);
|
||||||
let advectionProgram = new GLProgram(
|
let advectionProgram = new GLProgram(baseVertexShader, support_linear_float ? advectionShader : advectionManualFilteringShader);
|
||||||
baseVertexShader,
|
|
||||||
support_linear_float ? advectionShader : advectionManualFilteringShader
|
|
||||||
);
|
|
||||||
let divergenceProgram = new GLProgram(baseVertexShader, divergenceShader);
|
let divergenceProgram = new GLProgram(baseVertexShader, divergenceShader);
|
||||||
let curlProgram = new GLProgram(baseVertexShader, curlShader);
|
let curlProgram = new GLProgram(baseVertexShader, curlShader);
|
||||||
let vorticityProgram = new GLProgram(baseVertexShader, vorticityShader);
|
let vorticityProgram = new GLProgram(baseVertexShader, vorticityShader);
|
||||||
let pressureProgram = new GLProgram(baseVertexShader, pressureShader);
|
let pressureProgram = new GLProgram(baseVertexShader, pressureShader);
|
||||||
let gradienSubtractProgram = new GLProgram(
|
let gradienSubtractProgram = new GLProgram(baseVertexShader, gradientSubtractShader);
|
||||||
baseVertexShader,
|
|
||||||
gradientSubtractShader
|
|
||||||
);
|
|
||||||
|
|
||||||
// ===== BLIT =====
|
// ===== BLIT =====
|
||||||
let blit = (function () {
|
let blit = (function () {
|
||||||
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
|
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
|
||||||
gl.bufferData(
|
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, -1, 1, 1, 1, 1, -1]), gl.STATIC_DRAW);
|
||||||
gl.ARRAY_BUFFER,
|
|
||||||
new Float32Array([-1, -1, -1, 1, 1, 1, 1, -1]),
|
|
||||||
gl.STATIC_DRAW
|
|
||||||
);
|
|
||||||
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer());
|
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer());
|
||||||
gl.bufferData(
|
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 0, 2, 3]), gl.STATIC_DRAW);
|
||||||
gl.ELEMENT_ARRAY_BUFFER,
|
|
||||||
new Uint16Array([0, 1, 2, 0, 2, 3]),
|
|
||||||
gl.STATIC_DRAW
|
|
||||||
);
|
|
||||||
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
|
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
|
||||||
gl.enableVertexAttribArray(0);
|
gl.enableVertexAttribArray(0);
|
||||||
return function (destination) {
|
return function (destination) {
|
||||||
@@ -316,53 +314,27 @@ function splat(x, y, dx, dy, color) {
|
|||||||
splatProgram.bind();
|
splatProgram.bind();
|
||||||
gl.uniform1i(splatProgram.uniforms.uTarget, velocity.first[2]);
|
gl.uniform1i(splatProgram.uniforms.uTarget, velocity.first[2]);
|
||||||
gl.uniform1f(splatProgram.uniforms.aspectRatio, canvas.width / canvas.height);
|
gl.uniform1f(splatProgram.uniforms.aspectRatio, canvas.width / canvas.height);
|
||||||
gl.uniform2f(
|
gl.uniform2f(splatProgram.uniforms.point, x / canvas.width, 1.0 - y / canvas.height);
|
||||||
splatProgram.uniforms.point,
|
|
||||||
x / canvas.width,
|
|
||||||
1.0 - y / canvas.height
|
|
||||||
);
|
|
||||||
gl.uniform3f(splatProgram.uniforms.color, dx, -dy, 1.0);
|
gl.uniform3f(splatProgram.uniforms.color, dx, -dy, 1.0);
|
||||||
gl.uniform1f(splatProgram.uniforms.radius, config.SPLAT_RADIUS);
|
gl.uniform1f(splatProgram.uniforms.radius, config.SPLAT_RADIUS);
|
||||||
blit(velocity.second[1]);
|
blit(velocity.second[1]);
|
||||||
velocity.swap();
|
velocity.swap();
|
||||||
|
|
||||||
gl.uniform1i(splatProgram.uniforms.uTarget, density.first[2]);
|
gl.uniform1i(splatProgram.uniforms.uTarget, density.first[2]);
|
||||||
gl.uniform3f(
|
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||||
splatProgram.uniforms.color,
|
const densityIntensity = isDark ? 0.65 : 0.45;
|
||||||
color[0] * 0.3,
|
gl.uniform3f(splatProgram.uniforms.color, color[0] * densityIntensity, color[1] * densityIntensity, color[2] * densityIntensity);
|
||||||
color[1] * 0.3,
|
|
||||||
color[2] * 0.3
|
|
||||||
);
|
|
||||||
blit(density.second[1]);
|
blit(density.second[1]);
|
||||||
density.swap();
|
density.swap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== RESIZE =====
|
// ===== RESIZE =====
|
||||||
function resizeCanvas() {
|
function resizeCanvas() {
|
||||||
(canvas.width !== canvas.clientWidth ||
|
if (canvas.width !== window.innerWidth || canvas.height !== window.innerHeight) {
|
||||||
canvas.height !== canvas.clientHeight) &&
|
canvas.width = window.innerWidth;
|
||||||
((canvas.width = canvas.clientWidth),
|
canvas.height = window.innerHeight;
|
||||||
(canvas.height = canvas.clientHeight),
|
initFramebuffers();
|
||||||
initFramebuffers());
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// ===== COLORES DE LA MARCA CON TRANSICIÓN =====
|
|
||||||
const brandColors = [
|
|
||||||
//[0.874, 0.741, 0.725], // Rosa (#DFBDB9)
|
|
||||||
[0.729, 0.071, 0.302], // Bordo (#BA124D)
|
|
||||||
[0.000, 0.247, 0.322] // Teal (#003F52)
|
|
||||||
];
|
|
||||||
|
|
||||||
let currentColor = brandColors[0];
|
|
||||||
let targetColor = brandColors[1];
|
|
||||||
let transitionProgress = 0;
|
|
||||||
const transitionSpeed = 0.008;
|
|
||||||
|
|
||||||
function lerpColor(colorA, colorB, t) {
|
|
||||||
return [
|
|
||||||
colorA[0] + (colorB[0] - colorA[0]) * t,
|
|
||||||
colorA[1] + (colorB[1] - colorA[1]) * t,
|
|
||||||
colorA[2] + (colorB[2] - colorA[2]) * t
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let colorArr = currentColor;
|
let colorArr = currentColor;
|
||||||
@@ -370,25 +342,17 @@ let count = 0;
|
|||||||
|
|
||||||
// ===== DETECTAR ELEMENTOS DE TEXTO =====
|
// ===== DETECTAR ELEMENTOS DE TEXTO =====
|
||||||
function isMouseOverTextElement(target) {
|
function isMouseOverTextElement(target) {
|
||||||
// Listado de selectores que necesitan "modo apaciguado"
|
|
||||||
const textSelectors = [
|
const textSelectors = [
|
||||||
'p', '.hero-content p','h1', 'h2', 'h3', 'h4', 'h5', '.hero-content h1',
|
'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'a', 'span', 'button', '.btn', '.card-content', '.hero-content'
|
||||||
'.hero-content h2', '.eyebrow', 'a.sheet-link', '.sheet-link span',
|
|
||||||
'.menu-btn', '.sheet-link-desc', '.sheet-link-main'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Verificar si el target o sus ancestros coinciden con algún selector
|
|
||||||
for (const selector of textSelectors) {
|
for (const selector of textSelectors) {
|
||||||
if (target.closest(selector)) {
|
if (target.closest(selector)) return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===== EVENTOS CON COLORES DE MARCA =====
|
// ===== EVENTOS CON COLORES DE MARCA =====
|
||||||
document.addEventListener("mousemove", function (e) {
|
document.addEventListener("mousemove", function (e) {
|
||||||
// Detectar si estamos sobre un elemento de texto
|
|
||||||
const overText = isMouseOverTextElement(e.target);
|
const overText = isMouseOverTextElement(e.target);
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
@@ -409,51 +373,45 @@ document.addEventListener("mousemove", function (e) {
|
|||||||
pointers[0].color = colorArr;
|
pointers[0].color = colorArr;
|
||||||
pointers[0].moved = pointers[0].down;
|
pointers[0].moved = pointers[0].down;
|
||||||
|
|
||||||
// Aplicar multiplicador diferente según si estamos sobre texto o no
|
// ✅ CLAVE: Reducir la fuerza del fluido sobre texto para no dificultar la lectura
|
||||||
const multiplier = overText ? 8 : 10.0; // Reducido a 4x sobre texto (vs 10x)
|
const multiplier = overText ? 4.0 : 10.0;
|
||||||
|
|
||||||
pointers[0].dx = (e.clientX - canvas.offsetLeft - pointers[0].x) * multiplier;
|
pointers[0].dx = (e.clientX - pointers[0].x) * multiplier;
|
||||||
pointers[0].dy = (e.clientY - canvas.offsetTop - pointers[0].y) * multiplier;
|
pointers[0].dy = (e.clientY - pointers[0].y) * multiplier;
|
||||||
pointers[0].x = e.clientX - canvas.offsetLeft;
|
pointers[0].x = e.clientX;
|
||||||
pointers[0].y = e.clientY - canvas.offsetTop;
|
pointers[0].y = e.clientY;
|
||||||
});
|
});
|
||||||
|
|
||||||
canvas.addEventListener(
|
canvas.addEventListener("touchmove", function (e) {
|
||||||
"touchmove",
|
e.preventDefault();
|
||||||
function (e) {
|
let touches = e.targetTouches;
|
||||||
e.preventDefault();
|
count++;
|
||||||
let touches = e.targetTouches;
|
if (count > 20) {
|
||||||
count++;
|
transitionProgress += transitionSpeed;
|
||||||
if (count > 20) {
|
if (transitionProgress >= 1) {
|
||||||
transitionProgress += transitionSpeed;
|
transitionProgress = 0;
|
||||||
if (transitionProgress >= 1) {
|
let currentIndex = brandColors.indexOf(currentColor);
|
||||||
transitionProgress = 0;
|
let nextIndex = (currentIndex + 1) % brandColors.length;
|
||||||
let currentIndex = brandColors.indexOf(currentColor);
|
currentColor = targetColor;
|
||||||
let nextIndex = (currentIndex + 1) % brandColors.length;
|
targetColor = brandColors[nextIndex];
|
||||||
currentColor = targetColor;
|
|
||||||
targetColor = brandColors[nextIndex];
|
|
||||||
}
|
|
||||||
colorArr = lerpColor(currentColor, targetColor, transitionProgress);
|
|
||||||
count = 0;
|
|
||||||
}
|
}
|
||||||
|
colorArr = lerpColor(currentColor, targetColor, transitionProgress);
|
||||||
for (let i = 0, len = touches.length; i < len; i++) {
|
count = 0;
|
||||||
if (i >= pointers.length) pointers.push(new pointerPrototype());
|
}
|
||||||
pointers[i].id = touches[i].identifier;
|
|
||||||
pointers[i].down = true;
|
for (let i = 0, len = touches.length; i < len; i++) {
|
||||||
pointers[i].x = touches[i].pageX;
|
if (i >= pointers.length) pointers.push(new pointerPrototype());
|
||||||
pointers[i].y = touches[i].pageY;
|
let pointer = pointers[i];
|
||||||
pointers[i].color = colorArr;
|
pointer.id = touches[i].identifier;
|
||||||
let pointer = pointers[i];
|
pointer.down = true;
|
||||||
pointer.moved = pointer.down;
|
pointer.color = colorArr;
|
||||||
pointer.dx = (touches[i].pageX - pointer.x) * 10.0;
|
pointer.moved = true;
|
||||||
pointer.dy = (touches[i].pageY - pointer.y) * 10.0;
|
pointer.dx = (touches[i].pageX - pointer.x) * 10.0;
|
||||||
pointer.x = touches[i].pageX;
|
pointer.dy = (touches[i].pageY - pointer.y) * 10.0;
|
||||||
pointer.y = touches[i].pageY;
|
pointer.x = touches[i].pageX;
|
||||||
}
|
pointer.y = touches[i].pageY;
|
||||||
},
|
}
|
||||||
false
|
}, { passive: false });
|
||||||
);
|
|
||||||
|
|
||||||
// ===== LOOP PRINCIPAL =====
|
// ===== LOOP PRINCIPAL =====
|
||||||
let lastTime = Date.now();
|
let lastTime = Date.now();
|
||||||
@@ -465,27 +423,17 @@ function update() {
|
|||||||
gl.viewport(0, 0, textureWidth, textureHeight);
|
gl.viewport(0, 0, textureWidth, textureHeight);
|
||||||
|
|
||||||
advectionProgram.bind();
|
advectionProgram.bind();
|
||||||
gl.uniform2f(
|
gl.uniform2f(advectionProgram.uniforms.texelSize, 1.0 / textureWidth, 1.0 / textureHeight);
|
||||||
advectionProgram.uniforms.texelSize,
|
|
||||||
1.0 / textureWidth,
|
|
||||||
1.0 / textureHeight
|
|
||||||
);
|
|
||||||
gl.uniform1i(advectionProgram.uniforms.uVelocity, velocity.first[2]);
|
gl.uniform1i(advectionProgram.uniforms.uVelocity, velocity.first[2]);
|
||||||
gl.uniform1i(advectionProgram.uniforms.uSource, velocity.first[2]);
|
gl.uniform1i(advectionProgram.uniforms.uSource, velocity.first[2]);
|
||||||
gl.uniform1f(advectionProgram.uniforms.dt, dt);
|
gl.uniform1f(advectionProgram.uniforms.dt, dt);
|
||||||
gl.uniform1f(
|
gl.uniform1f(advectionProgram.uniforms.dissipation, config.VELOCITY_DISSIPATION);
|
||||||
advectionProgram.uniforms.dissipation,
|
|
||||||
config.VELOCITY_DISSIPATION
|
|
||||||
);
|
|
||||||
blit(velocity.second[1]);
|
blit(velocity.second[1]);
|
||||||
velocity.swap();
|
velocity.swap();
|
||||||
|
|
||||||
gl.uniform1i(advectionProgram.uniforms.uVelocity, velocity.first[2]);
|
gl.uniform1i(advectionProgram.uniforms.uVelocity, velocity.first[2]);
|
||||||
gl.uniform1i(advectionProgram.uniforms.uSource, density.first[2]);
|
gl.uniform1i(advectionProgram.uniforms.uSource, density.first[2]);
|
||||||
gl.uniform1f(
|
gl.uniform1f(advectionProgram.uniforms.dissipation, config.DENSITY_DISSIPATION);
|
||||||
advectionProgram.uniforms.dissipation,
|
|
||||||
config.DENSITY_DISSIPATION
|
|
||||||
);
|
|
||||||
blit(density.second[1]);
|
blit(density.second[1]);
|
||||||
density.swap();
|
density.swap();
|
||||||
|
|
||||||
@@ -498,20 +446,12 @@ function update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
curlProgram.bind();
|
curlProgram.bind();
|
||||||
gl.uniform2f(
|
gl.uniform2f(curlProgram.uniforms.texelSize, 1.0 / textureWidth, 1.0 / textureHeight);
|
||||||
curlProgram.uniforms.texelSize,
|
|
||||||
1.0 / textureWidth,
|
|
||||||
1.0 / textureHeight
|
|
||||||
);
|
|
||||||
gl.uniform1i(curlProgram.uniforms.uVelocity, velocity.first[2]);
|
gl.uniform1i(curlProgram.uniforms.uVelocity, velocity.first[2]);
|
||||||
blit(curl[1]);
|
blit(curl[1]);
|
||||||
|
|
||||||
vorticityProgram.bind();
|
vorticityProgram.bind();
|
||||||
gl.uniform2f(
|
gl.uniform2f(vorticityProgram.uniforms.texelSize, 1.0 / textureWidth, 1.0 / textureHeight);
|
||||||
vorticityProgram.uniforms.texelSize,
|
|
||||||
1.0 / textureWidth,
|
|
||||||
1.0 / textureHeight
|
|
||||||
);
|
|
||||||
gl.uniform1i(vorticityProgram.uniforms.uVelocity, velocity.first[2]);
|
gl.uniform1i(vorticityProgram.uniforms.uVelocity, velocity.first[2]);
|
||||||
gl.uniform1i(vorticityProgram.uniforms.uCurl, curl[2]);
|
gl.uniform1i(vorticityProgram.uniforms.uCurl, curl[2]);
|
||||||
gl.uniform1f(vorticityProgram.uniforms.curl, config.CURL);
|
gl.uniform1f(vorticityProgram.uniforms.curl, config.CURL);
|
||||||
@@ -520,11 +460,7 @@ function update() {
|
|||||||
velocity.swap();
|
velocity.swap();
|
||||||
|
|
||||||
divergenceProgram.bind();
|
divergenceProgram.bind();
|
||||||
gl.uniform2f(
|
gl.uniform2f(divergenceProgram.uniforms.texelSize, 1.0 / textureWidth, 1.0 / textureHeight);
|
||||||
divergenceProgram.uniforms.texelSize,
|
|
||||||
1.0 / textureWidth,
|
|
||||||
1.0 / textureHeight
|
|
||||||
);
|
|
||||||
gl.uniform1i(divergenceProgram.uniforms.uVelocity, velocity.first[2]);
|
gl.uniform1i(divergenceProgram.uniforms.uVelocity, velocity.first[2]);
|
||||||
blit(divergence[1]);
|
blit(divergence[1]);
|
||||||
|
|
||||||
@@ -538,11 +474,7 @@ function update() {
|
|||||||
pressure.swap();
|
pressure.swap();
|
||||||
|
|
||||||
pressureProgram.bind();
|
pressureProgram.bind();
|
||||||
gl.uniform2f(
|
gl.uniform2f(pressureProgram.uniforms.texelSize, 1.0 / textureWidth, 1.0 / textureHeight);
|
||||||
pressureProgram.uniforms.texelSize,
|
|
||||||
1.0 / textureWidth,
|
|
||||||
1.0 / textureHeight
|
|
||||||
);
|
|
||||||
gl.uniform1i(pressureProgram.uniforms.uDivergence, divergence[2]);
|
gl.uniform1i(pressureProgram.uniforms.uDivergence, divergence[2]);
|
||||||
pressureTexId = pressure.first[2];
|
pressureTexId = pressure.first[2];
|
||||||
gl.activeTexture(gl.TEXTURE0 + pressureTexId);
|
gl.activeTexture(gl.TEXTURE0 + pressureTexId);
|
||||||
@@ -554,11 +486,7 @@ function update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gradienSubtractProgram.bind();
|
gradienSubtractProgram.bind();
|
||||||
gl.uniform2f(
|
gl.uniform2f(gradienSubtractProgram.uniforms.texelSize, 1.0 / textureWidth, 1.0 / textureHeight);
|
||||||
gradienSubtractProgram.uniforms.texelSize,
|
|
||||||
1.0 / textureWidth,
|
|
||||||
1.0 / textureHeight
|
|
||||||
);
|
|
||||||
gl.uniform1i(gradienSubtractProgram.uniforms.uPressure, pressure.first[2]);
|
gl.uniform1i(gradienSubtractProgram.uniforms.uPressure, pressure.first[2]);
|
||||||
gl.uniform1i(gradienSubtractProgram.uniforms.uVelocity, velocity.first[2]);
|
gl.uniform1i(gradienSubtractProgram.uniforms.uVelocity, velocity.first[2]);
|
||||||
blit(velocity.second[1]);
|
blit(velocity.second[1]);
|
||||||
@@ -567,6 +495,10 @@ function update() {
|
|||||||
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
|
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
|
||||||
displayProgram.bind();
|
displayProgram.bind();
|
||||||
gl.uniform1i(displayProgram.uniforms.uTexture, density.first[2]);
|
gl.uniform1i(displayProgram.uniforms.uTexture, density.first[2]);
|
||||||
|
const isDarkTheme = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||||
|
if (displayProgram.uniforms.uIsDark !== undefined) {
|
||||||
|
gl.uniform1f(displayProgram.uniforms.uIsDark, isDarkTheme ? 1.0 : 0.0);
|
||||||
|
}
|
||||||
blit(null);
|
blit(null);
|
||||||
|
|
||||||
requestAnimationFrame(update);
|
requestAnimationFrame(update);
|
||||||
@@ -574,6 +506,52 @@ function update() {
|
|||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
|
||||||
|
/* captura del movimiento del mouse*/
|
||||||
|
let isFirstMove = true;
|
||||||
|
|
||||||
|
document.addEventListener("mousemove", function (e) {
|
||||||
|
if (isFirstMove) {
|
||||||
|
pointers[0].x = e.clientX;
|
||||||
|
pointers[0].y = e.clientY;
|
||||||
|
isFirstMove = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const overText = isMouseOverTextElement(e.target);
|
||||||
|
|
||||||
|
count++;
|
||||||
|
if (count > 1) {
|
||||||
|
transitionProgress += transitionSpeed;
|
||||||
|
if (transitionProgress >= 1) {
|
||||||
|
transitionProgress = 0;
|
||||||
|
let currentIndex = brandColors.indexOf(currentColor);
|
||||||
|
let nextIndex = (currentIndex + 1) % brandColors.length;
|
||||||
|
currentColor = targetColor;
|
||||||
|
targetColor = brandColors[nextIndex];
|
||||||
|
}
|
||||||
|
colorArr = lerpColor(currentColor, targetColor, transitionProgress);
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pointers[0].down = true;
|
||||||
|
pointers[0].color = colorArr;
|
||||||
|
pointers[0].moved = true;
|
||||||
|
|
||||||
|
// Fuerza balanceada sobre el texto y sobre el fondo
|
||||||
|
const multiplier = overText ? 4.0 : 8.0;
|
||||||
|
|
||||||
|
pointers[0].dx = (e.clientX - pointers[0].x) * multiplier;
|
||||||
|
pointers[0].dy = (e.clientY - pointers[0].y) * multiplier;
|
||||||
|
pointers[0].x = e.clientX;
|
||||||
|
pointers[0].y = e.clientY;
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener("mouseleave", function () {
|
||||||
|
isFirstMove = true;
|
||||||
|
pointers[0].moved = false;
|
||||||
|
});
|
||||||
|
|
||||||
// ===== REDIMENSIONAR AL CAMBIAR TAMAÑO DE VENTANA =====
|
// ===== REDIMENSIONAR AL CAMBIAR TAMAÑO DE VENTANA =====
|
||||||
window.addEventListener("resize", function() {
|
window.addEventListener("resize", function() {
|
||||||
canvas.width = window.innerWidth;
|
canvas.width = window.innerWidth;
|
||||||
|
|||||||
+1
-1
@@ -734,4 +734,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
initPlanesFocusEffect();
|
initPlanesFocusEffect();
|
||||||
initPortfolioCarousel();
|
initPortfolioCarousel();
|
||||||
initMarqueeHover(); // ← además, esta NUNCA se está llamando
|
initMarqueeHover(); // ← además, esta NUNCA se está llamando
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+230
-33
@@ -108,11 +108,13 @@
|
|||||||
html {
|
html {
|
||||||
font-size: var(--font-size-base);
|
font-size: var(--font-size-base);
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
|
background-color: var(--bg-base);
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: var(--font-family-base);
|
font-family: var(--font-family-base);
|
||||||
background-color: var(--bg-base);
|
/*background-color: var(--bg-base);*/
|
||||||
|
background-color: transparent;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
@@ -514,7 +516,8 @@ body.menu-open .site-header {
|
|||||||
============================================ */
|
============================================ */
|
||||||
main section {
|
main section {
|
||||||
padding: var(--spacing-md) var(--spacing-sm);
|
padding: var(--spacing-md) var(--spacing-sm);
|
||||||
border-bottom: 1px dashed var(--border);
|
background-color: transparent;
|
||||||
|
/*border-bottom: 1px dashed var(--border);*/
|
||||||
}
|
}
|
||||||
main section h2 { margin-bottom: var(--spacing-sm); font-size: 1.5rem; }
|
main section h2 { margin-bottom: var(--spacing-sm); font-size: 1.5rem; }
|
||||||
|
|
||||||
@@ -1681,56 +1684,250 @@ RESPONSIVE DIAGNÓSTICO
|
|||||||
/* ============================================
|
/* ============================================
|
||||||
SECCIÓN CTA FINAL
|
SECCIÓN CTA FINAL
|
||||||
============================================ */
|
============================================ */
|
||||||
.cta-section { padding: var(--spacing-lg) var(--spacing-md); background-color: var(--bg-base); }
|
.cta-section {
|
||||||
|
padding: var(--spacing-lg) var(--spacing-md);
|
||||||
|
background-color: var(--bg-base);
|
||||||
|
}
|
||||||
|
|
||||||
.cta-card {
|
.cta-card {
|
||||||
max-width: 900px; margin: 0 auto; background-color: var(--brand-teal);
|
max-width: 900px;
|
||||||
border-radius: 24px; padding: var(--spacing-lg) var(--spacing-md);
|
margin: 0 auto;
|
||||||
text-align: center; position: relative; overflow: hidden;
|
/* Fondo teal sólido y oscuro para máximo contraste */
|
||||||
box-shadow: 0 20px 60px -10px rgba(0, 63, 82, 0.4);
|
background-color: var(--brand-teal);
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: var(--spacing-lg) var(--spacing-md);
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
/* Sombra más pronunciada */
|
||||||
|
box-shadow: 0 20px 60px -10px rgba(0, 63, 82, 0.5);
|
||||||
|
/* Borde sutil para definir mejor */
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cta-card::before, .cta-card::after {
|
/* Glows decorativos con degradé crimson-teal */
|
||||||
content: ""; position: absolute; width: 300px; height: 300px;
|
.cta-card::before,
|
||||||
border-radius: 50%; filter: blur(80px); opacity: 0.35; pointer-events: none;
|
.cta-card::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
width: 400px;
|
||||||
|
height: 400px;
|
||||||
|
border-radius: 50%;
|
||||||
|
filter: blur(100px);
|
||||||
|
opacity: 0.4;
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Glow superior izquierdo - Crimson/Rosa */
|
||||||
|
.cta-card::before {
|
||||||
|
top: -150px;
|
||||||
|
left: -150px;
|
||||||
|
background: radial-gradient(
|
||||||
|
circle,
|
||||||
|
rgba(186, 18, 77, 0.6) 0%,
|
||||||
|
rgba(186, 18, 77, 0.3) 40%,
|
||||||
|
transparent 70%
|
||||||
|
);
|
||||||
|
animation: glowPulse 8s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Glow inferior derecho - Teal/Rose */
|
||||||
|
.cta-card::after {
|
||||||
|
bottom: -150px;
|
||||||
|
right: -150px;
|
||||||
|
background: radial-gradient(
|
||||||
|
circle,
|
||||||
|
rgba(0, 168, 140, 0.5) 0%,
|
||||||
|
rgba(223, 189, 185, 0.3) 40%,
|
||||||
|
transparent 70%
|
||||||
|
);
|
||||||
|
animation: glowPulse 8s ease-in-out infinite reverse;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Animación sutil de los glows */
|
||||||
|
@keyframes glowPulse {
|
||||||
|
0%, 100% {
|
||||||
|
transform: scale(1) translate(0, 0);
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: scale(1.1) translate(20px, -20px);
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.cta-card::before { top: -100px; left: -100px; background: radial-gradient(circle, var(--brand-crimson) 0%, transparent 70%); }
|
|
||||||
.cta-card::after { bottom: -100px; right: -100px; background: radial-gradient(circle, var(--brand-rose-muted) 0%, transparent 70%); }
|
|
||||||
|
|
||||||
.cta-title {
|
.cta-title {
|
||||||
font-family: var(--font-title); font-style: italic;
|
font-family: var(--font-title);
|
||||||
font-size: clamp(2rem, 4vw, 3rem); color: #ffffff;
|
font-style: italic;
|
||||||
margin-bottom: var(--spacing-sm); line-height: 1.15; position: relative; z-index: 1;
|
font-size: clamp(2rem, 4vw, 3rem);
|
||||||
|
color: #ffffff;
|
||||||
|
margin-bottom: var(--spacing-sm);
|
||||||
|
line-height: 1.15;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
/* Sombra de texto para mejorar legibilidad */
|
||||||
|
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cta-subtitle {
|
.cta-subtitle {
|
||||||
font-family: var(--font-body); font-size: clamp(1rem, 2vw, 1.15rem);
|
font-family: var(--font-body);
|
||||||
color: rgba(255, 255, 255, 0.85); max-width: 600px; margin: 0 auto var(--spacing-md);
|
font-size: clamp(1rem, 2vw, 1.15rem);
|
||||||
line-height: 1.6; position: relative; z-index: 1;
|
color: rgba(255, 255, 255, 0.9);
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto var(--spacing-md);
|
||||||
|
line-height: 1.6;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cta-buttons {
|
.cta-buttons {
|
||||||
display: flex; justify-content: center; gap: var(--spacing-sm);
|
display: flex;
|
||||||
flex-wrap: wrap; position: relative; z-index: 1;
|
justify-content: center;
|
||||||
|
gap: var(--spacing-sm);
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Botón primario - Blanco con hover crimson */
|
||||||
.btn-cta-primary {
|
.btn-cta-primary {
|
||||||
background-color: #ffffff; color: var(--brand-teal); border: 1.5px solid #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 0.85rem 2rem; border-radius: 999px; font-family: var(--font-small);
|
color: var(--brand-teal);
|
||||||
font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
|
border: 2px solid #ffffff;
|
||||||
box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.2);
|
padding: 0.85rem 2.2rem;
|
||||||
}
|
border-radius: 999px;
|
||||||
.btn-cta-primary:hover {
|
font-family: var(--font-small);
|
||||||
background-color: var(--brand-crimson); color: #ffffff; border-color: var(--brand-crimson);
|
font-size: 0.95rem;
|
||||||
transform: translateY(-2px); box-shadow: 0 6px 20px -3px rgba(186, 18, 77, 0.45);
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.25);
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-cta-secondary {
|
.btn-cta-primary:hover {
|
||||||
background-color: transparent; color: #ffffff; border: 1.5px solid rgba(255, 255, 255, 0.6);
|
background-color: var(--brand-crimson);
|
||||||
padding: 0.85rem 2rem; border-radius: 999px; font-family: var(--font-small);
|
color: #ffffff;
|
||||||
font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
|
border-color: var(--brand-crimson);
|
||||||
|
transform: translateY(-3px);
|
||||||
|
box-shadow: 0 8px 24px -4px rgba(186, 18, 77, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Botón secundario - Transparente con borde blanco */
|
||||||
|
.btn-cta-secondary {
|
||||||
|
background-color: transparent;
|
||||||
|
color: #ffffff;
|
||||||
|
border: 2px solid rgba(255, 255, 255, 0.8);
|
||||||
|
padding: 0.85rem 2.2rem;
|
||||||
|
border-radius: 999px;
|
||||||
|
font-family: var(--font-small);
|
||||||
|
font-size: 0.95rem;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.btn-cta-secondary:hover {
|
.btn-cta-secondary:hover {
|
||||||
background-color: rgba(255, 255, 255, 0.1); border-color: #ffffff; transform: translateY(-2px);
|
background-color: rgba(255, 255, 255, 0.15);
|
||||||
|
border-color: #ffffff;
|
||||||
|
transform: translateY(-3px);
|
||||||
|
box-shadow: 0 8px 24px -4px rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== CANVAS FLUIDO Y APILAMIENTO ===== */
|
||||||
|
main {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#footer-container {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fluid-bg {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fluidCanvas {
|
||||||
|
display: block;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-section,
|
||||||
|
.servicios-section,
|
||||||
|
.diagnostico-section,
|
||||||
|
.metodologia-section,
|
||||||
|
.planes-section,
|
||||||
|
.portfolio-section,
|
||||||
|
.cta-section {
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.cta-section {
|
||||||
|
padding: var(--spacing-md) var(--spacing-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-card {
|
||||||
|
padding: var(--spacing-lg) var(--spacing-md);
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-card::before,
|
||||||
|
.cta-card::after {
|
||||||
|
width: 250px;
|
||||||
|
height: 250px;
|
||||||
|
filter: blur(60px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-buttons {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-cta-primary,
|
||||||
|
.btn-cta-secondary {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 320px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.cta-card {
|
||||||
|
padding: var(--spacing-md) var(--spacing-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-title {
|
||||||
|
font-size: 1.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta-subtitle {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.cta-card::before,
|
||||||
|
.cta-card::after {
|
||||||
|
animation: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-cta-primary,
|
||||||
|
.btn-cta-secondary {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
|||||||
Reference in New Issue
Block a user