New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

film.js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

film.js

A lightweight, modern, dependency-free library for creating endless 'film player' animation

1.0.0-alpha.1
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

film.js

A lightweight, modern, minimal-dependency library for creating endless "film player animation.

Check out the demo here: https://f15gdsy.github.io/film.js/

How

1. Installation

If you are using npm:

npm install vue-insert-compo --save

If you are using yarn:

yarn add vue-insert-compo

2. Use

First, you need to setup the following DOM structure:

<div class="film">
  <div class="film__frame"></div>
  <div class="film__frame"></div>
  // ...
  <div class="film__frame"></div>
</div>

Then create a new film object

const film = new Film('.film')
// or
const film = new Film(filmEl)

That's it!

API

Constructor

params

  • { String | HTMLElement } el - The film DOM element.
    • { Number } frameWidth - Set the frame width. If not set, framesPerView will be used. If set, will override framesPerView.
    • { Number } framesPerView - Set how many frames should be in viewport.
    • { Number } speed - Set the speed of the frame movmenet. Default 20.
    • { String } direction - Direction of the frame movement. Can be either "left" or "right". Default "left".

.start()

Starts the animation.

.stop()

Stops the animation.

.refresh()

Re-initialize the film, can be used on resize.

window.addEventListener('resize', () => {
  film.refresh()
})

FAQs

Package last updated on 21 Mar 2017

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