Plugin Directory

Changeset 3418765


Ignore:
Timestamp:
12/13/2025 07:43:53 AM (3 months ago)
Author:
smartparallax
Message:

svn commit -m "Update trunk to version 1.0.4 – New screenshots and DOMContentLoaded initialization"

Location:
smartparallax/trunk
Files:
12 added
5 edited

Legend:

Unmodified
Added
Removed
  • smartparallax/trunk/assets/css/shared/all.min.css

    r3406594 r3418765  
    11/*!
    2  * SmartParallax Styles v1.0.3
     2 * SmartParallax Styles v1.0.4
    33 * (c) 2025 SmartParallax — https://smartparallax.com/
    44 * Licensed under GPL-2.0-or-later
  • smartparallax/trunk/assets/js/shared/all.min.js

    r3406594 r3418765  
    11/*!
    2  * SmartParallax Scripts v1.0.3
     2 * SmartParallax Scripts v1.0.4
    33 * (c) 2025 SmartParallax — https://smartparallax.com/
    44 * Licensed under GPL-2.0-or-later
    55 */
    6 (function(){'use strict';if(!window.SPF){window.SPF=(()=>{const DEFAULT_BG_SPEED=0.0;const DEFAULT_HEAD_SPEED=0.0;const MOVE_CLAMP=10.0;const CENTER_OFFSET=0.0;const wraps=[...document.querySelectorAll(".parallax-image,.parallax-container")];if(!wraps.length)return true;const clamp=(v,a,b)=> Math.max(a,Math.min(b,v));for(const w of wraps){if(!w.classList.contains("parallax-image"))continue;const cs=getComputedStyle(w);const bg=cs.backgroundImage;if(bg && bg !=="none" && !w.querySelector(".shp-parallax-bg")){const l=document.createElement("div");l.className="shp-parallax-bg";if(w.classList.contains("parallax-top"))l.classList.add("parallax-top");Object.assign(l.style,{position:"absolute",left:0,right:0,top:0,bottom:0,backgroundImage:bg,backgroundSize:cs.backgroundSize,backgroundPosition:cs.backgroundPosition,backgroundRepeat:cs.backgroundRepeat,transform:"translateZ(0)",backfaceVisibility:"hidden"});const m=w.className.match(/parallax-(-?\d{1,2})/);const sAbs=Math.abs(parseInt(m?.[1] || 0,10)/10);const reserve=Math.round(sAbs*100);if(w.classList.contains("parallax-x")){Object.assign(l.style,{height:"100%",left:`-${reserve}vw`,right:`-${reserve}vw`,width:`calc(100%+${reserve*2}vw)`});}else{Object.assign(l.style,{width:"100%",top:`-${reserve}vh`,bottom:`-${reserve}vh`,height:`calc(100%+${reserve*2}vh)`});}w.appendChild(l);w.style.backgroundImage="none";w.style.position="relative";w.style.overflow="hidden";}}const relFactorViewport=el=>{const r=el.getBoundingClientRect(),vh=window.innerHeight;return(((r.top+r.height/2)-vh/2)/(vh+r.height))*2+CENTER_OFFSET;};const speedFromClass=(el,fallback)=>{for(const c of el.classList){const m=c.match(/^parallax-(-?\d{1,2})(-[s])?$/);if(m)return{speed:parseInt(m[1],10)/10,stop:m[2]==='-s'};}return{speed:fallback,stop:false};};const adjustedSpeed=(w,rect,s)=> w.classList.contains("parallax-x")? s.speed*rect.width/rect.height:s.speed;const applyTransform=(el,tx,ty)=>{el.style.transform=`translate3d(${tx.toFixed(3)}px,${ty.toFixed(3)}px,0)`;};function update(){const vh=window.innerHeight;wraps.forEach(w=>{const rect=w.getBoundingClientRect();if(rect.bottom < 0 || rect.top > vh)return;const baseR=relFactorViewport(w);const sSpec=speedFromClass(w,DEFAULT_BG_SPEED);const layer=w.classList.contains("parallax-container")? w:(w.querySelector(".shp-parallax-bg")|| w.querySelector("video"));if(!layer)return;let rel=baseR;if(sSpec.stop && baseR < 0)rel=0;const m=adjustedSpeed(w,rect,sSpec);let tx=0,ty=0;if(m !==0){const move=clamp(-rel*rect.height*m,-rect.height*MOVE_CLAMP,rect.height*MOVE_CLAMP);if(w.classList.contains("parallax-x"))tx=move;else ty=move;}applyTransform(layer,tx,ty);});}function loop(){update();requestAnimationFrame(loop);}window.addEventListener("load",()=>{update();loop();window.addEventListener("resize",update,{passive:true});});return true;})();};})();
     6(function(){'use strict';if(!window.SPF){window.SPF=(()=>{const DEFAULT_BG_SPEED=0.0;const DEFAULT_HEAD_SPEED=0.0;const MOVE_CLAMP=10.0;const CENTER_OFFSET=0.0;const wraps=[...document.querySelectorAll(".parallax-image,.parallax-container")];if(!wraps.length)return true;const clamp=(v,a,b)=> Math.max(a,Math.min(b,v));for(const w of wraps){if(!w.classList.contains("parallax-image"))continue;const cs=getComputedStyle(w);const bg=cs.backgroundImage;if(bg && bg !=="none" && !w.querySelector(".shp-parallax-bg")){const l=document.createElement("div");l.className="shp-parallax-bg";if(w.classList.contains("parallax-top"))l.classList.add("parallax-top");Object.assign(l.style,{position:"absolute",left:0,right:0,top:0,bottom:0,backgroundImage:bg,backgroundSize:cs.backgroundSize,backgroundPosition:cs.backgroundPosition,backgroundRepeat:cs.backgroundRepeat,transform:"translateZ(0)",backfaceVisibility:"hidden"});const m=w.className.match(/parallax-(-?\d{1,2})/);const sAbs=Math.abs(parseInt(m?.[1] || 0,10)/10);const reserve=Math.round(sAbs*100);if(w.classList.contains("parallax-x")){Object.assign(l.style,{height:"100%",left:`-${reserve}vw`,right:`-${reserve}vw`,width:`calc(100%+${reserve*2}vw)`});}else{Object.assign(l.style,{width:"100%",top:`-${reserve}vh`,bottom:`-${reserve}vh`,height:`calc(100%+${reserve*2}vh)`});}w.appendChild(l);w.style.backgroundImage="none";w.style.position="relative";w.style.overflow="hidden";}}const relFactorViewport=el=>{const r=el.getBoundingClientRect(),vh=window.innerHeight;return(((r.top+r.height/2)-vh/2)/(vh+r.height))*2+CENTER_OFFSET;};const speedFromClass=(el,fallback)=>{for(const c of el.classList){const m=c.match(/^parallax-(-?\d{1,2})(-[s])?$/);if(m)return{speed:parseInt(m[1],10)/10,stop:m[2]==='-s'};}return{speed:fallback,stop:false};};const adjustedSpeed=(w,rect,s)=> w.classList.contains("parallax-x")? s.speed*rect.width/rect.height:s.speed;const applyTransform=(el,tx,ty)=>{el.style.transform=`translate3d(${tx.toFixed(3)}px,${ty.toFixed(3)}px,0)`;};function update(){const vh=window.innerHeight;wraps.forEach(w=>{const rect=w.getBoundingClientRect();if(rect.bottom < 0 || rect.top > vh)return;const baseR=relFactorViewport(w);const sSpec=speedFromClass(w,DEFAULT_BG_SPEED);const layer=w.classList.contains("parallax-container")? w:(w.querySelector(".shp-parallax-bg")|| w.querySelector("video"));if(!layer)return;let rel=baseR;if(sSpec.stop && baseR < 0)rel=0;const m=adjustedSpeed(w,rect,sSpec);let tx=0,ty=0;if(m !==0){const move=clamp(-rel*rect.height*m,-rect.height*MOVE_CLAMP,rect.height*MOVE_CLAMP);if(w.classList.contains("parallax-x"))tx=move;else ty=move;}applyTransform(layer,tx,ty);});}function loop(){update();requestAnimationFrame(loop);}document.addEventListener("DOMContentLoaded",()=>{update();loop();window.addEventListener("resize",update,{passive:true});});return true;})();};})();
  • smartparallax/trunk/assets/js/shared/parallax.js

    r3401572 r3418765  
    136136    }
    137137
    138     window.addEventListener("load", () => {
    139       update();
    140       loop();
    141       window.addEventListener("resize", update, { passive: true });
     138    document.addEventListener("DOMContentLoaded", () => {
     139        update();
     140        loop();
     141        window.addEventListener("resize", update, { passive: true });
    142142    });
    143143
  • smartparallax/trunk/readme.txt

    r3414526 r3418765  
    66Requires at least: 6.0
    77Tested up to: 6.9
    8 Stable tag: 1.0.3
     8Stable tag: 1.0.4
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1111
    1212Add smooth, GPU-powered parallax backgrounds and scroll animations to any WordPress block or section. 
    13 Lightweight, fast, and works with all modern themes and page builders.
     13Lightweight, fast, and compatible with all modern themes and page builders.
    1414
    1515== Description ==
    1616
    17 **SmartParallax** adds fluid, GPU-accelerated parallax motion to WordPress blocks, images, and sections. 
    18 Backgrounds, containers, and headings can smoothly move based on scroll position, powered by a tiny JavaScript engine that runs fully on the GPU.
     17**SmartParallax** adds fluid, GPU-accelerated parallax motion to WordPress blocks, images, headings, and sections. 
     18Backgrounds, containers, and elements can smoothly move based on scroll position, powered by a tiny JavaScript engine running fully on the GPU.
    1919
    20 The plugin integrates seamlessly with Gutenberg, Elementor, Bricks, and classic themes — without dependencies.
     20The plugin integrates seamlessly with Gutenberg, Elementor, Bricks, Divi, Oxygen, and classic themes — without dependencies.
    2121
    2222### 🔥 Highlights
     
    2626* Container parallax via `.parallax-container`
    2727* Horizontal motion using `.parallax-x`
     28* All-direction parallax (`.parallax-xy`)
     29* Stop-sensitive behavior using `-s` modifiers
    2830* Speed modifiers (`parallax-3`, `parallax--05`, etc.)
    29 * Stop-sensitive behavior using `-s` modifiers
    3031* Automatic background-layer injection
    3132* Lightweight, dependency-free JS engine
    32 * Works with Gutenberg, Elementor, Bricks & more
    3333
    3434Full documentation, demos, and examples: 
     
    4141| `.parallax-image` | Creates a moving background layer |
    4242| `.parallax-container` | Moves an entire block or section |
    43 | `.parallax-x` | Switches movement from vertical to horizontal |
     43| `.parallax-x` | Enables horizontal parallax motion |
     44| `.parallax-xy` | Enables multi-direction parallax |
    4445| `.parallax-(--)` | Adjusts speed (e.g. `.parallax-05`, `.parallax--03`) |
    4546| `.parallax-[…]-s` | Stop-sensitive motion (movement stops after center) |
     
    4748== Screenshots ==
    4849
    49 1. Example of a parallax background using `.parallax-image`.
    50 2. Horizontal parallax motion using `.parallax-x`.
    51 3. Stop-sensitive parallax effect using the `-s` modifier.
    52 4. SmartParallax admin overview (Free Edition).
     501. Vertical Parallax Background Effect
     512. Horizontal Motion (parallax-x)
     523. All-Direction Parallax Effect
     534. Stop-Sensitive Motion (-s Modifier)
    5354
    5455== Installation ==
     
    7172
    7273== Changelog ==
     74
     75= 1.0.4 =
     76* Updated: Improved script initialization using `DOMContentLoaded` for better compatibility.
     77* Added: New plugin screenshots for WordPress.org listing.
     78* Updated: Readme metadata and tags for improved search visibility.
    7379
    7480= 1.0.3 =
     
    9399== Upgrade Notice ==
    94100
    95 = 1.0.3 =
    96 Compatibility update for upcoming WordPress versions.
     101= 1.0.4 =
     102Improved JavaScript initialization and updated plugin screenshots.
    97103
    98104== License ==
  • smartparallax/trunk/smartparallax.php

    r3414526 r3418765  
    44 * Plugin URI:  https://smartparallax.com/documentation/
    55 * Description: Lightweight GPU-optimized parallax animation system for WordPress blocks and containers.
    6  * Version:     1.0.3
     6 * Version:     1.0.4
    77 * Author:      Achim Schmid
    88 * Author URI:  https://smartparallax.com/
Note: See TracChangeset for help on using the changeset viewer.