Changeset 3418765
- Timestamp:
- 12/13/2025 07:43:53 AM (3 months ago)
- Location:
- smartparallax/trunk
- Files:
-
- 12 added
- 5 edited
-
assets/css/admin (added)
-
assets/css/frontend (added)
-
assets/css/shared/all.min.css (modified) (1 diff)
-
assets/js/admin (added)
-
assets/js/frontend (added)
-
assets/js/shared/all.min.js (modified) (1 diff)
-
assets/js/shared/parallax.js (modified) (1 diff)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
assets/screenshot-3.png (added)
-
assets/screenshot-4.png (added)
-
functions (added)
-
functions/admin (added)
-
functions/frontend (added)
-
functions/shared (added)
-
readme.txt (modified) (6 diffs)
-
smartparallax.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
smartparallax/trunk/assets/css/shared/all.min.css
r3406594 r3418765 1 1 /*! 2 * SmartParallax Styles v1.0. 32 * SmartParallax Styles v1.0.4 3 3 * (c) 2025 SmartParallax — https://smartparallax.com/ 4 4 * Licensed under GPL-2.0-or-later -
smartparallax/trunk/assets/js/shared/all.min.js
r3406594 r3418765 1 1 /*! 2 * SmartParallax Scripts v1.0. 32 * SmartParallax Scripts v1.0.4 3 3 * (c) 2025 SmartParallax — https://smartparallax.com/ 4 4 * Licensed under GPL-2.0-or-later 5 5 */ 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 136 136 } 137 137 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 }); 142 142 }); 143 143 -
smartparallax/trunk/readme.txt
r3414526 r3418765 6 6 Requires at least: 6.0 7 7 Tested up to: 6.9 8 Stable tag: 1.0. 38 Stable tag: 1.0.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 12 Add smooth, GPU-powered parallax backgrounds and scroll animations to any WordPress block or section. 13 Lightweight, fast, and workswith all modern themes and page builders.13 Lightweight, fast, and compatible with all modern themes and page builders. 14 14 15 15 == Description == 16 16 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 runsfully on the GPU.17 **SmartParallax** adds fluid, GPU-accelerated parallax motion to WordPress blocks, images, headings, and sections. 18 Backgrounds, containers, and elements can smoothly move based on scroll position, powered by a tiny JavaScript engine running fully on the GPU. 19 19 20 The plugin integrates seamlessly with Gutenberg, Elementor, Bricks, and classic themes — without dependencies.20 The plugin integrates seamlessly with Gutenberg, Elementor, Bricks, Divi, Oxygen, and classic themes — without dependencies. 21 21 22 22 ### 🔥 Highlights … … 26 26 * Container parallax via `.parallax-container` 27 27 * Horizontal motion using `.parallax-x` 28 * All-direction parallax (`.parallax-xy`) 29 * Stop-sensitive behavior using `-s` modifiers 28 30 * Speed modifiers (`parallax-3`, `parallax--05`, etc.) 29 * Stop-sensitive behavior using `-s` modifiers30 31 * Automatic background-layer injection 31 32 * Lightweight, dependency-free JS engine 32 * Works with Gutenberg, Elementor, Bricks & more33 33 34 34 Full documentation, demos, and examples: … … 41 41 | `.parallax-image` | Creates a moving background layer | 42 42 | `.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 | 44 45 | `.parallax-(--)` | Adjusts speed (e.g. `.parallax-05`, `.parallax--03`) | 45 46 | `.parallax-[…]-s` | Stop-sensitive motion (movement stops after center) | … … 47 48 == Screenshots == 48 49 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. S martParallax admin overview (Free Edition).50 1. Vertical Parallax Background Effect 51 2. Horizontal Motion (parallax-x) 52 3. All-Direction Parallax Effect 53 4. Stop-Sensitive Motion (-s Modifier) 53 54 54 55 == Installation == … … 71 72 72 73 == 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. 73 79 74 80 = 1.0.3 = … … 93 99 == Upgrade Notice == 94 100 95 = 1.0. 3=96 Compatibility update for upcoming WordPress versions.101 = 1.0.4 = 102 Improved JavaScript initialization and updated plugin screenshots. 97 103 98 104 == License == -
smartparallax/trunk/smartparallax.php
r3414526 r3418765 4 4 * Plugin URI: https://smartparallax.com/documentation/ 5 5 * Description: Lightweight GPU-optimized parallax animation system for WordPress blocks and containers. 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Author: Achim Schmid 8 8 * Author URI: https://smartparallax.com/
Note: See TracChangeset
for help on using the changeset viewer.