Coder Social home page Coder Social logo

coolest-background's Introduction

really easy to use! You only need 3 minute to learn how to use

  • step1

Introducing the script to your page

   <script src="[???]/coolestBackground.min.js"></script>

If you are using es6 ,webpack ,react or etc. ,just add one sentence in the script

  export {coolestBackground}
  • step2

    set css like this:
  #example{
  position:absoulte;
  width:100%;
  height:100%;
  }

and in your script

<script>coolestBackground(document.getElementById('example'))</script>
  • step3 -open the html and enjoy the amazing effect

API

  • size and postion are setted by css
coolestBackground(dom[,config])
config: {
    mode:{
        display: ['canvas'|'svg'|'webgl'], 
        move:[boolean]   //in the center or follow your mouse
    },
    MESH :{          
        width: [number],
        height: [number],
        depth: [number],
        segments: [number],
        slices: [number],
        xRange: [number],
        yRange: [number],
        zRange: [number],
        ambient: [color],
        diffuse: [color],
        speed: [number],
    },
    LIGHT : {
        count:  [number],
        xyScalar: [number],
        zOffset:  [number],
        ambient: [color],
        diffuse: [color],
        speed:  [number],
        gravity:  [number],
        dampening: [number],
        minLimit:  [number],
        maxLimit: [number],
        minDistance: [number],
        maxDistance: [number],
        autopilot: [boolean]  // the light auto fly anywhere
        draw: [boolean]   //   show the small circle around your mouse
    }
}

EXAPMLE

  • Here are 3 examples in the files to tell you how to set configs and set 4 backgounds in one page.

OTHER

coolest-background's People

Contributors

oxslap avatar

Watchers

James Cloos 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.