2.4.1 • Published 8 months ago

pxs-video v2.4.1

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
8 months ago

PXS Video

A video section built for Shopify that supports Youtube and Vimeo

npm.io

Table of contents

Getting started

Installation

First we'll need to add pxs-video as a theme dependency:

npm install pixelunion/pxs-video

The line above will include the pxs-video package as a dependency to our theme. We can then use Paskit to add the section to our build folder.

If you deploy the theme, you will see that the section shows up as Video under the Video category.

Including styles

Now that we've got our section added to our build folder, we'll need to include the styles in our theme. We can do this by adding the following line to our SCSS.

@import "path/to/node_modules/pxs-video/src/styles/pxs-video";

Including scripts

Now that we've got the pxs-video styles in our theme, we can use the following line to import the Javascript

import PxsVideo from 'pxs-video';

Then all we need to do is register the section like it's any other section:

sections.register('pxs-video', section => new PxsVideo(section));

Styles

Variables

All of the following variable values are set as !default meaning we can change the value of these variables anywhere in our code. This is different than standard SCSS variables where we would have to change the variable after it is declared.

NameDefault value
$pxs-video-heading-font-size34px
$pxs-video-text-font-size24px
$pxs-video-overlay-heading-font-size24px
$pxs-video-overlay-text-font-size18px
$pxs-video-overlay-style-primary#000
$pxs-video-overlay-style-secondary#fff

Scripts

Included with pxs-video are 4 different builds of the Javascript. These builds can be found in the dist folder.

FilenamePurpose
index.jsVanilla javascript
index.es.jsCompiled to support ES6
index.umd.jsSupports both CommonJS and AMD
index.umd.min.jsMinified version of UMD

Settings

LabelIDTypeValuesDefault
HeadingtitletextN/AVideo
TexttextrichtextN/A<p>Enhance yourhome page witha video thatrelates to yourprocess, products,or story.</p>
YouTube or Vimeo linkvideovideo_urlN/Ahttps://www.youtube.com/watch?v=_9VUPq3SxOc
Aspect ratioaspect_ratioselect16:9 = "16-9" 21:9 = "21-9"16-9
AutoplayautoplaycheckboxN/Afalse
Mute video at startstart_mutedcheckboxN/Atrue
Show overlayoverlay_showcheckboxN/Afalse
Headingoverlay_headingtextN/AVideo
Textoverlay_textrichtextN/A<p>Enhance your homepage with avideo that relatesto your process,products, or story.</p>
Heading and text positionoverlay_header_positionselectAbove button = above-button" Below button = "below-button"above-button
Text coloroverlay_header_colorcolorN/A#FFFFFF
Background coloroverlay_colorcolorN/A#000000
Background color opacityoverlay_color_opacityrangeN/A50
Imageoverlay_imageimage_pickerN/AN/A
Button styleoverlay_button_styleselectPrimary = "primary" Secondary = "secondary"primary
2.4.1

8 months ago

2.4.0

1 year ago