thema de comienzo con efectos

This commit is contained in:
2026-09-22 21:37:59 -06:00
commit 6247ae7cc5
67 changed files with 5604 additions and 0 deletions
@@ -0,0 +1,18 @@
/* Spotlight overlay. Clicks pass through to the page. */
.spotlight-cursor {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
height: 100%;
pointer-events: none;
}
.spotlight-cursor canvas {
display: block;
width: 100%;
height: 100%;
pointer-events: none;
}
@@ -0,0 +1,96 @@
/* Spotlight cursor from Cursify.
https://cursify.ui-layouts.com/components/spotlight-cursor */
(function () {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
return;
}
var spotlightSize = 50;
var spotlightIntensity = 0.8;
var fadeSpeed = 0.1;
var glowColor = '255, 255, 255';
var pulseSpeed = 2000;
var root = document.createElement('div');
root.className = 'spotlight-cursor';
root.setAttribute('aria-hidden', 'true');
var canvas = document.createElement('canvas');
root.appendChild(canvas);
document.body.appendChild(root);
var ctx = canvas.getContext('2d');
var spotlightPos = { x: window.innerWidth / 2, y: window.innerHeight / 2 };
var targetPos = { x: spotlightPos.x, y: spotlightPos.y };
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
function lerp(start, end, factor) {
return start + (end - start) * factor;
}
function handleMouseMove(event) {
targetPos.x = event.clientX;
targetPos.y = event.clientY;
}
function render() {
spotlightPos.x = lerp(spotlightPos.x, targetPos.x, fadeSpeed);
spotlightPos.y = lerp(spotlightPos.y, targetPos.y, fadeSpeed);
ctx.globalCompositeOperation = 'source-over';
ctx.clearRect(0, 0, canvas.width, canvas.height);
// color de fondo
ctx.fillStyle = 'rgba(250, 250, 250, 0.05)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
var pulseScale = 1 + 0.1 * Math.sin((Date.now() / pulseSpeed) * Math.PI * 2);
var currentSpotlightSize = spotlightSize * pulseScale;
var gradient = ctx.createRadialGradient(
spotlightPos.x,
spotlightPos.y,
0,
spotlightPos.x,
spotlightPos.y,
currentSpotlightSize
);
gradient.addColorStop(0, 'rgba(' + glowColor + ', ' + spotlightIntensity + ')');
gradient.addColorStop(0.5, 'rgba(' + glowColor + ', ' + (spotlightIntensity * 0.5) + ')');
gradient.addColorStop(1, 'rgba(0, 0, 0, 0)');
ctx.globalCompositeOperation = 'destination-out';
ctx.fillStyle = gradient;
ctx.beginPath();
ctx.arc(spotlightPos.x, spotlightPos.y, currentSpotlightSize, 0, Math.PI * 2);
ctx.fill();
ctx.globalCompositeOperation = 'source-over';
var glowGradient = ctx.createRadialGradient(
spotlightPos.x,
spotlightPos.y,
0,
spotlightPos.x,
spotlightPos.y,
currentSpotlightSize * 1.2
);
glowGradient.addColorStop(0, 'rgba(' + glowColor + ', 0.2)');
glowGradient.addColorStop(1, 'rgba(0, 0, 0, 0)');
ctx.fillStyle = glowGradient;
ctx.beginPath();
ctx.arc(spotlightPos.x, spotlightPos.y, currentSpotlightSize * 1.2, 0, Math.PI * 2);
ctx.fill();
window.requestAnimationFrame(render);
}
resizeCanvas();
window.addEventListener('resize', resizeCanvas);
document.addEventListener('mousemove', handleMouseMove);
render();
}());
@@ -0,0 +1,30 @@
<?php
/**
* Spotlight cursor from Cursify.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function alcastromol_spotlight_cursor_assets() {
$dir = get_template_directory() . '/parts/spotlight-cursor';
$uri = get_template_directory_uri() . '/parts/spotlight-cursor';
wp_enqueue_style(
'alcastromol-spotlight-cursor',
$uri . '/spotlight-cursor.css',
array(),
filemtime( $dir . '/spotlight-cursor.css' )
);
wp_enqueue_script(
'alcastromol-spotlight-cursor',
$uri . '/spotlight-cursor.js',
array(),
filemtime( $dir . '/spotlight-cursor.js' ),
true
);
}
add_action( 'wp_enqueue_scripts', 'alcastromol_spotlight_cursor_assets' );