añadir animate js

This commit is contained in:
2026-09-28 16:09:57 -06:00
parent 72cbd1fe40
commit 5dec72887e
9 changed files with 7552 additions and 5 deletions
+13 -1
View File
@@ -16,6 +16,7 @@ function alcastromol_default_modules() {
'tailwind' => '1',
'cache' => '1',
'optimizer' => '0',
'animejs' => '0',
];
}
@@ -46,6 +47,7 @@ function alcastromol_module_icon($name) {
'tailwind' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 6.2c-2.6 0-4.2 1.3-5 3.8 1.1-1.5 2.4-2.1 4-1.7.9.2 1.6.8 2.3 1.5.9 1 1.9 1.9 3.7 1.9 2.6 0 4.2-1.3 5-3.8-1.1 1.5-2.4 2.1-4 1.7-.9-.2-1.6-.8-2.3-1.5-.9-1-1.9-1.9-3.7-1.9z"/><path d="M6.3 12.1c-2.6 0-4.2 1.3-5 3.8 1.1-1.5 2.4-2.1 4-1.7.9.2 1.6.8 2.3 1.5.9 1 1.9 1.9 3.7 1.9 2.6 0 4.2-1.3 5-3.8-1.1 1.5-2.4 2.1-4 1.7-.9-.2-1.6-.8-2.3-1.5-.9-1-1.9-1.9-3.7-1.9z"/></svg>',
'cache' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true"><ellipse cx="12" cy="6.5" rx="6.5" ry="2.6"/><path d="M5.5 6.5v5.2c0 1.5 2.9 2.6 6.5 2.6s6.5-1.1 6.5-2.6V6.5"/><path d="M5.5 11.7v5.2c0 1.5 2.9 2.6 6.5 2.6s6.5-1.1 6.5-2.6v-5.2"/></svg>',
'optimizer' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3.5H7.2A1.7 1.7 0 0 0 5.5 5.2v13.6A1.7 1.7 0 0 0 7.2 20.5h9.6a1.7 1.7 0 0 0 1.7-1.7V8z"/><path d="M14 3.5V8h4.5"/><path d="M12 11.2v5.2"/><path d="M9.6 14.6 12 17l2.4-2.4"/></svg>',
'animejs' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 16c2.2-6 4.2-9 8-9s5.8 3 8 9"/><path d="M8 16.5 12 8l4 8.5"/></svg>',
];
return isset($icons[$name]) ? $icons[$name] : '';
@@ -85,6 +87,16 @@ function alcastromol_get_module_cards() {
'badge' => '',
'locked' => false,
],
'animejs' => [
'title' => 'Anime.js',
'desc' => 'Carga Anime.js 4 desde el CDN. Cada import (animate, text, utils y el resto) se activa por separado y solo entra al sitio el que esté encendido.',
'settings' => admin_url('admin.php?page=alcastromol-animejs'),
'bg' => '#fff1e8',
'color' => '#ea580c',
'icon' => 'animejs',
'badge' => '',
'locked' => false,
],
];
}
@@ -122,7 +134,7 @@ add_action('wp_ajax_alcastromol_toggle_module', function () {
$module = sanitize_key($_POST['module'] ?? '');
$active = ($_POST['active'] ?? '0') === '1' ? '1' : '0';
$allowed = ['tailwind', 'cache', 'optimizer'];
$allowed = ['tailwind', 'cache', 'optimizer', 'animejs'];
if (!in_array($module, $allowed, true)) {
wp_send_json_error(['message' => 'Esta función todavía no se puede activar.'], 400);