<!-- ============================================================
CODE BLOCK: HERO CON CANVAS RED NEURAL INTEGRADO
Pega esto en un Code Block de Squarespace donde quieras el Hero.
El canvas ocupa solo esta sección, no toda la página.
============================================================ -->
<style>
/* Contenedor del hero */
.hero-cn {
position: relative;
width: 100%;
min-height: 100vh;
background: #0a0e27;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
/* Canvas: solo dentro del hero */
.hero-cn canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
}
/* Contenido por encima del canvas */
.hero-cn .content {
position: relative;
z-index: 1;
text-align: center;
max-width: 900px;
padding: 100px 24px 80px;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.hero-cn .badge {
display: inline-block;
padding: 8px 20px;
border: 1px solid #00e5ff;
border-radius: 100px;
color: #00e5ff;
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.12em;
margin-bottom: 32px;
background: rgba(0, 229, 255, 0.06);
}
.hero-cn h1 {
font-family: 'Playfair Display', Georgia, serif;
font-size: clamp(2.2rem, 5vw, 4rem);
font-weight: 700;
line-height: 1.1;
letter-spacing: -0.03em;
margin-bottom: 20px;
color: #ffffff;
}
.hero-cn h1 .accent {
color: #00e5ff;
display: block;
}
.hero-cn .subtitle {
font-size: 1.1rem;
color: rgba(255, 255, 255, 0.7);
max-width: 600px;
margin: 0 auto 40px;
line-height: 1.7;
}
.hero-cn .ctas {
display: flex;
gap: 16px;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 24px;
}
.hero-cn .btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 14px 32px;
font-size: 0.8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
text-decoration: none;
border-radius: 100px;
transition: all 0.3s ease;
cursor: pointer;
border: none;
}
.hero-cn .btn-p {
background: #00e5ff;
color: #0a0e27;
}
.hero-cn .btn-p:hover {
background: #33ebff;
box-shadow: 0 0 40px rgba(0, 229, 255, 0.35);
transform: translateY(-2px);
}
.hero-cn .btn-o {
background: transparent;
color: #fff;
border: 1px solid rgba(255, 255, 255, 0.3);
}
.hero-cn .btn-o:hover {
border-color: #00e5ff;
color: #00e5ff;
background: rgba(0, 229, 255, 0.05);
}
.hero-cn .note {
font-size: 0.85rem;
color: rgba(255, 255, 255, 0.45);
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.hero-cn .note span {
color: #00e5ff;
}
/* Scroll indicator */
.hero-cn .scroll-ind {
position: absolute;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
color: rgba(255, 255, 255, 0.3);
font-size: 0.7rem;
letter-spacing: 0.1em;
text-transform: uppercase;
animation: bounce 2s infinite;
}
@keyframes bounce {
0%, 100% { transform: translateX(-50%) translateY(0); }
50% { transform: translateX(-50%) translateY(8px); }
}
</style>
<div class="hero-cn" id="hero-congreso">
<canvas id="neural-hero-canvas"></canvas>
<div class="content">
<div class="badge">EVENTO HIBRIDO: PRESENCIAL Y VIRTUAL</div>
<h1>
XIX Congreso Venezolano de Neurologia
<span class="accent">& XVI de Neuropediatria</span>
</h1>
<p class="subtitle">
Innovacion y Practica Clinica en la Era Digital.
Abordaje integral de patologias neurologicas complejas en adultos y pediatria.
</p>
<div class="ctas">
<a href="#" class="btn btn-p">Inscribete Ahora</a>
<a href="#agenda" class="btn btn-o">Ver Agenda</a>
</div>
<p class="note">
<span>✦</span>
Invitados internacionales de primer nivel confirmados
</p>
</div>
<div class="scroll-ind">
<span>Scroll</span>
<span>↓</span>
</div>
</div>
<script>
(function() {
var container = document.getElementById('hero-congreso');
var canvas = document.getElementById('neural-hero-canvas');
var ctx = canvas.getContext('2d');
var W, H, mouse = { x: -1000, y: -1000 };
var config = {
gridSpacing: 70,
connectionDist: 100,
mouseRadius: 160,
baseOpacity: 0.1,
activeOpacity: 0.5,
particleCount: 25
};
var points = [], particles = [];
function resize() {
var rect = container.getBoundingClientRect();
W = canvas.width = rect.width;
H = canvas.height = rect.height;
initGrid();
initParticles();
}
function initGrid() {
points = [];
var cols = Math.ceil(W / config.gridSpacing) + 1;
var rows = Math.ceil(H / config.gridSpacing) + 1;
for (var r = 0; r < rows; r++) {
for (var c = 0; c < cols; c++) {
points.push({
x: c * config.gridSpacing,
y: r * config.gridSpacing,
baseX: c * config.gridSpacing,
baseY: r * config.gridSpacing
});
}
}
}
function initParticles() {
particles = [];
for (var i = 0; i < config.particleCount; i++) {
particles.push({
x: Math.random() * W,
y: Math.random() * H,
vx: (Math.random() - 0.5) * 0.4,
vy: (Math.random() - 0.5) * 0.4,
size: Math.random() * 2 + 1,
opacity: Math.random() * 0.4 + 0.1
});
}
}
// Mouse tracking relative to canvas
canvas.addEventListener('mousemove', function(e) {
var rect = canvas.getBoundingClientRect();
mouse.x = e.clientX - rect.left;
mouse.y = e.clientY - rect.top;
});
canvas.addEventListener('mouseleave', function() {
mouse.x = -1000;
mouse.y = -1000;
});
function dist(a, b) {
var dx = a.x - b.x, dy = a.y - b.y;
return Math.sqrt(dx * dx + dy * dy);
}
function mdist(p) {
var dx = p.x - mouse.x, dy = p.y - mouse.y;
return Math.sqrt(dx * dx + dy * dy);
}
var time = 0;
function draw() {
time += 0.016;
ctx.clearRect(0, 0, W, H);
// Connections
for (var i = 0; i < points.length; i++) {
var m1 = mdist(points[i]), near1 = m1 < config.mouseRadius;
for (var j = i + 1; j < points.length; j++) {
var d = dist(points[i], points[j]);
if (d < config.connectionDist) {
var m2 = mdist(points[j]), near2 = m2 < config.mouseRadius;
var op = config.baseOpacity;
if (near1 || near2) {
var mm = Math.min(m1, m2);
op = config.baseOpacity + (config.activeOpacity - config.baseOpacity) * (1 - mm / config.mouseRadius);
}
var df = 1 - (d / config.connectionDist);
op *= df;
ctx.beginPath();
ctx.moveTo(points[i].x, points[i].y);
ctx.lineTo(points[j].x, points[j].y);
ctx.strokeStyle = 'rgba(0,229,255,' + op + ')';
ctx.lineWidth = 1;
ctx.stroke();
}
}
}
// Dots
for (var i = 0; i < points.length; i++) {
var m = mdist(points[i]), op = config.baseOpacity, r = 2;
if (m < config.mouseRadius) {
var f = 1 - m / config.mouseRadius;
op = config.baseOpacity + (1 - config.baseOpacity) * f;
r = 2 + 3 * f;
}
ctx.beginPath();
ctx.arc(points[i].x, points[i].y, r, 0, Math.PI * 2);
ctx.fillStyle = 'rgba(0,229,255,' + op + ')';
ctx.fill();
}
// Floating particles
for (var i = 0; i < particles.length; i++) {
var p = particles[i];
p.x += p.vx;
p.y += p.vy;
if (p.x < 0) p.x = W;
if (p.x > W) p.x = 0;
if (p.y < 0) p.y = H;
if (p.y > H) p.y = 0;
var pmd = Math.sqrt((p.x - mouse.x) ** 2 + (p.y - mouse.y) ** 2);
var pop = p.opacity;
if (pmd < config.mouseRadius) pop = Math.min(1, p.opacity * 2);
ctx.beginPath();
ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);
ctx.fillStyle = 'rgba(0,229,255,' + pop + ')';
ctx.fill();
if (pmd < config.mouseRadius) {
ctx.beginPath();
ctx.arc(p.x, p.y, p.size * 4, 0, Math.PI * 2);
ctx.fillStyle = 'rgba(0,229,255,' + (0.1 * (1 - pmd / config.mouseRadius)) + ')';
ctx.fill();
}
}
requestAnimationFrame(draw);
}
window.addEventListener('resize', resize);
resize();
draw();
})();
</script>
XIX Venezolano de Neurologia & XVI de Neuropediatria
Innovacion y Practica Clinica en la Era Digital. Abordaje integral de patologias neurologicas complejas en adultos y pediatria.
✦
Avanzar
↓