multiplane/mp-theme-base

Multiplane base theme

Installs: 8

Dependents: 1

Suggesters: 0

Security: 0

Type:multiplane-theme

dev-main 2023-11-23 10:47 UTC

This package is auto-updated.

Last update: 2024-11-23 12:46:51 UTC


README

TODO: update README

Features

  • basic css
  • ...

mp.js

  • simple cookie management
  • handle privacy events
  • simple video - display YouTube and Vimeo iframes with a thumbnail and don't load videos without user's privacy consent
  • simple image lightbox
  • simple image carousel

Image lightbox

MP.ready(function() { // document is ready
    // init lightbox
    MP.Lightbox.init({
        group: '.gallery',  // all elements with class 'gallery' are galleries
        selector: 'a'       // all a tags are detected as image links
    });
});

Marginalia: The lightbox is compatible with WordPress Gutenberg galleries, but it might have unwanted side effects, if your theme doesn't fit exactly.

MP.ready(function() {
    MP.Lightbox.init({group: '.wp-block-gallery', selector: 'a'});
}

Video

requires VideoLinkField addon and videolink field, that is named "video"

build

  • npm install - install dev dependencies
  • npm run build to rebuild js+css files
  • npm run watch watch js+css changes
  • npm run update to build js+css with regenerated copyright preamble