- Rewrapped all JavaScript in an IIFE to prevent conflicts with other plugins and avoid top-level code running before
document.bodyexists - Fixed crash caused by
createSvgBackground()andResizeObserverexecuting during script parse when DOM was not yet ready - Replaced
window.onloadassignment with a properDOMContentLoadedlistener pattern to ensure the script initializes reliably regardless of when it is loaded by the browser
- New post meta field
_nxt_timeline_selectorallows overriding the global target selector on a per-page basis - Override is editable directly in the Gutenberg Document Settings sidebar under "Timeline Selector"
- Global selector (configured in Settings → Animated Timeline) is used as fallback when the field is empty
- Frontend script version now uses
filemtime()instead of the hardcoded'1.0'string, ensuring browsers always load the latest version after an update
- it is now possible to apply effects when scrolling past a timeline stop (e.g. change its color to black and white)
- scroll effects can be inverted, so it's possible to first apply a custom filter and then remove it when scrolling past the respective item
- upload for custom .svg files now uses WordPress media library instead of the previous hacky solution
- renamed timeline.js to nxt-timeline.js to avoid naming conflicts with other plugins
- You no longer have to choose between a circle, a rectangle or no item for a timeline stop, you can now upload your own custom svg file
- Option to set the width of the uploaded .svg file to properly customize the look of the timeline
- Moved all inline JS for the WordPress admin options page to a dedicated file (/js/nxt-timeline-admin.js) to clean up the code (a little)
- Improved UI as options that are not in use (e.g. color of timeline stop when a custom .svg is in use) will now appear greyed out / disabled