Git Product home page Git Product logo

split-flap-display's Introduction

ATTRIBUTIONS

Forked from a pen originally created on CodePen.io. Original URL: https://codepen.io/joupain/pen/gELbGZ.

Original MIT license ORIGINAL_CODEPEN_LICENSE

  • This repository is an evolution of an original joupain codepen

NEW FEATURES

Structure

Code is divided into two classes and one CSS file:

  • xsplit-flap.js -> splitFlapElm: represents a single flap element
  • xsplit-flap.js -> splitFlap: represents a set of flaps that works together (a display). You should instantiate this class to create a display.
  • xsplit-flap.css: split-flap display styles

Functionalities

  • Loop between two values (like original CodePen)

NEW

  • Create instances.
  • Specify options when creating the instance:
    • parent: HTMLElement (optional) - parent element
    • beginText: string (optional) - start text
    • endText: string (optional) - final text
    • loop: boolean (optional) - if loop or not
    • size: number (optional) - the number of elements of the display
    • changeTime: number: set the time in miliseconds between automatic text change (by default 3000ms)
  • noloop: just show a text but don't change.
  • setText: change from current text to new text.
  • size (in constructor): sets the number of elements in the display. By default, the max size between beginStr and endStr.
  • roll: roll the text to left or right.
  • setFlapsWidths: by the moment, you can set the flap elements width globally for all instances.
  • changeTime (in constructor): set the time in miliseconds between automatic text change (by default 3000ms)
  • setFlapsTextColor: by the moment, you can set the flap text color globally for all instances.

split-flap-display's People

Contributors

ryddle avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.