Plugin Directory

Changeset 3812973


Ignore:
Timestamp:
11/20/2026 05:06:53 AM (less than one hour ago)
Author:
brokensmile.2103
Message:

Release v2.0.3 - Snowfall: classic round flakes back as default, snow color, battery saver, small-screen option, preview fix

Location:
init-fx-engine
Files:
39 added
13 edited

Legend:

Unmodified
Added
Removed
  • init-fx-engine/trunk/assets/js/admin-preview.js

    r3812923 r3812973  
    6969                                        opacity: valueOf( box, '.fx-snowfall-opacity' ),
    7070                                        style: valueOf( box, '.fx-snowfall-style' ),
     71                                        color: valueOf( box, '.fx-snowfall-color' ),
    7172                                        wind: valueOf( box, '.fx-snowfall-wind' ),
     73                                        fps: valueOf( box, '.fx-snowfall-fps' ),
    7274                                }, 8000 );
    7375                        } );
  • init-fx-engine/trunk/assets/js/fx-snowfall.js

    r3812923 r3812973  
    22 * Init FX Engine — Snowfall.
    33 *
    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.
    1117 *
    1218 * API: window.initFxSnowfall.start( config ) / stop() / preview( config, ms ) / isRunning()
    … …  
    2329        var REF_AREA = 1440 * 900;
    2430        var SPRITE_PX = 64;
     31        var STYLES = [ 'dots', 'soft', 'flakes', 'mixed' ];
    2532
    2633        var state = {
    … …  
    2835                canvas: null,
    2936                ctx: null,
    30                 dot: null,
    31                 flakes: [],
     37                sprites: null,
    3238                particles: [],
    3339                width: 0,
    3440                height: 0,
     41                allocW: 0,
     42                allocH: 0,
    3543                dpr: 1,
    3644                raf: 0,
    3745                last: 0,
     46                frameGap: 0,
    3847                running: false,
    3948                resizeQueued: false,
    … …  
    6170        }
    6271
     72        function isSmallScreen() {
     73                return !! ( window.matchMedia && window.matchMedia( '(max-width: 767px)' ).matches );
     74        }
     75
    6376        function normalize( cfg ) {
    6477                cfg = cfg || {};
    … …  
    6881                        speed: num( cfg.speed, 0.3, 5, 1.2 ),
    6982                        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,
    7288                        reducedMotion: cfg.reducedMotion !== false,
    7389                };
    … …  
    7591
    7692        // ---------------------------------------------------------------------
    77         // Sprites (vẽ 1 lần)
     93        // Sprites (vẽ 1 lần cho mỗi lần start)
    7894        // ---------------------------------------------------------------------
    7995        function makeCanvas( size ) {
    … …  
    84100        }
    85101
    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 ) {
    88115                var c = makeCanvas( SPRITE_PX );
    89116                var g = c.getContext( '2d' );
    90117                var r = SPRITE_PX / 2;
    91118
    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;
    98129                g.fillStyle = halo;
    99130                g.beginPath();
    … …  
    105136
    106137        // Bông tuyết pha lê 6 cánh (3 biến thể).
    107         function buildFlake( variant ) {
     138        function buildFlake( variant, color ) {
    108139                var c = makeCanvas( SPRITE_PX );
    109140                var g = c.getContext( '2d' );
    … …  
    113144
    114145                g.translate( r, r );
    115                 g.strokeStyle = '#ffffff';
     146                g.strokeStyle = color;
    116147                g.lineCap = 'round';
    117148                g.shadowColor = 'rgba(120,160,210,0.55)';
    … …  
    153184                }
    154185
    155                 g.fillStyle = '#ffffff';
     186                g.fillStyle = color;
    156187                g.beginPath();
    157188                g.arc( 0, 0, variant === 1 ? 3.5 : 2.5, 0, Math.PI * 2 );
    … …  
    162193
    163194        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                };
    168201        }
    169202
    … …  
    178211        function spawn( p, initial ) {
    179212                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ũ.
    185226                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 );
    190229                p.phase = rand( 0, Math.PI * 2 );
    191230                p.rot = rand( 0, Math.PI * 2 );
    192231                p.spin = rand( -0.8, 0.8 );
    193232                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;
    195234
    196235                return p;
    … …  
    211250        function updateWind( dt ) {
    212251                if ( ! state.cfg.wind ) {
    213                         state.wind = 0;
    214252                        return;
    215253                }
    … …  
    217255                if ( state.windTimer <= 0 ) {
    218256                        state.windTimer = rand( 4, 9 );
    219                         state.windTarget = rand( -1, 1 ) * 22 * state.cfg.speed;
     257                        state.windTarget = rand( -1, 1 ) * 20 * state.cfg.speed;
    220258                }
    221259                // Tiến dần về hướng gió mới → đổi hướng rất êm.
    … …  
    228266                var h = state.height;
    229267                var wind = state.wind;
    230                 var i, p;
     268                var i, p, dx;
    231269
    232270                for ( i = 0; i < list.length; i++ ) {
    233271                        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
    235279                        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
    237282                        if ( p.flake ) {
    238283                                p.rot += p.spin * dt;
    … …  
    253298                var dpr = state.dpr;
    254299                var list = state.particles;
    255                 var dot = state.dot;
    256300                var i, p, d, cos, sin, s;
    257301
    … …  
    259303                ctx.clearRect( 0, 0, state.canvas.width, state.canvas.height );
    260304
    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.
    262306                ctx.setTransform( dpr, 0, 0, dpr, 0, 0 );
    263307                for ( i = 0; i < list.length; i++ ) {
    … …  
    268312                        d = p.r * 2;
    269313                        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 );
    271315                }
    272316
    … …  
    294338                }
    295339
    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;
    297348                state.last = now;
    298349
    … …  
    300351                update( dt );
    301352                draw();
    302 
    303                 state.raf = window.requestAnimationFrame( frame );
    304353        }
    305354
    … …  
    313362                }
    314363
    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                }
    320381
    321382                syncParticleCount();
    … …  
    341402                        state.raf = window.requestAnimationFrame( frame );
    342403                }
    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();
    362404        }
    363405
    … …  
    389431        }
    390432
     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
    391454        function start( config ) {
    392455                stop();
    … …  
    401464                canvas.className = 'init-fx-snowfall';
    402465                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;';
    404467
    405468                var ctx = canvas.getContext( '2d' );
    … …  
    412475                state.ctx = ctx;
    413476                state.wind = 0;
     477                state.windTarget = 0;
    414478                state.windTimer = 0;
     479                state.frameGap = cfg.fps === 30 ? 1000 / 30 - 2 : 0;
     480                state.dpr = 0;
    415481
    416482                buildSprites();
    … …  
    432498                var cfg = normalize( config );
    433499                cfg.reducedMotion = false; // Preview trong admin luôn chạy.
     500                cfg.hideMobile = false;
    434501                if ( start( cfg ) ) {
    435502                        addBackdrop();
    … …  
    440507        function boot() {
    441508                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 );
    445516        }
    446517
  • init-fx-engine/trunk/blocks/fx-ambient/block.json

    r3812923 r3812973  
    33        "apiVersion": 3,
    44        "name": "init-fx-engine/fx-ambient",
    5         "version": "2.0.2",
     5        "version": "2.0.3",
    66        "title": "FX Ambient Section",
    77        "category": "init-fx-engine",
  • init-fx-engine/trunk/blocks/fx-trigger/block.json

    r3812923 r3812973  
    33        "apiVersion": 3,
    44        "name": "init-fx-engine/fx-trigger",
    5         "version": "2.0.2",
     5        "version": "2.0.3",
    66        "title": "FX Trigger",
    77        "category": "init-fx-engine",
  • init-fx-engine/trunk/includes/settings-form.php

    r3812923 r3812973  
    212212                                        <td>
    213213                                                <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>
    215216                                                        <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>
    217218                                                </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>
    218228                                        </td>
    219229                                </tr>
    … …  
    266276                                                <label>
    267277                                                        <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' ); ?>
    269302                                                </label>
    270303                                        </td>
  • init-fx-engine/trunk/includes/snowfall.php

    r3812923 r3812973  
    33 * Snowfall Effect.
    44 *
    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 khi
    7  * ẩ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.
    88 *
    99 * @package Init_FX_Engine
    … …  
    2929                'opacity'        => 0.6,
    3030                'style'          => 'dots',
    31                 'wind'           => true,
     31                'color'          => '#ffffff',
     32                'wind'           => false,
     33                'fps'            => 60,
     34                'hide_mobile'    => false,
    3235                'reduced_motion' => true,
    3336        );
     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 */
     45function init_plugin_suite_fx_engine_snowfall_styles() {
     46        return array( 'dots', 'soft', 'flakes', 'mixed' );
    3447}
    3548
    … …  
    115128                'speed'         => max( 0.3, min( 5, (float) $snowfall['speed'] ) ),
    116129                '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',
    118132                'wind'          => ! empty( $snowfall['wind'] ),
     133                'fps'           => 30 === (int) $snowfall['fps'] ? 30 : 60,
     134                'hideMobile'    => ! empty( $snowfall['hide_mobile'] ),
    119135                'reducedMotion' => ! empty( $snowfall['reduced_motion'] ),
    120136        );
    … …  
    135151        $end      = sanitize_text_field( $input['custom_end'] ?? '' );
    136152        $date_rx  = '/^\d{4}-\d{2}-\d{2}$/';
     153        $color    = sanitize_hex_color( $input['color'] ?? '#ffffff' );
    137154
    138155        return array(
    … …  
    146163                'speed'          => max( 0.3, min( 5, floatval( $input['speed'] ?? $defaults['speed'] ) ) ),
    147164                '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',
    149167                'wind'           => ! empty( $input['wind'] ),
     168                'fps'            => 30 === intval( $input['fps'] ?? 60 ) ? 30 : 60,
     169                'hide_mobile'    => ! empty( $input['hide_mobile'] ),
    150170                'reduced_motion' => ! empty( $input['reduced_motion'] ),
    151171        );
  • init-fx-engine/trunk/init-fx-engine.php

    r3812923 r3812973  
    44 * 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!
    55 * Plugin URI: https://inithtml.com/plugin/init-fx-engine/
    6  * Version: 2.0.2
     6 * Version: 2.0.3
    77 * Author: Init HTML
    88 * Author URI: https://inithtml.com/
    … …  
    2121// === DEFINE CONSTANTS ===
    2222
    23 define( 'INIT_PLUGIN_SUITE_FX_ENGINE_VERSION', '2.0.2' );
     23define( 'INIT_PLUGIN_SUITE_FX_ENGINE_VERSION', '2.0.3' );
    2424define( 'INIT_PLUGIN_SUITE_FX_ENGINE_SLUG', 'init-fx-engine' );
    2525define( 'INIT_PLUGIN_SUITE_FX_ENGINE_OPTION', 'init_plugin_suite_fx_engine_settings' );
  • init-fx-engine/trunk/languages/init-fx-engine-vi.po

    r3812923 r3812973  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: Init FX Engine 2.0.2\n"
     3"Project-Id-Version: Init FX Engine 2.0.3\n"
    44"Report-Msgid-Bugs-To: \n"
    55"Last-Translator: \n"
    … …  
    1919msgstr "Cài đặt Init FX Engine"
    2020
    21 #: init-fx-engine.php:61
     21#: init-fx-engine.php:60
    2222msgid "Settings"
    2323msgstr "Cài đặt"
    … …  
    8888
    8989#: includes/settings-form.php:179
    90 #: includes/settings-form.php:396
     90#: includes/settings-form.php:429
    9191#: includes/settings-seasonal.php:73
    9292msgid "Custom schedule"
    … …  
    9494
    9595#: includes/settings-form.php:187
    96 #: includes/settings-form.php:409
     96#: includes/settings-form.php:442
    9797#: includes/settings-seasonal.php:86
    9898msgid "Start Date"
    … …  
    100100
    101101#: includes/settings-form.php:191
    102 #: includes/settings-form.php:413
     102#: includes/settings-form.php:446
    103103#: includes/settings-seasonal.php:90
    104104msgid "End Date"
    105105msgstr "Ngày kết thúc"
    106106
    107 #: includes/settings-form.php:369
     107#: includes/settings-form.php:402
    108108msgid "Grayscale (Turn off full page color)"
    109109msgstr "Grayscale (Tắt màu sắc toàn trang)"
    110110
    111 #: includes/settings-form.php:381
     111#: includes/settings-form.php:414
    112112msgid "Enable grayscale effect on site"
    113113msgstr "Bật hiệu ứng grayscale trên trang"
    114114
    115 #: includes/settings-form.php:391
     115#: includes/settings-form.php:424
    116116msgid "Always on"
    117117msgstr "Luôn bật"
    … …  
    142142
    143143#: includes/settings-form.php:44
    144 #: includes/settings-form.php:422
     144#: includes/settings-form.php:455
    145145msgid "Inline Formatting"
    146146msgstr "Định dạng inline"
    147147
    148 #: includes/settings-form.php:434
     148#: includes/settings-form.php:467
    149149msgid "Apply inline formatting in text"
    150150msgstr "Áp dụng định dạng inline trong văn bản"
    151151
    152 #: includes/settings-form.php:424
     152#: includes/settings-form.php:457
    153153msgid "When enabled, the engine will parse simple inline markup in outputs."
    154154msgstr "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ị."
    … …  
    162162msgstr "Chỉ hiển thị hiệu ứng tuyết rơi ở trang chủ"
    163163
    164 #: includes/settings-form.php:222
     164#: includes/settings-form.php:232
    165165msgid "Snow amount"
    166166msgstr "Số lượng tuyết"
    167167
    168 #: includes/settings-form.php:233
     168#: includes/settings-form.php:243
    169169msgid "Snow size"
    170170msgstr "Kích thước tuyết"
    171171
    172 #: includes/settings-form.php:243
     172#: includes/settings-form.php:253
    173173msgid "Fall speed"
    174174msgstr "Tốc độ rơi"
    175175
    176 #: includes/settings-form.php:253
     176#: includes/settings-form.php:263
    177177#: includes/settings-seasonal.php:244
    178178msgid "Opacity"
    179179msgstr "Độ trong suốt"
    180180
    181 #: includes/settings-form.php:228
     181#: includes/settings-form.php:238
    182182msgid "Recommended: 60–100"
    183183msgstr "Khuyến nghị: 60–100"
    … …  
    361361msgstr "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)"
    362362
    363 #: includes/settings-form.php:279
     363#: includes/settings-form.php:312
    364364#: includes/settings-seasonal.php:200
    365365msgid "Respect the visitor's \"reduce motion\" system setting"
    … …  
    370370msgstr "Emoji tùy chỉnh"
    371371
    372 #: includes/settings-form.php:314
     372#: includes/settings-form.php:347
    373373#: includes/settings-seasonal.php:216
    374374msgid "Amount"
    … …  
    383383msgstr "Kích thước (px)"
    384384
    385 #: includes/settings-form.php:318
     385#: includes/settings-form.php:351
    386386#: includes/settings-seasonal.php:235
    387387msgid "Speed"
    … …  
    394394#: includes/settings-form.php:72
    395395#: includes/settings-form.php:158
    396 #: includes/settings-form.php:376
    397 #: includes/settings-form.php:429
     396#: includes/settings-form.php:409
     397#: includes/settings-form.php:462
    398398#: includes/settings-seasonal.php:36
    399399msgid "Enable"
    … …  
    418418
    419419#: includes/settings-form.php:169
    420 #: includes/settings-form.php:386
     420#: includes/settings-form.php:419
    421421#: includes/settings-seasonal.php:63
    422422msgid "Schedule"
    … …  
    424424
    425425#: includes/settings-form.php:185
    426 #: includes/settings-form.php:407
     426#: includes/settings-form.php:440
    427427#: includes/settings-seasonal.php:84
    428428msgid "Custom dates"
    … …  
    430430
    431431#: includes/settings-form.php:194
    432 #: includes/settings-form.php:416
     432#: includes/settings-form.php:449
    433433#: includes/settings-seasonal.php:93
    434434msgid "Only used with the custom schedule."
    … …  
    440440msgstr "Chỉ trang chủ"
    441441
    442 #: includes/settings-form.php:371
     442#: includes/settings-form.php:404
    443443msgid "Turn the whole site black and white, for solemn occasions or national mourning."
    444444msgstr "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."
    445445
    446 #: includes/settings-form.php:437
     446#: includes/settings-form.php:470
    447447msgid "Supported: *bold*, `italic`, ~strike~, ^mark^, _highlight_, ||spoiler||"
    448448msgstr "Hỗ trợ: *đậm*, `nghiêng`, ~gạch ngang~, ^đánh dấu^, _tô sáng_, ||spoiler||"
    … …  
    456456msgstr "Hiệu ứng chào mừng"
    457457
    458 #: includes/settings-form.php:274
     458#: includes/settings-form.php:307
    459459#: includes/settings-seasonal.php:195
    460460msgid "Accessibility"
    … …  
    527527
    528528#: includes/settings-form.php:42
    529 #: includes/settings-form.php:291
     529#: includes/settings-form.php:324
    530530msgid "Particle Backgrounds"
    531531msgstr "Nền hạt chuyển động"
    … …  
    543543msgstr "Kiểu tuyết"
    544544
    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
    550546msgid "Crystal snowflakes"
    551547msgstr "Bông tuyết pha lê"
    552548
    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
    558550msgid "Wind"
    559551msgstr "Gió"
    560552
    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
    566554msgid "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."
    567555msgstr "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."
    568556
    569 #: includes/settings-form.php:297
     557#: includes/settings-form.php:330
    570558#: assets/js/blocks-editor.js:231
    571559msgid "Preset"
    572560msgstr "Kiểu nền"
    573561
    574 #: includes/settings-form.php:307
     562#: includes/settings-form.php:340
    575563msgid "Color"
    576564msgstr "Màu"
    577565
    578 #: includes/settings-form.php:310
     566#: includes/settings-form.php:343
    579567#: assets/js/blocks-editor.js:243
    580568msgid "Leave empty to use the preset color."
    581569msgstr "Để trống để dùng màu mặc định của kiểu nền."
    582570
    583 #: includes/settings-form.php:322
     571#: includes/settings-form.php:355
    584572#: assets/js/blocks-editor.js:251
    585573msgid "Emojis"
    586574msgstr "Emoji"
    587575
    588 #: includes/settings-form.php:325
     576#: includes/settings-form.php:358
    589577msgid "Only for the \"Floating emoji\" preset."
    590578msgstr "Chỉ dùng cho kiểu \"Emoji bay lơ lửng\"."
    591579
    592 #: includes/settings-form.php:329
     580#: includes/settings-form.php:362
    593581#: assets/js/blocks-editor.js:292
    594582msgid "On hover"
    595583msgstr "Khi rê chuột"
    596584
    597 #: includes/settings-form.php:332
    598 #: includes/settings-form.php:344
     585#: includes/settings-form.php:365
     586#: includes/settings-form.php:377
    599587#: assets/js/blocks-editor.js:295
    600588#: assets/js/blocks-editor.js:310
    … …  
    602590msgstr "Theo kiểu nền"
    603591
    604 #: includes/settings-form.php:333
    605 #: includes/settings-form.php:345
     592#: includes/settings-form.php:366
     593#: includes/settings-form.php:378
    606594#: assets/js/blocks-editor.js:296
    607595#: assets/js/blocks-editor.js:311
    … …  
    609597msgstr "Không làm gì"
    610598
    611 #: includes/settings-form.php:334
     599#: includes/settings-form.php:367
    612600#: assets/js/blocks-editor.js:297
    613601msgid "Repulse"
    614602msgstr "Đẩy ra"
    615603
    616 #: includes/settings-form.php:335
     604#: includes/settings-form.php:368
    617605#: assets/js/blocks-editor.js:298
    618606msgid "Grab"
    619607msgstr "Nối dây"
    620608
    621 #: includes/settings-form.php:336
     609#: includes/settings-form.php:369
    622610#: assets/js/blocks-editor.js:299
    623611msgid "Bubble"
    624612msgstr "Phóng to"
    625613
    626 #: includes/settings-form.php:341
     614#: includes/settings-form.php:374
    627615#: assets/js/blocks-editor.js:307
    628616msgid "On click"
    629617msgstr "Khi bấm"
    630618
    631 #: includes/settings-form.php:346
     619#: includes/settings-form.php:379
    632620#: assets/js/blocks-editor.js:312
    633621msgid "Add particles"
    634622msgstr "Thêm hạt"
    635623
    636 #: includes/settings-form.php:347
     624#: includes/settings-form.php:380
    637625#: assets/js/blocks-editor.js:313
    638626msgid "Remove particles"
    639627msgstr "Bớt hạt"
    640628
    641 #: includes/settings-form.php:352
     629#: includes/settings-form.php:385
    642630msgid "Live preview"
    643631msgstr "Xem trước trực tiếp"
    644632
    645 #: includes/settings-form.php:358
     633#: includes/settings-form.php:391
    646634msgid "Shortcode"
    647635msgstr "Shortcode"
    648636
    649 #: includes/settings-form.php:361
     637#: includes/settings-form.php:394
    650638msgid "Copy"
    651639msgstr "Sao chép"
    652640
    653 #: includes/settings-form.php:362
     641#: includes/settings-form.php:395
    654642msgid "The parent element should have position: relative so the particles stay inside it."
    655643msgstr "Phần tử cha nên có position: relative để các hạt nằm gọn bên trong."
    656644
    657 #: includes/settings-form.php:401
     645#: includes/settings-form.php:434
    658646msgid "Paused (keep settings, do not apply)"
    659647msgstr "Tạm dừng (giữ cài đặt, không áp dụng)"
    660648
    661 #: includes/settings-form.php:440
     649#: includes/settings-form.php:473
    662650msgid "Spoilers are blurred until clicked. Short spoilers hide the \"Tap to reveal\" label automatically."
    663651msgstr "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ị\"."
    … …  
    815803msgid "confetti"
    816804msgstr "pháo giấy"
     805
     806#: includes/settings-form.php:214
     807msgid "Classic round (random opacity, depth)"
     808msgstr "Tròn cổ điển (độ mờ ngẫu nhiên, có chiều sâu)"
     809
     810#: includes/settings-form.php:215
     811msgid "Soft glow"
     812msgstr "Phát sáng mềm"
     813
     814#: includes/settings-form.php:217
     815msgid "Classic + crystal snowflakes"
     816msgstr "Tròn cổ điển + bông tuyết pha lê"
     817
     818#: includes/settings-form.php:223
     819msgid "Snow color"
     820msgstr "Màu tuyết"
     821
     822#: includes/settings-form.php:227
     823msgid "White by default. A light blue or gray keeps the snow visible on light backgrounds."
     824msgstr "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
     827msgid "Gentle swaying and wind gusts that slowly change direction"
     828msgstr "Đung đưa nhẹ và gió thổi, thỉnh thoảng đổi hướng"
     829
     830#: includes/settings-form.php:280
     831msgid "Off: snow drifts down at slightly random angles, like previous versions."
     832msgstr "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
     835msgid "Performance"
     836msgstr "Hiệu năng"
     837
     838#: includes/settings-form.php:289
     839msgid "Smooth (60 fps)"
     840msgstr "Mượt (60 fps)"
     841
     842#: includes/settings-form.php:290
     843msgid "Battery saver (30 fps)"
     844msgstr "Tiết kiệm pin (30 fps)"
     845
     846#: includes/settings-form.php:296
     847msgid "Small screens"
     848msgstr "Màn hình nhỏ"
     849
     850#: includes/settings-form.php:301
     851msgid "Do not show snowfall on screens narrower than 768px"
     852msgstr "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  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Init FX Engine 2.0.2\n"
     5"Project-Id-Version: Init FX Engine 2.0.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/init-fx-engine\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"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"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    141141
    142142#: includes/settings-form.php:42
    143 #: includes/settings-form.php:291
     143#: includes/settings-form.php:324
    144144msgid "Particle Backgrounds"
    145145msgstr ""
    … …  
    150150
    151151#: includes/settings-form.php:44
    152 #: includes/settings-form.php:422
     152#: includes/settings-form.php:455
    153153msgid "Inline Formatting"
    154154msgstr ""
    … …  
    169169#: includes/settings-form.php:72
    170170#: includes/settings-form.php:158
    171 #: includes/settings-form.php:376
    172 #: includes/settings-form.php:429
     171#: includes/settings-form.php:409
     172#: includes/settings-form.php:462
    173173#: includes/settings-seasonal.php:36
    174174msgid "Enable"
    … …  
    230230
    231231#: includes/settings-form.php:169
    232 #: includes/settings-form.php:386
     232#: includes/settings-form.php:419
    233233#: includes/settings-seasonal.php:63
    234234msgid "Schedule"
    … …  
    240240
    241241#: includes/settings-form.php:179
    242 #: includes/settings-form.php:396
     242#: includes/settings-form.php:429
    243243#: includes/settings-seasonal.php:73
    244244msgid "Custom schedule"
    … …  
    246246
    247247#: includes/settings-form.php:185
    248 #: includes/settings-form.php:407
     248#: includes/settings-form.php:440
    249249#: includes/settings-seasonal.php:84
    250250msgid "Custom dates"
    … …  
    252252
    253253#: includes/settings-form.php:187
    254 #: includes/settings-form.php:409
     254#: includes/settings-form.php:442
    255255#: includes/settings-seasonal.php:86
    256256msgid "Start Date"
    … …  
    258258
    259259#: includes/settings-form.php:191
    260 #: includes/settings-form.php:413
     260#: includes/settings-form.php:446
    261261#: includes/settings-seasonal.php:90
    262262msgid "End Date"
    … …  
    264264
    265265#: includes/settings-form.php:194
    266 #: includes/settings-form.php:416
     266#: includes/settings-form.php:449
    267267#: includes/settings-seasonal.php:93
    268268msgid "Only used with the custom schedule."
    … …  
    283283
    284284#: includes/settings-form.php:214
    285 msgid "Soft dots (classic)"
     285msgid "Classic round (random opacity, depth)"
    286286msgstr ""
    287287
    288288#: includes/settings-form.php:215
     289msgid "Soft glow"
     290msgstr ""
     291
     292#: includes/settings-form.php:216
    289293msgid "Crystal snowflakes"
    290294msgstr ""
    291295
    292 #: includes/settings-form.php:216
    293 msgid "Mixed"
    294 msgstr ""
    295 
    296 #: includes/settings-form.php:222
     296#: includes/settings-form.php:217
     297msgid "Classic + crystal snowflakes"
     298msgstr ""
     299
     300#: includes/settings-form.php:223
     301msgid "Snow color"
     302msgstr ""
     303
     304#: includes/settings-form.php:227
     305msgid "White by default. A light blue or gray keeps the snow visible on light backgrounds."
     306msgstr ""
     307
     308#: includes/settings-form.php:232
    297309msgid "Snow amount"
    298310msgstr ""
    299311
    300 #: includes/settings-form.php:228
     312#: includes/settings-form.php:238
    301313msgid "Recommended: 60–100"
    302314msgstr ""
    303315
    304 #: includes/settings-form.php:233
     316#: includes/settings-form.php:243
    305317msgid "Snow size"
    306318msgstr ""
    307319
    308 #: includes/settings-form.php:243
     320#: includes/settings-form.php:253
    309321msgid "Fall speed"
    310322msgstr ""
    311323
    312 #: includes/settings-form.php:253
     324#: includes/settings-form.php:263
    313325#: includes/settings-seasonal.php:244
    314326msgid "Opacity"
    315327msgstr ""
    316328
    317 #: includes/settings-form.php:263
     329#: includes/settings-form.php:273
    318330msgid "Wind"
    319331msgstr ""
    320332
    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
     334msgid "Gentle swaying and wind gusts that slowly change direction"
     335msgstr ""
     336
     337#: includes/settings-form.php:280
     338msgid "Off: snow drifts down at slightly random angles, like previous versions."
     339msgstr ""
     340
     341#: includes/settings-form.php:285
     342msgid "Performance"
     343msgstr ""
     344
     345#: includes/settings-form.php:289
     346msgid "Smooth (60 fps)"
     347msgstr ""
     348
     349#: includes/settings-form.php:290
     350msgid "Battery saver (30 fps)"
     351msgstr ""
     352
     353#: includes/settings-form.php:296
     354msgid "Small screens"
     355msgstr ""
     356
     357#: includes/settings-form.php:301
     358msgid "Do not show snowfall on screens narrower than 768px"
     359msgstr ""
     360
     361#: includes/settings-form.php:307
    326362#: includes/settings-seasonal.php:195
    327363msgid "Accessibility"
    328364msgstr ""
    329365
    330 #: includes/settings-form.php:279
     366#: includes/settings-form.php:312
    331367#: includes/settings-seasonal.php:200
    332368msgid "Respect the visitor's \"reduce motion\" system setting"
    333369msgstr ""
    334370
    335 #: includes/settings-form.php:293
     371#: includes/settings-form.php:326
    336372msgid "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."
    337373msgstr ""
    338374
    339 #: includes/settings-form.php:297
     375#: includes/settings-form.php:330
    340376#: assets/js/blocks-editor.js:231
    341377msgid "Preset"
    342378msgstr ""
    343379
    344 #: includes/settings-form.php:307
     380#: includes/settings-form.php:340
    345381msgid "Color"
    346382msgstr ""
    347383
    348 #: includes/settings-form.php:310
     384#: includes/settings-form.php:343
    349385#: assets/js/blocks-editor.js:243
    350386msgid "Leave empty to use the preset color."
    351387msgstr ""
    352388
    353 #: includes/settings-form.php:314
     389#: includes/settings-form.php:347
    354390#: includes/settings-seasonal.php:216
    355391msgid "Amount"
    356392msgstr ""
    357393
    358 #: includes/settings-form.php:318
     394#: includes/settings-form.php:351
    359395#: includes/settings-seasonal.php:235
    360396msgid "Speed"
    361397msgstr ""
    362398
    363 #: includes/settings-form.php:322
     399#: includes/settings-form.php:355
    364400#: assets/js/blocks-editor.js:251
    365401msgid "Emojis"
    366402msgstr ""
    367403
    368 #: includes/settings-form.php:325
     404#: includes/settings-form.php:358
    369405msgid "Only for the \"Floating emoji\" preset."
    370406msgstr ""
    371407
    372 #: includes/settings-form.php:329
     408#: includes/settings-form.php:362
    373409#: assets/js/blocks-editor.js:292
    374410msgid "On hover"
    375411msgstr ""
    376412
    377 #: includes/settings-form.php:332
    378 #: includes/settings-form.php:344
     413#: includes/settings-form.php:365
     414#: includes/settings-form.php:377
    379415#: assets/js/blocks-editor.js:295
    380416#: assets/js/blocks-editor.js:310
    … …  
    382418msgstr ""
    383419
    384 #: includes/settings-form.php:333
    385 #: includes/settings-form.php:345
     420#: includes/settings-form.php:366
     421#: includes/settings-form.php:378
    386422#: assets/js/blocks-editor.js:296
    387423#: assets/js/blocks-editor.js:311
    … …  
    389425msgstr ""
    390426
    391 #: includes/settings-form.php:334
     427#: includes/settings-form.php:367
    392428#: assets/js/blocks-editor.js:297
    393429msgid "Repulse"
    394430msgstr ""
    395431
    396 #: includes/settings-form.php:335
     432#: includes/settings-form.php:368
    397433#: assets/js/blocks-editor.js:298
    398434msgid "Grab"
    399435msgstr ""
    400436
    401 #: includes/settings-form.php:336
     437#: includes/settings-form.php:369
    402438#: assets/js/blocks-editor.js:299
    403439msgid "Bubble"
    404440msgstr ""
    405441
    406 #: includes/settings-form.php:341
     442#: includes/settings-form.php:374
    407443#: assets/js/blocks-editor.js:307
    408444msgid "On click"
    409445msgstr ""
    410446
    411 #: includes/settings-form.php:346
     447#: includes/settings-form.php:379
    412448#: assets/js/blocks-editor.js:312
    413449msgid "Add particles"
    414450msgstr ""
    415451
    416 #: includes/settings-form.php:347
     452#: includes/settings-form.php:380
    417453#: assets/js/blocks-editor.js:313
    418454msgid "Remove particles"
    419455msgstr ""
    420456
    421 #: includes/settings-form.php:352
     457#: includes/settings-form.php:385
    422458msgid "Live preview"
    423459msgstr ""
    424460
    425 #: includes/settings-form.php:358
     461#: includes/settings-form.php:391
    426462msgid "Shortcode"
    427463msgstr ""
    428464
    429 #: includes/settings-form.php:361
     465#: includes/settings-form.php:394
    430466msgid "Copy"
    431467msgstr ""
    432468
    433 #: includes/settings-form.php:362
     469#: includes/settings-form.php:395
    434470msgid "The parent element should have position: relative so the particles stay inside it."
    435471msgstr ""
    436472
    437 #: includes/settings-form.php:369
     473#: includes/settings-form.php:402
    438474msgid "Grayscale (Turn off full page color)"
    439475msgstr ""
    440476
    441 #: includes/settings-form.php:371
     477#: includes/settings-form.php:404
    442478msgid "Turn the whole site black and white, for solemn occasions or national mourning."
    443479msgstr ""
    444480
    445 #: includes/settings-form.php:381
     481#: includes/settings-form.php:414
    446482msgid "Enable grayscale effect on site"
    447483msgstr ""
    448484
    449 #: includes/settings-form.php:391
     485#: includes/settings-form.php:424
    450486msgid "Always on"
    451487msgstr ""
    452488
    453 #: includes/settings-form.php:401
     489#: includes/settings-form.php:434
    454490msgid "Paused (keep settings, do not apply)"
    455491msgstr ""
    456492
    457 #: includes/settings-form.php:424
     493#: includes/settings-form.php:457
    458494msgid "When enabled, the engine will parse simple inline markup in outputs."
    459495msgstr ""
    460496
    461 #: includes/settings-form.php:434
     497#: includes/settings-form.php:467
    462498msgid "Apply inline formatting in text"
    463499msgstr ""
    464500
    465 #: includes/settings-form.php:437
     501#: includes/settings-form.php:470
    466502msgid "Supported: *bold*, `italic`, ~strike~, ^mark^, _highlight_, ||spoiler||"
    467503msgstr ""
    468504
    469 #: includes/settings-form.php:440
     505#: includes/settings-form.php:473
    470506msgid "Spoilers are blurred until clicked. Short spoilers hide the \"Tap to reveal\" label automatically."
    471507msgstr ""
    … …  
    666702msgstr ""
    667703
    668 #: init-fx-engine.php:61
     704#: init-fx-engine.php:60
    669705msgid "Settings"
    670706msgstr ""
  • init-fx-engine/trunk/readme.txt

    r3812923 r3812973  
    55Tested up to: 7.2
    66Requires PHP: 7.4
    7 Stable tag: 2.0.2
     7Stable tag: 2.0.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    1717> 🎉 Celebrate milestones with fireworks or cannon blasts 
    1818> 💬 Let users experience emoji reactions and heart rain in comments 
    19 > ❄️ Schedule snowfall automatically or set your own custom dates 
     19> ❄️ Classic snowfall with random depth, on an automatic or custom schedule 
    2020> 🎄 Hand-drawn seasonal scenes: Christmas, New Year, Lunar New Year (Tết), Valentine, Mid-Autumn, Halloween — with decorations 
    2121> ✨ Particle backgrounds (stars, snow, bubbles, fireflies, network, emoji) powered by tsParticles 
    … …  
    3030
    3131GitHub 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 nothing
    35 - **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 Valentine
    36 - **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" support
    38 - **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 page
    39 - **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 automatically
    41 - **Many fixes**: see the changelog
    4232
    4333**Highlights:**
    … …  
    4939- Supports gradient or solid background for preloader
    5040- 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
    5242- Grayscale mode (manual or scheduled)
    5343- Keywords to trigger effects inside comments or post content
    … …  
    8070Note: 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.
    8171
     72== Snowfall ==
     73
     74Go 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
     85Performance: 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
    8287== Seasonal Effects ==
    8388
    … …  
    8590
    8691- **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)
    8893- **Custom schedule** or **Always on** (handy for testing on localhost)
    8994- **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
    … …  
    1591641. Settings page — section navigation and Preloader (loading screen) settings.
    1601652. 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, wind and the Preview button.
     1663. Snowfall Effect — schedule, homepage-only, snow style, snow color, amount, size, speed, opacity, wind, performance mode, small screens and the Preview button.
    1621674. Seasonal Effects — theme, schedule, holiday calendar with "Today visitors will see", greeting, decorations, interactive bursts, accessibility and particle settings.
    1631685. Particle Backgrounds — shortcode generator with a live tsParticles preview.
    1641696. Grayscale — enable, always on / custom schedule / paused, custom dates.
    1651707. Inline Formatting — enable inline markup and blurred spoilers.
    166 8. Snowfall effect on a live site ("Mixed" style: soft dots and crystal snowflakes).
     1718. Classic snowfall on a live site: round flakes with random size and opacity for depth.
    1671729. Christmas seasonal scene with string lights, crystal snowflakes and gifts.
    16817310. FX Ambient Section block with a live particle background in the Block Editor.
    … …  
    170175
    171176== 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
    172186
    173187= 2.0.2 – November 20, 2026 =
    … …  
    227241- **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
    228242- **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**
    230244
    231245= 1.6 – December 17, 2025 =
Note: See TracChangeset for help on using the changeset viewer.