Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@outisfun/xpr-npm

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@outisfun/xpr-npm

A small collection of XPR modules and helper funcs.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

XPR Split Text Module

What it does:

The XPR.SplitText module creates a GSAP Split Text element out of a heading with the option to animate it on page enter, or programmatically.

!!! Important: The GSAP SplitText Module is premium, so it doesn't come with the npm package. You have to add it manually and require it before requiring the XPR module:

var gsap = require('gsap');
require("gsap/umd/SplitText.js");
var XPR = require('@outisfun/xpr-npm');

How to use:

Init by specifying a parent container (mandatory), markup (mandatory), and options as follows:

var headingEl = document.querySelector("h1"); // select a heading element
var splitTextEl = new XPR.SplitText(headingEl);

The module comes with default settings for animations and events, but you can override them like this:

var headingEl = document.querySelector("h1"); // select a heading element
var opts = {
	animation: {
		from: {
			y: 20,
			opacity: 0
		},
		to: {
			y: 0,
			opacity: 1,
			ease: Power2.easeOut
		}
	},
	speed: 0.55,
	staggerSpeed: 0.002,
	animateOnPageEnter: false 
}
var splitTextEl = new XPR.SplitText(headingEl, opts);

// if you set animateOnPageEnter to false, you have to trigger the animation manually, like this:
splitTextEl.animate();

FAQs

Package last updated on 04 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc