=== CorLayers — Animated Shapes & Effects for Elementor ===
Contributors: corsolutions
Tags: elementor, animations, shapes, button, card, divider, decorative
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Stable tag: 1.3.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

GPU-composited animated decorative shapes, 32-preset button animations, 3D perspective cards, and freestyle SVG dividers for Elementor.

== Description ==

CorLayers adds four powerful Elementor widgets that fill a genuine gap: beautiful animated decorative elements that are technically correct — GPU-composited, iOS Safari safe, accessible, and performance-respecting.

**What makes CorLayers different:**

Every other animation addon uses clip-path morphing or border-radius animations that trigger repaints. CorLayers uses only `transform` and `opacity` — the two CSS properties that run on the GPU compositor thread, never block the main thread, and work correctly on every iOS Safari version.

= 4 Widgets Included =

**1. Floating Shape**
12 SVG shapes (circle, ring, triangle, square, hexagon, star, diamond, cross, 3 blobs, dots grid) with 6 GPU-composited animations: Float, Sway, Spin, Pulse, Bounce, Drift.

**2. Animated Button**
32 pure CSS animation presets — zero JavaScript. Fill animations (8 directions), border effects, glow, neon, shadow pop, motion effects, icon animations, text animations. All with correct focus-visible states.

**3. Perspective Card**
3D tilt effect with spring physics. Vanilla JS, no dependencies. Glare effect, configurable intensity, scale on hover. Auto-disabled on touch devices. Fully functional without JavaScript (graceful degradation).

**4. Freestyle Divider**
8 SVG shapes (wave, wave double, slant, slant double, curve, curve inverted, zigzag, triangle) placeable on any section edge — top, bottom, left, or right. Optional wave animation (transform-only).

= Accessibility =

- All decorative elements carry `aria-hidden="true"` — invisible to screen readers
- Every button preset preserves `focus-visible` states (WCAG 2.4.11)
- All animations respect `prefers-reduced-motion` (WCAG 2.3.3)
- Tilt effect disabled automatically when motion is reduced

= Performance =

- Assets load only on pages that use CorLayers widgets (conditional loading)
- No animation triggers layout or paint — transform + opacity only
- SVG shapes are inline and lightweight
- Zero external dependencies (no jQuery, no GSAP, no external libraries)

= Security =

- SVG sanitiser strips all executable content before rendering
- Blocks: `<script>`, `on*` event handlers, `javascript:` URIs, `data:` URIs, `<foreignObject>`
- All user input sanitised with WordPress APIs
- Nonce-protected settings

== Installation ==

1. Upload the `corlayers-elementor` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Ensure Elementor (version 3.0.0+) is installed and active
4. Find the **CorLayers** category in the Elementor widget panel

== Frequently Asked Questions ==

= Does CorLayers require Elementor Pro? =

No. CorLayers works with the free version of Elementor. Elementor Pro is not required.

= Will the animations break on iOS Safari? =

No. CorLayers deliberately avoids clip-path morphing and border-radius animations — both of which have documented bugs on iOS Safari. All animations use only `transform` and `opacity`, which are fully supported and GPU-composited on all browsers including iOS Safari.

= Is it accessible? =

Yes. All decorative elements are marked `aria-hidden="true"`. All button animations preserve keyboard focus-visible states. All animations respect the system-level `prefers-reduced-motion` preference.

= Will it slow down my site? =

No. Assets are loaded conditionally — only on pages that contain CorLayers widgets. No global script or style is added to every page.

= How do I position the Floating Shape freely within a section? =

In the Elementor editor, select the Floating Shape widget, go to the **Advanced** tab, then **Positioning** → set **Position** to **Absolute**. Use the Horizontal and Vertical offset controls to position the shape. Use the per-breakpoint controls to set different positions on tablet and mobile.

== Changelog ==

= 1.3.2 =
* Fix: content_template() in Perspective Card — overlay else-if branch was missing its opening <# tag (line 2532), causing the overlay card markup to be rendered as literal text in the editor when any other card type was selected

= 1.3.1 =
* Fix: elementorFrontend.hooks guard added to widget-card.js, widget-stats-counter.js, widget-scroll-reveal.js — missing check caused TypeError in editor when scripts loaded before Elementor hooks were initialised, breaking the editor entirely

= 1.3.0 =
* Fix: Countdown Timer — show_seconds JS condition corrected to strict === 'yes'; tick() now skips seconds DOM update when hidden
* Fix: Perspective Card — @supports fallback targets correct selector (.cl-card--gradient-border::before); gb_color_2 fallback corrected to #ec4899
* Fix: Perspective Card — title_tag control added to all non-tilt card types (flip, overlay, zoom, glass, gradient-border, spotlight, neon, slide-panel)
* Fix: Perspective Card — .cl-flip-back-btn transition changed from var(--cl-flip-speed) to fixed 0.2s ease for responsive hover
* Fix: Perspective Card JS — tilt-parallax parallax depth engine implemented (was completely missing)
* Fix: Info Box CSS — @keyframes cl-ib-neon-pulse wrapped in prefers-reduced-motion guard; icon margin-bottom zeroed for unboxed icons
* Fix: Price Box CSS — duplicate dead .cl-pb--neon .cl-pb-btn--solid:hover rule removed
* Fix: Price Box PHP — dual rel attributes in content_template() combined into single rel attribute
* Fix: Button CSS — cl-btn-lift/push/zoom/skew hover transforms wrapped in prefers-reduced-motion guard
* Fix: Button CSS — cl-btn-aurora hover animation wrapped in prefers-reduced-motion guard
* Fix: Button CSS — cl-btn-glass missing -webkit-backdrop-filter prefix added
* Fix: Team Member — social link aria-labels added; overlay tabindex="0" for keyboard accessibility; :focus-within CSS mirror of hover
* Fix: Stats Counter — intval() changed to floatval() to preserve decimal counter values; bar layout added to content_template()
* Fix: Aurora CSS/JS — parallax offset written via CSS custom properties (--cl-aurora-tx/--cl-aurora-ty) with animation-composition:add; prevents transform fight with drift keyframes
* Fix: Floating Shape CSS — animation-composition:add on cl-anim-spin preserves --cl-initial-rotate through spin cycle
* Fix: Freestyle Divider CSS — left/right edge variants use position:absolute with height:100% for correct section height fill
* Fix: Testimonial Slider CSS — nav-bottom + dots overlap resolved with .cl-ts-pagination bottom offset

= 1.2.0 =
* Fix: Flip Card — removed overflow:hidden from card faces (was creating stacking context flattening 3D backface-visibility in Safari/WebKit)
* Fix: Flip Card — removed incorrect transform-style:flat on perspective container (broke 3D depth in some browsers)
* Fix: render_flip() output escaping — front image, button tag, and button attributes now properly escaped
* Fix: content_template {{{ }}} triple-brace usage corrected to {{ }} for all plain-text controls
* Fix: Floating Shape editor preview now shows animation class on outer wrapper for live animation in editor
* Security: wp_kses_post() applied to front face image HTML in render_flip()
* Security: esc_html() applied to button tag in render_flip() output
* Refactor: Flip Card CSS uses transform-style:preserve-3d on perspective container for correct 3D hierarchy

= 1.1.0 =
* New: Noise Overlay widget — SVG grain texture overlay for sections (zero JS, pure CSS)
* New: Aurora Background widget — animated radial gradient orbs, GPU-composited transforms only
* New: Stats Counter widget — animated number counter with SVG circular progress ring
* New: Scroll Reveal extension — adds reveal animation controls to the Advanced tab of every Elementor widget
* New: Magnetic Button — proximity-based cursor pull effect added to Animated Button widget
* Fix: Scroll Reveal above-fold pre-check (getBoundingClientRect) — no flash of invisible content
* Fix: Scroll Reveal skips elements managed by Elementor Pro Motion Effects
* Fix: Stats Counter aria-live on hidden element only — final value announced once on completion
* Fix: ring_percentage and counter_end_value are independent controls
* Fix: stroke-dasharray calculated in PHP from fixed SVG-unit radius (S-10)
* Fix: Magnetic JS transform targets wrapper div — zero collision with 32 CSS button presets (S-04)
* Fix: content_template role="button" remnant removed from Animated Button live preview

= 1.0.2 =
* Fix: Separate asset registration from enqueue — editor live preview now works correctly on first widget drag before page is saved

= 1.0.1 =
* Fix: Frontend assets never loaded — wrong Elementor function check in conditional enqueue
* Fix: cl-btn-reveal-text preset now correctly outputs data-hover-text attribute
* Fix: Removed incorrect role="button" from anchor elements — links retain correct ARIA role
* Fix: Plugin list Settings link removed (no settings page exists — link caused admin error)
* Fix: Card title_tag now whitelist-validated against allowed HTML tags
* Fix: Card button renders as <span> instead of <a> when no link URL is set
* Fix: Tilt transition speed control now drives lerp smoothness, not only box-shadow
* Fix: Removed unused Group_Control_Border import from Floating Shape widget

= 1.0.0 =
* Initial release
* Floating Shape widget — 12 shapes, 6 GPU animations
* Animated Button widget — 32 CSS presets
* Perspective Card widget — vanilla JS 3D tilt with spring physics
* Freestyle Divider widget — 8 shapes, any edge placement
* Full prefers-reduced-motion support
* WCAG 2.4.11 focus-visible on all buttons
* SVG sanitiser for safe inline rendering
* Conditional asset loading

== Upgrade Notice ==

= 1.2.0 =
Critical fix for Flip Card 3D rendering in Safari/WebKit. Security escaping improvements.

= 1.1.0 =
Five new widgets (Info Box, Countdown Timer, Price Box, Team Member, Fancy Heading), Scroll Reveal extension, Magnetic Button, 9 advanced button animations, 3D Flip Card, and multiple bug fixes.

= 1.0.0 =
Initial release.
