Changeset 3812973
- Timestamp:
- 11/20/2026 05:06:53 AM (less than one hour ago)
- Location:
- init-fx-engine
- Files:
-
- 39 added
- 13 edited
-
assets/screenshot-3.png (modified) ( previous)
-
assets/screenshot-8.png (modified) ( previous)
-
tags/2.0.3 (added)
-
tags/2.0.3/assets (added)
-
tags/2.0.3/assets/js (added)
-
tags/2.0.3/assets/js/admin-preview.js (added)
-
tags/2.0.3/assets/js/blocks-editor.js (added)
-
tags/2.0.3/assets/js/canvas-confetti.min.js (added)
-
tags/2.0.3/assets/js/fireworks.min.js (added)
-
tags/2.0.3/assets/js/fx-ambient.js (added)
-
tags/2.0.3/assets/js/fx-engine.js (added)
-
tags/2.0.3/assets/js/fx-inline.js (added)
-
tags/2.0.3/assets/js/fx-preloader.js (added)
-
tags/2.0.3/assets/js/fx-seasonal.js (added)
-
tags/2.0.3/assets/js/fx-snowfall.js (added)
-
tags/2.0.3/assets/js/particles.min.js (added)
-
tags/2.0.3/assets/js/tsparticles.slim.bundle.min.js (added)
-
tags/2.0.3/blocks (added)
-
tags/2.0.3/blocks/fx-ambient (added)
-
tags/2.0.3/blocks/fx-ambient/block.json (added)
-
tags/2.0.3/blocks/fx-ambient/render.php (added)
-
tags/2.0.3/blocks/fx-trigger (added)
-
tags/2.0.3/blocks/fx-trigger/block.json (added)
-
tags/2.0.3/blocks/fx-trigger/render.php (added)
-
tags/2.0.3/includes (added)
-
tags/2.0.3/includes/assets.php (added)
-
tags/2.0.3/includes/blocks.php (added)
-
tags/2.0.3/includes/seasonal.php (added)
-
tags/2.0.3/includes/settings-form.php (added)
-
tags/2.0.3/includes/settings-page.php (added)
-
tags/2.0.3/includes/settings-seasonal.php (added)
-
tags/2.0.3/includes/shortcodes.php (added)
-
tags/2.0.3/includes/snowfall.php (added)
-
tags/2.0.3/init-fx-engine.php (added)
-
tags/2.0.3/languages (added)
-
tags/2.0.3/languages/init-fx-engine-vi-63489dfd3f2bb853537b7a37ca925d0b.json (added)
-
tags/2.0.3/languages/init-fx-engine-vi.mo (added)
-
tags/2.0.3/languages/init-fx-engine-vi.po (added)
-
tags/2.0.3/languages/init-fx-engine.pot (added)
-
tags/2.0.3/readme.txt (added)
-
tags/2.0.3/uninstall.php (added)
-
trunk/assets/js/admin-preview.js (modified) (1 diff)
-
trunk/assets/js/fx-snowfall.js (modified) (27 diffs)
-
trunk/blocks/fx-ambient/block.json (modified) (1 diff)
-
trunk/blocks/fx-trigger/block.json (modified) (1 diff)
-
trunk/includes/settings-form.php (modified) (2 diffs)
-
trunk/includes/snowfall.php (modified) (5 diffs)
-
trunk/init-fx-engine.php (modified) (2 diffs)
-
trunk/languages/init-fx-engine-vi.mo (modified) ( previous)
-
trunk/languages/init-fx-engine-vi.po (modified) (21 diffs)
-
trunk/languages/init-fx-engine.pot (modified) (15 diffs)
-
trunk/readme.txt (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
init-fx-engine/trunk/assets/js/admin-preview.js
r3812923 r3812973 69 69 opacity: valueOf( box, '.fx-snowfall-opacity' ), 70 70 style: valueOf( box, '.fx-snowfall-style' ), 71 color: valueOf( box, '.fx-snowfall-color' ), 71 72 wind: valueOf( box, '.fx-snowfall-wind' ), 73 fps: valueOf( box, '.fx-snowfall-fps' ), 72 74 }, 8000 ); 73 75 } ); -
init-fx-engine/trunk/assets/js/fx-snowfall.js
r3812923 r3812973 2 2 * Init FX Engine — Snowfall. 3 3 * 4 * Từ 2.0.2 không còn dùng particles.js (thư viện ngừng phát triển từ 2016, ~23KB): 5 * - 1 canvas, sprite bông tuyết dựng sẵn → mỗi khung hình chỉ drawImage. 6 * - Chuyển động theo thời gian thực (delta time) → mượt như nhau ở 60Hz/120Hz/144Hz. 7 * - Hạt to rơi nhanh hơn (chiều sâu), đung đưa nhẹ, gió đổi hướng chậm rãi. 8 * - Số hạt tự co giãn theo diện tích màn hình (mobile nhẹ hơn desktop). 9 * - Dừng hẳn khi tab bị ẩn, chỉ khởi động sau khi trang tải xong (không ảnh hưởng LCP). 10 * - Tôn trọng "prefers-reduced-motion" (có thể tắt trong cài đặt). 4 * Renderer canvas riêng (không thư viện), thay cho particles.js từ 2.0.2. Bản 2.0.3: 5 * - Kiểu "Classic" (mặc định): hạt tròn đặc, kích thước + độ mờ ngẫu nhiên tạo chiều sâu, 6 * rơi chéo nhẹ ngẫu nhiên — đúng cảm giác của Snowfall các bản cũ (particles.js). 7 * - Thêm kiểu Soft glow (chấm tuyết phát sáng của 2.0.2), Crystal, Mixed; màu tuyết tùy chỉnh. 8 * - Gió nhẹ (tùy chọn), chế độ tiết kiệm pin 30fps, tắt trên màn hình nhỏ (tùy chọn). 9 * 10 * Hiệu năng: 11 * - Sprite dựng sẵn 1 lần → mỗi khung hình chỉ drawImage (hạt tròn không cần xoay/transform riêng). 12 * - Delta time → tốc độ như nhau ở 60/120/144Hz; giới hạn DPR = 2. 13 * - Số hạt co giãn theo diện tích màn hình. 14 * - Mobile: thanh địa chỉ co/giãn không làm cấp phát lại canvas (chỉ cấp phát khi đổi chiều rộng 15 * hoặc chiều cao tăng vượt vùng đã có). 16 * - Dừng khi tab ẩn, khởi động khi trình duyệt rảnh sau "load", tôn trọng prefers-reduced-motion. 11 17 * 12 18 * API: window.initFxSnowfall.start( config ) / stop() / preview( config, ms ) / isRunning() … … 23 29 var REF_AREA = 1440 * 900; 24 30 var SPRITE_PX = 64; 31 var STYLES = [ 'dots', 'soft', 'flakes', 'mixed' ]; 25 32 26 33 var state = { … … 28 35 canvas: null, 29 36 ctx: null, 30 dot: null, 31 flakes: [], 37 sprites: null, 32 38 particles: [], 33 39 width: 0, 34 40 height: 0, 41 allocW: 0, 42 allocH: 0, 35 43 dpr: 1, 36 44 raf: 0, 37 45 last: 0, 46 frameGap: 0, 38 47 running: false, 39 48 resizeQueued: false, … … 61 70 } 62 71 72 function isSmallScreen() { 73 return !! ( window.matchMedia && window.matchMedia( '(max-width: 767px)' ).matches ); 74 } 75 63 76 function normalize( cfg ) { 64 77 cfg = cfg || {}; … … 68 81 speed: num( cfg.speed, 0.3, 5, 1.2 ), 69 82 opacity: num( cfg.opacity, 0.1, 1, 0.6 ), 70 style: [ 'dots', 'flakes', 'mixed' ].indexOf( cfg.style ) !== -1 ? cfg.style : 'dots', 71 wind: cfg.wind !== false, 83 style: STYLES.indexOf( cfg.style ) !== -1 ? cfg.style : 'dots', 84 color: /^#[0-9a-f]{3}([0-9a-f]{3})?$/i.test( cfg.color || '' ) ? cfg.color : '#ffffff', 85 wind: !! cfg.wind, 86 fps: Number( cfg.fps ) === 30 ? 30 : 60, 87 hideMobile: !! cfg.hideMobile, 72 88 reducedMotion: cfg.reducedMotion !== false, 73 89 }; … … 75 91 76 92 // --------------------------------------------------------------------- 77 // Sprites (vẽ 1 lần )93 // Sprites (vẽ 1 lần cho mỗi lần start) 78 94 // --------------------------------------------------------------------- 79 95 function makeCanvas( size ) { … … 84 100 } 85 101 86 // Chấm tuyết mềm: lõi trắng + viền mờ dần + bóng xanh xám rất nhẹ (vẫn thấy trên nền trắng). 87 function buildDot() { 102 // Classic: hình tròn đặc, mép khử răng cưa — giống particles.js. 103 function buildRound( color ) { 104 var c = makeCanvas( SPRITE_PX ); 105 var g = c.getContext( '2d' ); 106 g.fillStyle = color; 107 g.beginPath(); 108 g.arc( SPRITE_PX / 2, SPRITE_PX / 2, SPRITE_PX / 2 - 0.5, 0, Math.PI * 2 ); 109 g.fill(); 110 return c; 111 } 112 113 // Soft glow: lõi sáng + viền mờ dần (kiểu chấm tuyết của 2.0.2). 114 function buildSoft( color ) { 88 115 var c = makeCanvas( SPRITE_PX ); 89 116 var g = c.getContext( '2d' ); 90 117 var r = SPRITE_PX / 2; 91 118 92 var halo = g.createRadialGradient( r, r, 0, r, r, r ); 93 halo.addColorStop( 0, 'rgba(255,255,255,1)' ); 94 halo.addColorStop( 0.45, 'rgba(255,255,255,0.95)' ); 95 halo.addColorStop( 0.7, 'rgba(225,238,255,0.45)' ); 96 halo.addColorStop( 1, 'rgba(200,220,245,0)' ); 97 119 g.fillStyle = color; 120 g.beginPath(); 121 g.arc( r, r, r * 0.5, 0, Math.PI * 2 ); 122 g.fill(); 123 124 g.globalCompositeOperation = 'source-over'; 125 var halo = g.createRadialGradient( r, r, r * 0.45, r, r, r ); 126 halo.addColorStop( 0, color ); 127 halo.addColorStop( 1, 'rgba(255,255,255,0)' ); 128 g.globalAlpha = 0.55; 98 129 g.fillStyle = halo; 99 130 g.beginPath(); … … 105 136 106 137 // Bông tuyết pha lê 6 cánh (3 biến thể). 107 function buildFlake( variant ) {138 function buildFlake( variant, color ) { 108 139 var c = makeCanvas( SPRITE_PX ); 109 140 var g = c.getContext( '2d' ); … … 113 144 114 145 g.translate( r, r ); 115 g.strokeStyle = '#ffffff';146 g.strokeStyle = color; 116 147 g.lineCap = 'round'; 117 148 g.shadowColor = 'rgba(120,160,210,0.55)'; … … 153 184 } 154 185 155 g.fillStyle = '#ffffff';186 g.fillStyle = color; 156 187 g.beginPath(); 157 188 g.arc( 0, 0, variant === 1 ? 3.5 : 2.5, 0, Math.PI * 2 ); … … 162 193 163 194 function buildSprites() { 164 if ( ! state.dot ) { 165 state.dot = buildDot(); 166 state.flakes = [ buildFlake( 0 ), buildFlake( 1 ), buildFlake( 2 ) ]; 167 } 195 var color = state.cfg.color; 196 state.sprites = { 197 round: buildRound( color ), 198 soft: buildSoft( color ), 199 flakes: [ buildFlake( 0, color ), buildFlake( 1, color ), buildFlake( 2, color ) ], 200 }; 168 201 } 169 202 … … 178 211 function spawn( p, initial ) { 179 212 var cfg = state.cfg; 180 var useFlake = cfg.style === 'flakes' || ( cfg.style === 'mixed' && Math.random() < 0.35 ); 181 var depth = Math.pow( Math.random(), 1.4 ); // Nhiều hạt nhỏ ở xa, ít hạt to ở gần. 182 183 p.flake = useFlake ? state.flakes[ ( Math.random() * 3 ) | 0 ] : null; 184 p.r = cfg.size * ( 0.35 + depth * 0.65 ) * ( useFlake ? 2.4 : 1 ); 213 var s = state.sprites; 214 var useFlake = cfg.style === 'flakes' || ( cfg.style === 'mixed' && Math.random() < 0.3 ); 215 var depth = Math.random(); 216 217 p.flake = useFlake ? s.flakes[ ( Math.random() * 3 ) | 0 ] : null; 218 p.img = p.flake || ( cfg.style === 'soft' ? s.soft : s.round ); 219 220 // Giống particles.js: bán kính = ngẫu nhiên × size, độ mờ = ngẫu nhiên × opacity (độc lập) 221 // → hạt to/nhỏ, đậm/nhạt lẫn lộn tạo cảm giác chiều sâu. Hạt to rơi nhanh hơn một chút. 222 p.r = cfg.size * Math.max( 0.15, depth ) * ( useFlake ? 2.2 : 1 ); 223 p.alpha = cfg.opacity * Math.max( 0.06, Math.random() ); 224 p.vy = cfg.speed * 30 * rand( 0.5, 1.5 ) * ( 0.8 + depth * 0.4 ); 225 p.vx = ( Math.random() - 0.5 ) * cfg.speed * 30; // Rơi chéo nhẹ ngẫu nhiên như bản cũ. 185 226 p.depth = depth; 186 p.alpha = cfg.opacity * ( 0.45 + depth * 0.55 ); 187 p.vy = cfg.speed * rand( 18, 30 ) * ( 0.55 + depth * 0.9 ); 188 p.swing = rand( 6, 22 ) * ( 0.5 + depth ); 189 p.swingSpeed = rand( 0.4, 1.3 ); 227 p.swing = cfg.wind ? rand( 4, 14 ) * ( 0.5 + depth ) : 0; 228 p.swingSpeed = rand( 0.4, 1.2 ); 190 229 p.phase = rand( 0, Math.PI * 2 ); 191 230 p.rot = rand( 0, Math.PI * 2 ); 192 231 p.spin = rand( -0.8, 0.8 ); 193 232 p.x = Math.random() * state.width; 194 p.y = initial ? Math.random() * state.height : -p.r * 2 - Math.random() * 40;233 p.y = initial ? Math.random() * state.height : -p.r * 2 - Math.random() * 30; 195 234 196 235 return p; … … 211 250 function updateWind( dt ) { 212 251 if ( ! state.cfg.wind ) { 213 state.wind = 0;214 252 return; 215 253 } … … 217 255 if ( state.windTimer <= 0 ) { 218 256 state.windTimer = rand( 4, 9 ); 219 state.windTarget = rand( -1, 1 ) * 2 2* state.cfg.speed;257 state.windTarget = rand( -1, 1 ) * 20 * state.cfg.speed; 220 258 } 221 259 // Tiến dần về hướng gió mới → đổi hướng rất êm. … … 228 266 var h = state.height; 229 267 var wind = state.wind; 230 var i, p ;268 var i, p, dx; 231 269 232 270 for ( i = 0; i < list.length; i++ ) { 233 271 p = list[ i ]; 234 p.phase += p.swingSpeed * dt; 272 dx = p.vx; 273 274 if ( p.swing ) { 275 p.phase += p.swingSpeed * dt; 276 dx += Math.sin( p.phase ) * p.swing + wind * ( 0.4 + p.depth ); 277 } 278 235 279 p.y += p.vy * dt; 236 p.x += ( Math.sin( p.phase ) * p.swing + wind * ( 0.4 + p.depth ) ) * dt; 280 p.x += dx * dt; 281 237 282 if ( p.flake ) { 238 283 p.rot += p.spin * dt; … … 253 298 var dpr = state.dpr; 254 299 var list = state.particles; 255 var dot = state.dot;256 300 var i, p, d, cos, sin, s; 257 301 … … 259 303 ctx.clearRect( 0, 0, state.canvas.width, state.canvas.height ); 260 304 261 // Lượt 1: chấm tuyết — không xoay, chỉ 1 transform cho cả lượt.305 // Lượt 1: hạt tròn — 1 transform cho cả lượt, không xoay. 262 306 ctx.setTransform( dpr, 0, 0, dpr, 0, 0 ); 263 307 for ( i = 0; i < list.length; i++ ) { … … 268 312 d = p.r * 2; 269 313 ctx.globalAlpha = p.alpha; 270 ctx.drawImage( dot, p.x - p.r, p.y - p.r, d, d );314 ctx.drawImage( p.img, p.x - p.r, p.y - p.r, d, d ); 271 315 } 272 316 … … 294 338 } 295 339 296 var dt = state.last ? Math.min( MAX_DT, ( now - state.last ) / 1000 ) : 0; 340 state.raf = window.requestAnimationFrame( frame ); 341 342 // Chế độ tiết kiệm pin: bỏ qua khung hình để giữ ~30fps. 343 if ( state.frameGap && state.last && now - state.last < state.frameGap ) { 344 return; 345 } 346 347 var dt = state.last ? Math.min( MAX_DT * 2, ( now - state.last ) / 1000 ) : 0; 297 348 state.last = now; 298 349 … … 300 351 update( dt ); 301 352 draw(); 302 303 state.raf = window.requestAnimationFrame( frame );304 353 } 305 354 … … 313 362 } 314 363 315 state.dpr = Math.min( MAX_DPR, window.devicePixelRatio || 1 ); 316 state.width = window.innerWidth; 317 state.height = window.innerHeight; 318 state.canvas.width = Math.round( state.width * state.dpr ); 319 state.canvas.height = Math.round( state.height * state.dpr ); 364 var dpr = Math.min( MAX_DPR, window.devicePixelRatio || 1 ); 365 var w = window.innerWidth; 366 var h = window.innerHeight; 367 368 state.width = w; 369 state.height = h; 370 371 // Chỉ cấp phát lại canvas khi đổi chiều rộng/DPR hoặc cao hơn vùng đã có 372 // (thanh địa chỉ trên mobile co giãn khi cuộn không còn làm cấp phát lại). 373 if ( w !== state.allocW || h > state.allocH || dpr !== state.dpr ) { 374 state.allocH = w === state.allocW && dpr === state.dpr ? Math.max( h, state.allocH ) : h; 375 state.allocW = w; 376 state.dpr = dpr; 377 state.canvas.width = Math.round( w * dpr ); 378 state.canvas.height = Math.round( state.allocH * dpr ); 379 state.canvas.style.height = state.allocH + 'px'; 380 } 320 381 321 382 syncParticleCount(); … … 341 402 state.raf = window.requestAnimationFrame( frame ); 342 403 } 343 }344 345 function stop() {346 state.running = false;347 window.cancelAnimationFrame( state.raf );348 window.clearTimeout( state.previewTimer );349 window.removeEventListener( 'resize', onResize );350 document.removeEventListener( 'visibilitychange', onVisibility );351 352 if ( state.canvas && state.canvas.parentNode ) {353 state.canvas.parentNode.removeChild( state.canvas );354 }355 356 state.canvas = null;357 state.ctx = null;358 state.particles = [];359 state.last = 0;360 361 removeBackdrop();362 404 } 363 405 … … 389 431 } 390 432 433 function stop() { 434 state.running = false; 435 window.cancelAnimationFrame( state.raf ); 436 window.clearTimeout( state.previewTimer ); 437 window.removeEventListener( 'resize', onResize ); 438 document.removeEventListener( 'visibilitychange', onVisibility ); 439 440 if ( state.canvas && state.canvas.parentNode ) { 441 state.canvas.parentNode.removeChild( state.canvas ); 442 } 443 444 state.canvas = null; 445 state.ctx = null; 446 state.particles = []; 447 state.last = 0; 448 state.allocW = 0; 449 state.allocH = 0; 450 451 removeBackdrop(); 452 } 453 391 454 function start( config ) { 392 455 stop(); … … 401 464 canvas.className = 'init-fx-snowfall'; 402 465 canvas.setAttribute( 'aria-hidden', 'true' ); 403 canvas.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100 %;z-index:999;pointer-events:none;display:block;';466 canvas.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100vh;z-index:999;pointer-events:none;display:block;'; 404 467 405 468 var ctx = canvas.getContext( '2d' ); … … 412 475 state.ctx = ctx; 413 476 state.wind = 0; 477 state.windTarget = 0; 414 478 state.windTimer = 0; 479 state.frameGap = cfg.fps === 30 ? 1000 / 30 - 2 : 0; 480 state.dpr = 0; 415 481 416 482 buildSprites(); … … 432 498 var cfg = normalize( config ); 433 499 cfg.reducedMotion = false; // Preview trong admin luôn chạy. 500 cfg.hideMobile = false; 434 501 if ( start( cfg ) ) { 435 502 addBackdrop(); … … 440 507 function boot() { 441 508 var cfg = window.INIT_FX && window.INIT_FX.snowfall; 442 if ( cfg ) { 443 start( cfg ); 444 } 509 if ( ! cfg ) { 510 return; 511 } 512 if ( cfg.hideMobile && isSmallScreen() ) { 513 return; 514 } 515 start( cfg ); 445 516 } 446 517 -
init-fx-engine/trunk/blocks/fx-ambient/block.json
r3812923 r3812973 3 3 "apiVersion": 3, 4 4 "name": "init-fx-engine/fx-ambient", 5 "version": "2.0. 2",5 "version": "2.0.3", 6 6 "title": "FX Ambient Section", 7 7 "category": "init-fx-engine", -
init-fx-engine/trunk/blocks/fx-trigger/block.json
r3812923 r3812973 3 3 "apiVersion": 3, 4 4 "name": "init-fx-engine/fx-trigger", 5 "version": "2.0. 2",5 "version": "2.0.3", 6 6 "title": "FX Trigger", 7 7 "category": "init-fx-engine", -
init-fx-engine/trunk/includes/settings-form.php
r3812923 r3812973 212 212 <td> 213 213 <select name="init_plugin_suite_fx_engine_snowfall[style]" id="init_fx_snowfall_style" class="fx-snowfall-style"> 214 <option value="dots" <?php selected( $snowfall['style'], 'dots' ); ?>><?php esc_html_e( 'Soft dots (classic)', 'init-fx-engine' ); ?></option> 214 <option value="dots" <?php selected( $snowfall['style'], 'dots' ); ?>><?php esc_html_e( 'Classic round (random opacity, depth)', 'init-fx-engine' ); ?></option> 215 <option value="soft" <?php selected( $snowfall['style'], 'soft' ); ?>><?php esc_html_e( 'Soft glow', 'init-fx-engine' ); ?></option> 215 216 <option value="flakes" <?php selected( $snowfall['style'], 'flakes' ); ?>><?php esc_html_e( 'Crystal snowflakes', 'init-fx-engine' ); ?></option> 216 <option value="mixed" <?php selected( $snowfall['style'], 'mixed' ); ?>><?php esc_html_e( ' Mixed', 'init-fx-engine' ); ?></option>217 <option value="mixed" <?php selected( $snowfall['style'], 'mixed' ); ?>><?php esc_html_e( 'Classic + crystal snowflakes', 'init-fx-engine' ); ?></option> 217 218 </select> 219 </td> 220 </tr> 221 <tr> 222 <th scope="row"> 223 <label for="init_fx_snowfall_color"><?php esc_html_e( 'Snow color', 'init-fx-engine' ); ?></label> 224 </th> 225 <td> 226 <input type="color" name="init_plugin_suite_fx_engine_snowfall[color]" id="init_fx_snowfall_color" class="fx-snowfall-color" value="<?php echo esc_attr( $snowfall['color'] ); ?>"> 227 <p class="description"><?php esc_html_e( 'White by default. A light blue or gray keeps the snow visible on light backgrounds.', 'init-fx-engine' ); ?></p> 218 228 </td> 219 229 </tr> … … 266 276 <label> 267 277 <input type="checkbox" name="init_plugin_suite_fx_engine_snowfall[wind]" id="init_fx_snowfall_wind" class="fx-snowfall-wind" value="1" <?php checked( ! empty( $snowfall['wind'] ) ); ?>> 268 <?php esc_html_e( 'Gentle wind gusts that slowly change direction', 'init-fx-engine' ); ?> 278 <?php esc_html_e( 'Gentle swaying and wind gusts that slowly change direction', 'init-fx-engine' ); ?> 279 </label> 280 <p class="description"><?php esc_html_e( 'Off: snow drifts down at slightly random angles, like previous versions.', 'init-fx-engine' ); ?></p> 281 </td> 282 </tr> 283 <tr> 284 <th scope="row"> 285 <label for="init_fx_snowfall_fps"><?php esc_html_e( 'Performance', 'init-fx-engine' ); ?></label> 286 </th> 287 <td> 288 <select name="init_plugin_suite_fx_engine_snowfall[fps]" id="init_fx_snowfall_fps" class="fx-snowfall-fps"> 289 <option value="60" <?php selected( (int) $snowfall['fps'], 60 ); ?>><?php esc_html_e( 'Smooth (60 fps)', 'init-fx-engine' ); ?></option> 290 <option value="30" <?php selected( (int) $snowfall['fps'], 30 ); ?>><?php esc_html_e( 'Battery saver (30 fps)', 'init-fx-engine' ); ?></option> 291 </select> 292 </td> 293 </tr> 294 <tr> 295 <th scope="row"> 296 <label for="init_fx_snowfall_hide_mobile"><?php esc_html_e( 'Small screens', 'init-fx-engine' ); ?></label> 297 </th> 298 <td> 299 <label> 300 <input type="checkbox" name="init_plugin_suite_fx_engine_snowfall[hide_mobile]" id="init_fx_snowfall_hide_mobile" value="1" <?php checked( ! empty( $snowfall['hide_mobile'] ) ); ?>> 301 <?php esc_html_e( 'Do not show snowfall on screens narrower than 768px', 'init-fx-engine' ); ?> 269 302 </label> 270 303 </td> -
init-fx-engine/trunk/includes/snowfall.php
r3812923 r3812973 3 3 * Snowfall Effect. 4 4 * 5 * Từ 2.0.2 dùng renderer canvas riêng (fx-snowfall.js, ~4KB, không thư viện),6 * thay cho particles.js: sprite dựng sẵn, tự giảm hạt trên màn hình nhỏ, dừng khi7 * ẩn tab, khởi động sau khi trang tải xong. Giữ nguyên toàn bộ tùy chọn cũ.5 * Từ 2.0.2 dùng renderer canvas riêng (fx-snowfall.js, không thư viện) thay cho 6 * particles.js. 2.0.3 đưa kiểu hạt tròn "Classic" (độ mờ ngẫu nhiên, có chiều sâu) 7 * trở lại làm mặc định, thêm màu tuyết, chế độ tiết kiệm pin và tùy chọn tắt trên mobile. 8 8 * 9 9 * @package Init_FX_Engine … … 29 29 'opacity' => 0.6, 30 30 'style' => 'dots', 31 'wind' => true, 31 'color' => '#ffffff', 32 'wind' => false, 33 'fps' => 60, 34 'hide_mobile' => false, 32 35 'reduced_motion' => true, 33 36 ); 37 } 38 39 /** 40 * Snowfall styles: dots = Classic round (mặc định, giống các bản cũ), soft = Soft glow (2.0.2), 41 * flakes = Crystal snowflakes, mixed = Classic + crystal. 42 * 43 * @return array 44 */ 45 function init_plugin_suite_fx_engine_snowfall_styles() { 46 return array( 'dots', 'soft', 'flakes', 'mixed' ); 34 47 } 35 48 … … 115 128 'speed' => max( 0.3, min( 5, (float) $snowfall['speed'] ) ), 116 129 'opacity' => max( 0.1, min( 1, (float) $snowfall['opacity'] ) ), 117 'style' => in_array( $snowfall['style'], array( 'dots', 'flakes', 'mixed' ), true ) ? $snowfall['style'] : 'dots', 130 'style' => in_array( $snowfall['style'], init_plugin_suite_fx_engine_snowfall_styles(), true ) ? $snowfall['style'] : 'dots', 131 'color' => sanitize_hex_color( $snowfall['color'] ) ? sanitize_hex_color( $snowfall['color'] ) : '#ffffff', 118 132 'wind' => ! empty( $snowfall['wind'] ), 133 'fps' => 30 === (int) $snowfall['fps'] ? 30 : 60, 134 'hideMobile' => ! empty( $snowfall['hide_mobile'] ), 119 135 'reducedMotion' => ! empty( $snowfall['reduced_motion'] ), 120 136 ); … … 135 151 $end = sanitize_text_field( $input['custom_end'] ?? '' ); 136 152 $date_rx = '/^\d{4}-\d{2}-\d{2}$/'; 153 $color = sanitize_hex_color( $input['color'] ?? '#ffffff' ); 137 154 138 155 return array( … … 146 163 'speed' => max( 0.3, min( 5, floatval( $input['speed'] ?? $defaults['speed'] ) ) ), 147 164 'opacity' => max( 0.1, min( 1, floatval( $input['opacity'] ?? $defaults['opacity'] ) ) ), 148 'style' => in_array( $style, array( 'dots', 'flakes', 'mixed' ), true ) ? $style : 'dots', 165 'style' => in_array( $style, init_plugin_suite_fx_engine_snowfall_styles(), true ) ? $style : 'dots', 166 'color' => $color ? $color : '#ffffff', 149 167 'wind' => ! empty( $input['wind'] ), 168 'fps' => 30 === intval( $input['fps'] ?? 60 ) ? 30 : 60, 169 'hide_mobile' => ! empty( $input['hide_mobile'] ), 150 170 'reduced_motion' => ! empty( $input['reduced_motion'] ), 151 171 ); -
init-fx-engine/trunk/init-fx-engine.php
r3812923 r3812973 4 4 * Description: Add interactive visual effects like fireworks, emoji rain, snowfall, particle backgrounds and seasonal holiday scenes — triggered by comments, keywords, blocks or holidays. Scripts only load on pages that actually use them. Make your WordPress site come alive! 5 5 * Plugin URI: https://inithtml.com/plugin/init-fx-engine/ 6 * Version: 2.0. 26 * Version: 2.0.3 7 7 * Author: Init HTML 8 8 * Author URI: https://inithtml.com/ … … 21 21 // === DEFINE CONSTANTS === 22 22 23 define( 'INIT_PLUGIN_SUITE_FX_ENGINE_VERSION', '2.0. 2' );23 define( 'INIT_PLUGIN_SUITE_FX_ENGINE_VERSION', '2.0.3' ); 24 24 define( 'INIT_PLUGIN_SUITE_FX_ENGINE_SLUG', 'init-fx-engine' ); 25 25 define( 'INIT_PLUGIN_SUITE_FX_ENGINE_OPTION', 'init_plugin_suite_fx_engine_settings' ); -
init-fx-engine/trunk/languages/init-fx-engine-vi.po
r3812923 r3812973 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: Init FX Engine 2.0. 2\n"3 "Project-Id-Version: Init FX Engine 2.0.3\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "Last-Translator: \n" … … 19 19 msgstr "Cài đặt Init FX Engine" 20 20 21 #: init-fx-engine.php:6 121 #: init-fx-engine.php:60 22 22 msgid "Settings" 23 23 msgstr "Cài đặt" … … 88 88 89 89 #: includes/settings-form.php:179 90 #: includes/settings-form.php: 39690 #: includes/settings-form.php:429 91 91 #: includes/settings-seasonal.php:73 92 92 msgid "Custom schedule" … … 94 94 95 95 #: includes/settings-form.php:187 96 #: includes/settings-form.php:4 0996 #: includes/settings-form.php:442 97 97 #: includes/settings-seasonal.php:86 98 98 msgid "Start Date" … … 100 100 101 101 #: includes/settings-form.php:191 102 #: includes/settings-form.php:4 13102 #: includes/settings-form.php:446 103 103 #: includes/settings-seasonal.php:90 104 104 msgid "End Date" 105 105 msgstr "Ngày kết thúc" 106 106 107 #: includes/settings-form.php: 369107 #: includes/settings-form.php:402 108 108 msgid "Grayscale (Turn off full page color)" 109 109 msgstr "Grayscale (Tắt màu sắc toàn trang)" 110 110 111 #: includes/settings-form.php: 381111 #: includes/settings-form.php:414 112 112 msgid "Enable grayscale effect on site" 113 113 msgstr "Bật hiệu ứng grayscale trên trang" 114 114 115 #: includes/settings-form.php: 391115 #: includes/settings-form.php:424 116 116 msgid "Always on" 117 117 msgstr "Luôn bật" … … 142 142 143 143 #: includes/settings-form.php:44 144 #: includes/settings-form.php:4 22144 #: includes/settings-form.php:455 145 145 msgid "Inline Formatting" 146 146 msgstr "Định dạng inline" 147 147 148 #: includes/settings-form.php:4 34148 #: includes/settings-form.php:467 149 149 msgid "Apply inline formatting in text" 150 150 msgstr "Áp dụng định dạng inline trong văn bản" 151 151 152 #: includes/settings-form.php:4 24152 #: includes/settings-form.php:457 153 153 msgid "When enabled, the engine will parse simple inline markup in outputs." 154 154 msgstr "Khi bật, engine sẽ phân tích cú pháp các ký hiệu inline đơn giản trong nội dung hiển thị." … … 162 162 msgstr "Chỉ hiển thị hiệu ứng tuyết rơi ở trang chủ" 163 163 164 #: includes/settings-form.php:2 22164 #: includes/settings-form.php:232 165 165 msgid "Snow amount" 166 166 msgstr "Số lượng tuyết" 167 167 168 #: includes/settings-form.php:2 33168 #: includes/settings-form.php:243 169 169 msgid "Snow size" 170 170 msgstr "Kích thước tuyết" 171 171 172 #: includes/settings-form.php:2 43172 #: includes/settings-form.php:253 173 173 msgid "Fall speed" 174 174 msgstr "Tốc độ rơi" 175 175 176 #: includes/settings-form.php:2 53176 #: includes/settings-form.php:263 177 177 #: includes/settings-seasonal.php:244 178 178 msgid "Opacity" 179 179 msgstr "Độ trong suốt" 180 180 181 #: includes/settings-form.php:2 28181 #: includes/settings-form.php:238 182 182 msgid "Recommended: 60–100" 183 183 msgstr "Khuyến nghị: 60–100" … … 361 361 msgstr "Phát hiệu ứng chào mừng theo chủ đề một lần mỗi lượt truy cập (ví dụ: bắn pháo hoa dịp Năm mới, lì xì dịp Tết)" 362 362 363 #: includes/settings-form.php: 279363 #: includes/settings-form.php:312 364 364 #: includes/settings-seasonal.php:200 365 365 msgid "Respect the visitor's \"reduce motion\" system setting" … … 370 370 msgstr "Emoji tùy chỉnh" 371 371 372 #: includes/settings-form.php:3 14372 #: includes/settings-form.php:347 373 373 #: includes/settings-seasonal.php:216 374 374 msgid "Amount" … … 383 383 msgstr "Kích thước (px)" 384 384 385 #: includes/settings-form.php:3 18385 #: includes/settings-form.php:351 386 386 #: includes/settings-seasonal.php:235 387 387 msgid "Speed" … … 394 394 #: includes/settings-form.php:72 395 395 #: includes/settings-form.php:158 396 #: includes/settings-form.php: 376397 #: includes/settings-form.php:4 29396 #: includes/settings-form.php:409 397 #: includes/settings-form.php:462 398 398 #: includes/settings-seasonal.php:36 399 399 msgid "Enable" … … 418 418 419 419 #: includes/settings-form.php:169 420 #: includes/settings-form.php: 386420 #: includes/settings-form.php:419 421 421 #: includes/settings-seasonal.php:63 422 422 msgid "Schedule" … … 424 424 425 425 #: includes/settings-form.php:185 426 #: includes/settings-form.php:4 07426 #: includes/settings-form.php:440 427 427 #: includes/settings-seasonal.php:84 428 428 msgid "Custom dates" … … 430 430 431 431 #: includes/settings-form.php:194 432 #: includes/settings-form.php:4 16432 #: includes/settings-form.php:449 433 433 #: includes/settings-seasonal.php:93 434 434 msgid "Only used with the custom schedule." … … 440 440 msgstr "Chỉ trang chủ" 441 441 442 #: includes/settings-form.php: 371442 #: includes/settings-form.php:404 443 443 msgid "Turn the whole site black and white, for solemn occasions or national mourning." 444 444 msgstr "Chuyển toàn bộ trang sang trắng đen, dùng cho các dịp trang nghiêm hoặc quốc tang." 445 445 446 #: includes/settings-form.php:4 37446 #: includes/settings-form.php:470 447 447 msgid "Supported: *bold*, `italic`, ~strike~, ^mark^, _highlight_, ||spoiler||" 448 448 msgstr "Hỗ trợ: *đậm*, `nghiêng`, ~gạch ngang~, ^đánh dấu^, _tô sáng_, ||spoiler||" … … 456 456 msgstr "Hiệu ứng chào mừng" 457 457 458 #: includes/settings-form.php: 274458 #: includes/settings-form.php:307 459 459 #: includes/settings-seasonal.php:195 460 460 msgid "Accessibility" … … 527 527 528 528 #: includes/settings-form.php:42 529 #: includes/settings-form.php: 291529 #: includes/settings-form.php:324 530 530 msgid "Particle Backgrounds" 531 531 msgstr "Nền hạt chuyển động" … … 543 543 msgstr "Kiểu tuyết" 544 544 545 #: includes/settings-form.php:214 546 msgid "Soft dots (classic)" 547 msgstr "Chấm tuyết mềm (cổ điển)" 548 549 #: includes/settings-form.php:215 545 #: includes/settings-form.php:216 550 546 msgid "Crystal snowflakes" 551 547 msgstr "Bông tuyết pha lê" 552 548 553 #: includes/settings-form.php:216 554 msgid "Mixed" 555 msgstr "Kết hợp" 556 557 #: includes/settings-form.php:263 549 #: includes/settings-form.php:273 558 550 msgid "Wind" 559 551 msgstr "Gió" 560 552 561 #: includes/settings-form.php:268 562 msgid "Gentle wind gusts that slowly change direction" 563 msgstr "Gió nhẹ, thỉnh thoảng đổi hướng" 564 565 #: includes/settings-form.php:293 553 #: includes/settings-form.php:326 566 554 msgid "Animated particle backgrounds powered by tsParticles. Add the \"FX Ambient Section\" block in the Block Editor, or build a shortcode below and paste it inside any section. Nothing here is saved — it is a live generator." 567 555 msgstr "Nền hạt chuyển động dùng thư viện tsParticles. Thêm block \"FX Ambient Section\" trong Block Editor, hoặc tạo shortcode bên dưới rồi dán vào section bất kỳ. Phần này không lưu lại — chỉ là công cụ tạo shortcode xem trước trực tiếp." 568 556 569 #: includes/settings-form.php: 297557 #: includes/settings-form.php:330 570 558 #: assets/js/blocks-editor.js:231 571 559 msgid "Preset" 572 560 msgstr "Kiểu nền" 573 561 574 #: includes/settings-form.php:3 07562 #: includes/settings-form.php:340 575 563 msgid "Color" 576 564 msgstr "Màu" 577 565 578 #: includes/settings-form.php:3 10566 #: includes/settings-form.php:343 579 567 #: assets/js/blocks-editor.js:243 580 568 msgid "Leave empty to use the preset color." 581 569 msgstr "Để trống để dùng màu mặc định của kiểu nền." 582 570 583 #: includes/settings-form.php:3 22571 #: includes/settings-form.php:355 584 572 #: assets/js/blocks-editor.js:251 585 573 msgid "Emojis" 586 574 msgstr "Emoji" 587 575 588 #: includes/settings-form.php:3 25576 #: includes/settings-form.php:358 589 577 msgid "Only for the \"Floating emoji\" preset." 590 578 msgstr "Chỉ dùng cho kiểu \"Emoji bay lơ lửng\"." 591 579 592 #: includes/settings-form.php:3 29580 #: includes/settings-form.php:362 593 581 #: assets/js/blocks-editor.js:292 594 582 msgid "On hover" 595 583 msgstr "Khi rê chuột" 596 584 597 #: includes/settings-form.php:3 32598 #: includes/settings-form.php:3 44585 #: includes/settings-form.php:365 586 #: includes/settings-form.php:377 599 587 #: assets/js/blocks-editor.js:295 600 588 #: assets/js/blocks-editor.js:310 … … 602 590 msgstr "Theo kiểu nền" 603 591 604 #: includes/settings-form.php:3 33605 #: includes/settings-form.php:3 45592 #: includes/settings-form.php:366 593 #: includes/settings-form.php:378 606 594 #: assets/js/blocks-editor.js:296 607 595 #: assets/js/blocks-editor.js:311 … … 609 597 msgstr "Không làm gì" 610 598 611 #: includes/settings-form.php:3 34599 #: includes/settings-form.php:367 612 600 #: assets/js/blocks-editor.js:297 613 601 msgid "Repulse" 614 602 msgstr "Đẩy ra" 615 603 616 #: includes/settings-form.php:3 35604 #: includes/settings-form.php:368 617 605 #: assets/js/blocks-editor.js:298 618 606 msgid "Grab" 619 607 msgstr "Nối dây" 620 608 621 #: includes/settings-form.php:3 36609 #: includes/settings-form.php:369 622 610 #: assets/js/blocks-editor.js:299 623 611 msgid "Bubble" 624 612 msgstr "Phóng to" 625 613 626 #: includes/settings-form.php:3 41614 #: includes/settings-form.php:374 627 615 #: assets/js/blocks-editor.js:307 628 616 msgid "On click" 629 617 msgstr "Khi bấm" 630 618 631 #: includes/settings-form.php:3 46619 #: includes/settings-form.php:379 632 620 #: assets/js/blocks-editor.js:312 633 621 msgid "Add particles" 634 622 msgstr "Thêm hạt" 635 623 636 #: includes/settings-form.php:3 47624 #: includes/settings-form.php:380 637 625 #: assets/js/blocks-editor.js:313 638 626 msgid "Remove particles" 639 627 msgstr "Bớt hạt" 640 628 641 #: includes/settings-form.php:3 52629 #: includes/settings-form.php:385 642 630 msgid "Live preview" 643 631 msgstr "Xem trước trực tiếp" 644 632 645 #: includes/settings-form.php:3 58633 #: includes/settings-form.php:391 646 634 msgid "Shortcode" 647 635 msgstr "Shortcode" 648 636 649 #: includes/settings-form.php:3 61637 #: includes/settings-form.php:394 650 638 msgid "Copy" 651 639 msgstr "Sao chép" 652 640 653 #: includes/settings-form.php:3 62641 #: includes/settings-form.php:395 654 642 msgid "The parent element should have position: relative so the particles stay inside it." 655 643 msgstr "Phần tử cha nên có position: relative để các hạt nằm gọn bên trong." 656 644 657 #: includes/settings-form.php:4 01645 #: includes/settings-form.php:434 658 646 msgid "Paused (keep settings, do not apply)" 659 647 msgstr "Tạm dừng (giữ cài đặt, không áp dụng)" 660 648 661 #: includes/settings-form.php:4 40649 #: includes/settings-form.php:473 662 650 msgid "Spoilers are blurred until clicked. Short spoilers hide the \"Tap to reveal\" label automatically." 663 651 msgstr "Spoiler được làm mờ cho tới khi bấm vào. Spoiler ngắn sẽ tự ẩn nhãn \"Nhấn để hiển thị\"." … … 815 803 msgid "confetti" 816 804 msgstr "pháo giấy" 805 806 #: includes/settings-form.php:214 807 msgid "Classic round (random opacity, depth)" 808 msgstr "Tròn cổ điển (độ mờ ngẫu nhiên, có chiều sâu)" 809 810 #: includes/settings-form.php:215 811 msgid "Soft glow" 812 msgstr "Phát sáng mềm" 813 814 #: includes/settings-form.php:217 815 msgid "Classic + crystal snowflakes" 816 msgstr "Tròn cổ điển + bông tuyết pha lê" 817 818 #: includes/settings-form.php:223 819 msgid "Snow color" 820 msgstr "Màu tuyết" 821 822 #: includes/settings-form.php:227 823 msgid "White by default. A light blue or gray keeps the snow visible on light backgrounds." 824 msgstr "Mặc định màu trắng. Chọn xanh nhạt hoặc xám để tuyết vẫn hiện rõ trên nền sáng." 825 826 #: includes/settings-form.php:278 827 msgid "Gentle swaying and wind gusts that slowly change direction" 828 msgstr "Đung đưa nhẹ và gió thổi, thỉnh thoảng đổi hướng" 829 830 #: includes/settings-form.php:280 831 msgid "Off: snow drifts down at slightly random angles, like previous versions." 832 msgstr "Khi tắt: tuyết rơi chéo nhẹ theo góc ngẫu nhiên, giống các phiên bản trước." 833 834 #: includes/settings-form.php:285 835 msgid "Performance" 836 msgstr "Hiệu năng" 837 838 #: includes/settings-form.php:289 839 msgid "Smooth (60 fps)" 840 msgstr "Mượt (60 fps)" 841 842 #: includes/settings-form.php:290 843 msgid "Battery saver (30 fps)" 844 msgstr "Tiết kiệm pin (30 fps)" 845 846 #: includes/settings-form.php:296 847 msgid "Small screens" 848 msgstr "Màn hình nhỏ" 849 850 #: includes/settings-form.php:301 851 msgid "Do not show snowfall on screens narrower than 768px" 852 msgstr "Không hiện tuyết trên màn hình hẹp hơn 768px" -
init-fx-engine/trunk/languages/init-fx-engine.pot
r3812923 r3812973 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Init FX Engine 2.0. 2\n"5 "Project-Id-Version: Init FX Engine 2.0.3\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/init-fx-engine\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-11-20T04: 13:00+00:00\n"12 "POT-Creation-Date: 2026-11-20T04:59:43+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 141 141 142 142 #: includes/settings-form.php:42 143 #: includes/settings-form.php: 291143 #: includes/settings-form.php:324 144 144 msgid "Particle Backgrounds" 145 145 msgstr "" … … 150 150 151 151 #: includes/settings-form.php:44 152 #: includes/settings-form.php:4 22152 #: includes/settings-form.php:455 153 153 msgid "Inline Formatting" 154 154 msgstr "" … … 169 169 #: includes/settings-form.php:72 170 170 #: includes/settings-form.php:158 171 #: includes/settings-form.php: 376172 #: includes/settings-form.php:4 29171 #: includes/settings-form.php:409 172 #: includes/settings-form.php:462 173 173 #: includes/settings-seasonal.php:36 174 174 msgid "Enable" … … 230 230 231 231 #: includes/settings-form.php:169 232 #: includes/settings-form.php: 386232 #: includes/settings-form.php:419 233 233 #: includes/settings-seasonal.php:63 234 234 msgid "Schedule" … … 240 240 241 241 #: includes/settings-form.php:179 242 #: includes/settings-form.php: 396242 #: includes/settings-form.php:429 243 243 #: includes/settings-seasonal.php:73 244 244 msgid "Custom schedule" … … 246 246 247 247 #: includes/settings-form.php:185 248 #: includes/settings-form.php:4 07248 #: includes/settings-form.php:440 249 249 #: includes/settings-seasonal.php:84 250 250 msgid "Custom dates" … … 252 252 253 253 #: includes/settings-form.php:187 254 #: includes/settings-form.php:4 09254 #: includes/settings-form.php:442 255 255 #: includes/settings-seasonal.php:86 256 256 msgid "Start Date" … … 258 258 259 259 #: includes/settings-form.php:191 260 #: includes/settings-form.php:4 13260 #: includes/settings-form.php:446 261 261 #: includes/settings-seasonal.php:90 262 262 msgid "End Date" … … 264 264 265 265 #: includes/settings-form.php:194 266 #: includes/settings-form.php:4 16266 #: includes/settings-form.php:449 267 267 #: includes/settings-seasonal.php:93 268 268 msgid "Only used with the custom schedule." … … 283 283 284 284 #: includes/settings-form.php:214 285 msgid " Soft dots (classic)"285 msgid "Classic round (random opacity, depth)" 286 286 msgstr "" 287 287 288 288 #: includes/settings-form.php:215 289 msgid "Soft glow" 290 msgstr "" 291 292 #: includes/settings-form.php:216 289 293 msgid "Crystal snowflakes" 290 294 msgstr "" 291 295 292 #: includes/settings-form.php:216 293 msgid "Mixed" 294 msgstr "" 295 296 #: includes/settings-form.php:222 296 #: includes/settings-form.php:217 297 msgid "Classic + crystal snowflakes" 298 msgstr "" 299 300 #: includes/settings-form.php:223 301 msgid "Snow color" 302 msgstr "" 303 304 #: includes/settings-form.php:227 305 msgid "White by default. A light blue or gray keeps the snow visible on light backgrounds." 306 msgstr "" 307 308 #: includes/settings-form.php:232 297 309 msgid "Snow amount" 298 310 msgstr "" 299 311 300 #: includes/settings-form.php:2 28312 #: includes/settings-form.php:238 301 313 msgid "Recommended: 60–100" 302 314 msgstr "" 303 315 304 #: includes/settings-form.php:2 33316 #: includes/settings-form.php:243 305 317 msgid "Snow size" 306 318 msgstr "" 307 319 308 #: includes/settings-form.php:2 43320 #: includes/settings-form.php:253 309 321 msgid "Fall speed" 310 322 msgstr "" 311 323 312 #: includes/settings-form.php:2 53324 #: includes/settings-form.php:263 313 325 #: includes/settings-seasonal.php:244 314 326 msgid "Opacity" 315 327 msgstr "" 316 328 317 #: includes/settings-form.php:2 63329 #: includes/settings-form.php:273 318 330 msgid "Wind" 319 331 msgstr "" 320 332 321 #: includes/settings-form.php:268 322 msgid "Gentle wind gusts that slowly change direction" 323 msgstr "" 324 325 #: includes/settings-form.php:274 333 #: includes/settings-form.php:278 334 msgid "Gentle swaying and wind gusts that slowly change direction" 335 msgstr "" 336 337 #: includes/settings-form.php:280 338 msgid "Off: snow drifts down at slightly random angles, like previous versions." 339 msgstr "" 340 341 #: includes/settings-form.php:285 342 msgid "Performance" 343 msgstr "" 344 345 #: includes/settings-form.php:289 346 msgid "Smooth (60 fps)" 347 msgstr "" 348 349 #: includes/settings-form.php:290 350 msgid "Battery saver (30 fps)" 351 msgstr "" 352 353 #: includes/settings-form.php:296 354 msgid "Small screens" 355 msgstr "" 356 357 #: includes/settings-form.php:301 358 msgid "Do not show snowfall on screens narrower than 768px" 359 msgstr "" 360 361 #: includes/settings-form.php:307 326 362 #: includes/settings-seasonal.php:195 327 363 msgid "Accessibility" 328 364 msgstr "" 329 365 330 #: includes/settings-form.php: 279366 #: includes/settings-form.php:312 331 367 #: includes/settings-seasonal.php:200 332 368 msgid "Respect the visitor's \"reduce motion\" system setting" 333 369 msgstr "" 334 370 335 #: includes/settings-form.php: 293371 #: includes/settings-form.php:326 336 372 msgid "Animated particle backgrounds powered by tsParticles. Add the \"FX Ambient Section\" block in the Block Editor, or build a shortcode below and paste it inside any section. Nothing here is saved — it is a live generator." 337 373 msgstr "" 338 374 339 #: includes/settings-form.php: 297375 #: includes/settings-form.php:330 340 376 #: assets/js/blocks-editor.js:231 341 377 msgid "Preset" 342 378 msgstr "" 343 379 344 #: includes/settings-form.php:3 07380 #: includes/settings-form.php:340 345 381 msgid "Color" 346 382 msgstr "" 347 383 348 #: includes/settings-form.php:3 10384 #: includes/settings-form.php:343 349 385 #: assets/js/blocks-editor.js:243 350 386 msgid "Leave empty to use the preset color." 351 387 msgstr "" 352 388 353 #: includes/settings-form.php:3 14389 #: includes/settings-form.php:347 354 390 #: includes/settings-seasonal.php:216 355 391 msgid "Amount" 356 392 msgstr "" 357 393 358 #: includes/settings-form.php:3 18394 #: includes/settings-form.php:351 359 395 #: includes/settings-seasonal.php:235 360 396 msgid "Speed" 361 397 msgstr "" 362 398 363 #: includes/settings-form.php:3 22399 #: includes/settings-form.php:355 364 400 #: assets/js/blocks-editor.js:251 365 401 msgid "Emojis" 366 402 msgstr "" 367 403 368 #: includes/settings-form.php:3 25404 #: includes/settings-form.php:358 369 405 msgid "Only for the \"Floating emoji\" preset." 370 406 msgstr "" 371 407 372 #: includes/settings-form.php:3 29408 #: includes/settings-form.php:362 373 409 #: assets/js/blocks-editor.js:292 374 410 msgid "On hover" 375 411 msgstr "" 376 412 377 #: includes/settings-form.php:3 32378 #: includes/settings-form.php:3 44413 #: includes/settings-form.php:365 414 #: includes/settings-form.php:377 379 415 #: assets/js/blocks-editor.js:295 380 416 #: assets/js/blocks-editor.js:310 … … 382 418 msgstr "" 383 419 384 #: includes/settings-form.php:3 33385 #: includes/settings-form.php:3 45420 #: includes/settings-form.php:366 421 #: includes/settings-form.php:378 386 422 #: assets/js/blocks-editor.js:296 387 423 #: assets/js/blocks-editor.js:311 … … 389 425 msgstr "" 390 426 391 #: includes/settings-form.php:3 34427 #: includes/settings-form.php:367 392 428 #: assets/js/blocks-editor.js:297 393 429 msgid "Repulse" 394 430 msgstr "" 395 431 396 #: includes/settings-form.php:3 35432 #: includes/settings-form.php:368 397 433 #: assets/js/blocks-editor.js:298 398 434 msgid "Grab" 399 435 msgstr "" 400 436 401 #: includes/settings-form.php:3 36437 #: includes/settings-form.php:369 402 438 #: assets/js/blocks-editor.js:299 403 439 msgid "Bubble" 404 440 msgstr "" 405 441 406 #: includes/settings-form.php:3 41442 #: includes/settings-form.php:374 407 443 #: assets/js/blocks-editor.js:307 408 444 msgid "On click" 409 445 msgstr "" 410 446 411 #: includes/settings-form.php:3 46447 #: includes/settings-form.php:379 412 448 #: assets/js/blocks-editor.js:312 413 449 msgid "Add particles" 414 450 msgstr "" 415 451 416 #: includes/settings-form.php:3 47452 #: includes/settings-form.php:380 417 453 #: assets/js/blocks-editor.js:313 418 454 msgid "Remove particles" 419 455 msgstr "" 420 456 421 #: includes/settings-form.php:3 52457 #: includes/settings-form.php:385 422 458 msgid "Live preview" 423 459 msgstr "" 424 460 425 #: includes/settings-form.php:3 58461 #: includes/settings-form.php:391 426 462 msgid "Shortcode" 427 463 msgstr "" 428 464 429 #: includes/settings-form.php:3 61465 #: includes/settings-form.php:394 430 466 msgid "Copy" 431 467 msgstr "" 432 468 433 #: includes/settings-form.php:3 62469 #: includes/settings-form.php:395 434 470 msgid "The parent element should have position: relative so the particles stay inside it." 435 471 msgstr "" 436 472 437 #: includes/settings-form.php: 369473 #: includes/settings-form.php:402 438 474 msgid "Grayscale (Turn off full page color)" 439 475 msgstr "" 440 476 441 #: includes/settings-form.php: 371477 #: includes/settings-form.php:404 442 478 msgid "Turn the whole site black and white, for solemn occasions or national mourning." 443 479 msgstr "" 444 480 445 #: includes/settings-form.php: 381481 #: includes/settings-form.php:414 446 482 msgid "Enable grayscale effect on site" 447 483 msgstr "" 448 484 449 #: includes/settings-form.php: 391485 #: includes/settings-form.php:424 450 486 msgid "Always on" 451 487 msgstr "" 452 488 453 #: includes/settings-form.php:4 01489 #: includes/settings-form.php:434 454 490 msgid "Paused (keep settings, do not apply)" 455 491 msgstr "" 456 492 457 #: includes/settings-form.php:4 24493 #: includes/settings-form.php:457 458 494 msgid "When enabled, the engine will parse simple inline markup in outputs." 459 495 msgstr "" 460 496 461 #: includes/settings-form.php:4 34497 #: includes/settings-form.php:467 462 498 msgid "Apply inline formatting in text" 463 499 msgstr "" 464 500 465 #: includes/settings-form.php:4 37501 #: includes/settings-form.php:470 466 502 msgid "Supported: *bold*, `italic`, ~strike~, ^mark^, _highlight_, ||spoiler||" 467 503 msgstr "" 468 504 469 #: includes/settings-form.php:4 40505 #: includes/settings-form.php:473 470 506 msgid "Spoilers are blurred until clicked. Short spoilers hide the \"Tap to reveal\" label automatically." 471 507 msgstr "" … … 666 702 msgstr "" 667 703 668 #: init-fx-engine.php:6 1704 #: init-fx-engine.php:60 669 705 msgid "Settings" 670 706 msgstr "" -
init-fx-engine/trunk/readme.txt
r3812923 r3812973 5 5 Tested up to: 7.2 6 6 Requires PHP: 7.4 7 Stable tag: 2.0. 27 Stable tag: 2.0.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 17 17 > 🎉 Celebrate milestones with fireworks or cannon blasts 18 18 > 💬 Let users experience emoji reactions and heart rain in comments 19 > ❄️ Schedule snowfall automatically or set your own custom dates19 > ❄️ Classic snowfall with random depth, on an automatic or custom schedule 20 20 > 🎄 Hand-drawn seasonal scenes: Christmas, New Year, Lunar New Year (Tết), Valentine, Mid-Autumn, Halloween — with decorations 21 21 > ✨ Particle backgrounds (stars, snow, bubbles, fireflies, network, emoji) powered by tsParticles … … 30 30 31 31 GitHub repository: [https://github.com/brokensmile2103/init-fx-engine](https://github.com/brokensmile2103/init-fx-engine) 32 33 **What's New in v2.0.2:**34 - **Smart loading**: canvas-confetti and the FX engine are only loaded when keyword effects are configured, or on pages that contain an FX shortcode / block. Inline formatting now lives in its own tiny file. A page that uses nothing loads nothing35 - **New seasonal scenes, drawn by hand on canvas**: crystal snowflakes and twinkling string lights for Christmas, peach and apricot blossoms, tumbling lucky-money envelopes and swinging lanterns for Tết, glowing lanterns under a full moon for Mid-Autumn, flapping bats, floating ghosts and spider webs for Halloween, golden glitter and 3D confetti for New Year, glossy hearts for Valentine36 - **Decorations** and **interactive bursts** for seasonal scenes (themed particles burst wherever visitors click)37 - **Faster Snowfall**: a new lightweight canvas renderer replaces particles.js, with depth, wind gusts, optional crystal snowflakes, a Preview button and "reduce motion" support38 - **Particle backgrounds powered by tsParticles**: 6 presets for `[initfxen-fx-ambient]`, a new **FX Ambient Section** block with live preview in the editor, and a shortcode generator in the settings page39 - **New effect**: Blossom Rain (Tết)40 - **Nicer spoilers**: blurred background instead of the gray box, and short spoilers hide the "Tap to reveal" label automatically41 - **Many fixes**: see the changelog42 32 43 33 **Highlights:** … … 49 39 - Supports gradient or solid background for preloader 50 40 - Auto-fetch favicon for logo-based animation 51 - Snowfall effect with date scheduler (auto/custom)41 - Snowfall with date scheduler (auto/custom), 4 snow styles, custom color, wind, battery saver mode and small-screen option 52 42 - Grayscale mode (manual or scheduled) 53 43 - Keywords to trigger effects inside comments or post content … … 80 70 Note: this plugin does not include Abilities API support. It has no data to read or write — everything it does is a purely visual, client-side effect — so there is nothing meaningful for an AI agent or automation tool to query here. 81 71 72 == Snowfall == 73 74 Go to **Settings → Init FX Engine → Snowfall Effect**. Snowfall runs on its own lightweight canvas renderer (no library): 75 76 - **Snow style**: Classic round (default — solid round flakes with random size and opacity for depth, just like earlier versions), Soft glow, Crystal snowflakes, or Classic + crystal 77 - **Snow color**: white by default; a light blue or gray keeps snow visible on light backgrounds 78 - **Schedule**: automatic (Dec 20 – Dec 31) or custom dates, optionally homepage only 79 - **Amount, size, fall speed, opacity** 80 - **Wind**: gentle swaying and gusts; when off, snow drifts down at slightly random angles like before 81 - **Performance**: Smooth (60 fps) or Battery saver (30 fps) 82 - **Small screens**: optionally hide snowfall below 768px 83 - The **Preview** button plays the snow over a night-sky backdrop right in the settings page 84 85 Performance: pre-rendered sprites, frame-rate independent motion, fewer flakes on small screens, no canvas reallocation when the mobile address bar shows or hides, stops when the tab is hidden, starts after the page has loaded and respects "reduce motion". 86 82 87 == Seasonal Effects == 83 88 … … 85 90 86 91 - **Theme**: pick a holiday, or leave it on **Auto** to follow the holiday calendar 87 - **Built-in holiday calendar**: Halloween (Oct 24–31), Christmas (Dec 20–26), New Year (Dec 30 – Jan 2), Tết (one week before Lunar New Year's Day – the 7th day of the new year), Valentine (Feb 10–14), Mid-Autumn (one week before the 15th day of the 8th lunar month )92 - **Built-in holiday calendar**: Halloween (Oct 24–31), Christmas (Dec 20–26), New Year (Dec 30 – Jan 2), Tết (one week before Lunar New Year's Day – the 7th day of the new year), Valentine (Feb 10–14), Mid-Autumn (one week before the 15th day of the 8th lunar month – the 16th) 88 93 - **Custom schedule** or **Always on** (handy for testing on localhost) 89 94 - **Hand-drawn scenes**: crystal snowflakes, blossoms, petals, lucky-money envelopes, lanterns, hearts, bats, ghosts, glitter and confetti — drawn once into sprites, then animated on a single canvas … … 159 164 1. Settings page — section navigation and Preloader (loading screen) settings. 160 165 2. Keyword Effects — keywords for each effect, with a Preview button per effect. 161 3. Snowfall Effect — schedule, homepage-only, snow style, amount, size, speed, opacity, windand the Preview button.166 3. Snowfall Effect — schedule, homepage-only, snow style, snow color, amount, size, speed, opacity, wind, performance mode, small screens and the Preview button. 162 167 4. Seasonal Effects — theme, schedule, holiday calendar with "Today visitors will see", greeting, decorations, interactive bursts, accessibility and particle settings. 163 168 5. Particle Backgrounds — shortcode generator with a live tsParticles preview. 164 169 6. Grayscale — enable, always on / custom schedule / paused, custom dates. 165 170 7. Inline Formatting — enable inline markup and blurred spoilers. 166 8. Snowfall effect on a live site ("Mixed" style: soft dots and crystal snowflakes).171 8. Classic snowfall on a live site: round flakes with random size and opacity for depth. 167 172 9. Christmas seasonal scene with string lights, crystal snowflakes and gifts. 168 173 10. FX Ambient Section block with a live particle background in the Block Editor. … … 170 175 171 176 == Changelog == 177 178 = 2.0.3 – November 20, 2026 = 179 - **Snowfall: Classic round style is back as the default** — solid round flakes with random size and random opacity for depth, drifting down at slightly random angles, matching the look of the particles.js snowfall used before 2.0.2. Existing "dots" settings automatically use the classic look 180 - **New Snowfall options**: Snow color, "Soft glow" style (the 2.0.2 dots), "Classic + crystal snowflakes", Performance (Smooth 60 fps / Battery saver 30 fps) and "Do not show on screens narrower than 768px" 181 - **Wind** is now optional and off by default for new installs (gentle swaying and gusts when enabled) 182 - **Performance**: the snowfall canvas is no longer reallocated when the mobile address bar shows or hides while scrolling; sprites are built once per color 183 - **Fix**: the Snowfall Preview button looked like it did nothing because white snow was invisible on the light admin background — the preview now plays over a night-sky backdrop 184 - **Readme**: new Snowfall section; "What's New" blocks removed from the description (see the changelog) 185 - **Internationalization**: new strings added to the POT file and Vietnamese translation 172 186 173 187 = 2.0.2 – November 20, 2026 = … … 227 241 - **Changed**: `Requires at least` raised from 5.5 to 6.9, for consistency with the rest of the Init Plugin Suite's 2.0.0 releases 228 242 - **Note**: this release does not add Abilities API support. This plugin has no data to read or write — everything it does is a purely visual, client-side effect — so there is nothing meaningful for an AI agent to query 229 - **Tested up to: 7. 2**243 - **Tested up to: 7.1** 230 244 231 245 = 1.6 – December 17, 2025 =
Note:
See TracChangeset
for help on using the changeset viewer.