Git Product home page Git Product logo

scrollscale's Introduction

ScrollScale

GitHub license

JavaScript program makes video enlarge and show the catchphrases when it's in the center of the window.

Requirements

  • ES6
  • CSS3

Usage

JavaScript program makes video enlarge when it's in the center of the window.

<script src="js/ScrollScale.js"></script>
<link rel="stylesheet" href="css/ScrollScale.css">

Wrap video and messages you want to enlarge with ScrollScale class.

<div class="ScrollScale">
  <video src=""/>
</div>

js

document.addEventListener('DOMContentLoaded',function(){
    new ScrollScale("id name");
});

You can create some contants layer on the video.

<div class="ScrollScale">
  <video src=""/>
  <div class="contants">
    <p>This text appear when video is enlarge. </p>
  </div>
</div>

Basic Standalone Usage

<div class="ScrollScale" id="ScrollScale1">
  <video src="video/sample.mp4" muted="muted" loop></video>
  <div class="contants">
	<div>
	  <h3>You can create some contants layer on the video.</h3>
	</div>
	<div>
	  <h3>contants class</h3>
	  <span>This is sample. This is sample. This is sample. This is sample.</span>
	  <a href="#">Button</a>
	</div>
  </div>
</div>

<script>
window.addEventListener('DOMContentLoaded', function(){
	new ScrollScale("ScrollScale1");
});
</script>

Option

variable description default
size small/middle/large size video middle
animation animation of contants true

Set Options

window.addEventListener('DOMContentLoaded', function(){
  new ScrollScale("ScrollScale1", {
    size: "large",
    animation: false,
  });
});

Caution

If you want to publish the site equiped this program for smartphone, you shoud write "poster" in video tag.

scrollscale's People

Contributors

atsu666 avatar kazumich avatar yoshi0207 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

yoshi0207

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.