SW34 Easy Scroll

Description

Native scrolling jumps. It does the job, and it makes a carefully designed site
feel a little cheaper than it is.

SW34 Easy Scroll replaces that jump with motion that glides — on the mouse
wheel, on the keyboard, and on every anchor link. It runs on Lenis, a
well-regarded open-source scrolling library, bundled with the plugin. Everything
lives on one settings screen, in plain language, with a real on/off switch at
the top.

The keyboard is where most smooth scrolling stops

Scroll with the wheel: smooth. Press the down arrow: jump. Two contradictory
behaviours on the same page — visitors feel it even when they cannot name it.

It is not a bug. Lenis registers no keyboard listener at all, so almost nothing
built on it handles the keyboard. SW34 Easy Scroll does. Arrow keys, Page Up and
Page Down, Space, Home and End all glide, with a distance per arrow press you
choose.

It also knows when to stay out of the way. Form fields, buttons, video players,
menus, sliders and scrollable panels keep their own key handling. Visitors who
asked their system for reduced motion get the native keyboard back, untouched.

Anchor links that land where you meant

A one-page site lives on its anchor links, and they are exactly what tends to
break: the page jumps instead of gliding, or the section you aimed at ends up
hidden behind your sticky header.

Both are handled. Set your header height once, and every #section link glides
to the right place — whether the visitor clicks it, arrives from another page,
or opens the address with the fragment already in it. The URL updates, the Back
button works, and keyboard focus follows to the section, the way native
navigation does.

Themes that run their own anchor scrolling — Divi among them — no longer fight
you for it. Tabs and accordions built on # links are recognised and left alone.

You decide where it applies

Smooth scrolling is not always welcome everywhere. Turn it off on a single page
from the editor sidebar, or exclude whole sections of the site by path. Keep it
for visitors and native for yourself while you build. Disable it on touch
devices, or below a screen width you set. Hand scrolling back to any panel,
map or modal with a CSS selector.

In short

  • Smooth wheel, trackpad, keyboard and anchor links.
  • Fixed-duration or continuous interpolation, ten easing curves, adjustable
    sensitivity.
  • Vertical, horizontal or both — for horizontal sites driven by a vertical wheel.
  • Per-page switch in the editor, exclusions by path and by CSS selector.
  • Audience control: everyone, logged-out visitors only, or everyone but admins.
  • Respects “reduced motion” by default, and follows the setting live.
  • Automatically off in the admin, the Customizer and every major page builder.
  • French and Spanish included; fully translatable.

What it does not do

Worth knowing before you install, so nothing surprises you:

  • It does not smooth touch scrolling. Native mobile scrolling is faster and
    better received. There is no setting to change that, on purpose.
  • It does not animate scrollable boxes inside the page. Lenis drives the
    document, not the panels it contains.
  • It produces no rubber-band effect at the top and bottom of the page. The
    browser cannot scroll past the document.

No weight you did not ask for

About 25 KB on your public pages, served from your own site. No CDN, no external
request — not even to Studio Web 34. No cookie, no personal data, no tracking of
any kind, no upsell banner in your admin.

And the master switch is a real switch: turned off, the plugin loads no CSS and
no JavaScript at all on the public site.

For developers

Six filters and actions (sw34_easy_scroll_options, _should_run, _config,
_post_types, _settings_saved, _settings_reset), a JavaScript API on
window.SW34EasyScroll with ready and destroyed events, and an optional
window.lenis global for GSAP ScrollTrigger. The data-lenis-prevent
attributes are honoured for the keyboard as well as the wheel.

Lenis is bundled minified and as readable source, released under the MIT licence.
If your theme already registered it, this plugin reuses that copy instead of
loading a second one.

Internationalization

Source language is English. French (fr_FR) and Spanish (es_ES) catalogues
are bundled — 108 strings, 104 translated in each; the four left untranslated
are the plugin name, the author name and the two URLs, which stay the same in
every language.

Everything visible is translatable, including the strings used by the settings
screen’s JavaScript, which are passed through wp_localize_script() rather than
written into the .js file where gettext would never see them.

Credits

Smooth scrolling is powered by Lenis 1.3.26 by
darkroom.engineering, released under the MIT licence. Source repository:
https://github.com/darkroomengineering/lenis — the bundled files are
assets/js/lenis.min.js, its readable source assets/js/lenis.js, and the
stylesheet assets/css/lenis.css. The licence text is in
assets/js/LICENSE-lenis.txt.

Screenshots

Installation

  1. Upload the sw34-easy-scroll folder to /wp-content/plugins/.
  2. Activate the plugin.
  3. Open the Smooth Scroll menu in the admin sidebar.

If your theme has a sticky header, enter its height under “Top offset” in the anchor links section, otherwise anchor targets end up underneath it.

FAQ

Scrolling feels wrong inside a map, a code editor or a modal.

Add a CSS selector for that element under “Excluded areas”. The
data-lenis-prevent attribute is also recognised without any setting.

Can I use it with GSAP ScrollTrigger?

Yes. Enable “Expose the instance as window.lenis”, then drive ScrollTrigger
from the sw34-easy-scroll:ready event.

Does it work on mobile?

The plugin never smooths touch scrolling: native mobile scrolling is more
responsive and better received, so there is no setting for it. Everything else
still applies, and “Disable on touch devices” turns the plugin off entirely on
phones and tablets if that is what you want.

How do I turn it off on one page?

Open that page in the editor and tick “Disable smooth scrolling on this page”
in the Smooth scrolling box in the sidebar. For a whole section of the site,
use a wildcard path such as /my-account/* under “Excluded pages” instead.

Can I keep native scrolling for myself while I build the site?

Yes. Set “Who gets smooth scrolling” to “Everyone except administrators”.

Anchor links jump instead of gliding.

Check that “Animate anchor links” is on. When it is, this plugin takes anchor
clicks in the capture phase and stops them there, so a theme running its own
anchor scrolling — Divi does — cannot overwrite the animation. If you would
rather keep your theme’s behaviour, turn this setting off.

Can a scrollable area inside the page be animated too?

No. Lenis animates the document, not the boxes inside it. “Let nested areas
scroll” only hands the wheel back to that box so the page does not move
instead; the box then scrolls natively, without inertia. Animating it would
take a second Lenis instance bound to that element.

The arrow keys scroll the page while I am filling in a form.

They should not — form fields are excluded. If it happens on a custom field,
add a selector for it under “Excluded areas”, and please report it.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“SW34 Easy Scroll” is open source software. The following people have contributed to this plugin.

Contributors

Translate “SW34 Easy Scroll” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0.0

First release.