반응형
반응형
Matter.js: An HTML5 2D physics engine

 

 

Matter.js is a JavaScript/HTML5 2D physics engine for the web. It includes WebGL and Canvas renderers, it’s cross-browser and mobile compatible, and supports a variety of physics properties.

matter.js

Matter.js

Matter.js is a JavaScript 2D rigid body physics engine for the web

brm.io/matter-js

Features - Status - Install - Usage - Docs - Implementation - References - License

Build Status

Demos

Features

  • Physical properties (mass, area, density etc.)
  • Rigid bodies of any convex polygon
  • Stable stacking and resting
  • Collisions (broad-phase, mid-phase and narrow-phase)
  • Restitution (elastic and inelastic collisions)
  • Conservation of momentum
  • Friction and resistance
  • Constraints
  • Gravity
  • Composite bodies
  • Sleeping and static bodies
  • Events
  • Rounded corners (chamfering)
  • Views (translate, zoom)
  • Collision queries (raycasting, region tests)
  • Time scaling (slow-mo, speed-up)
  • Canvas renderer (supports vectors and textures)
  • WebGL renderer (requires pixi.js)
  • MatterTools for creating, testing and debugging worlds
  • World state serialisation (requires resurrect.js)
  • Cross-browser (Chrome, Firefox, Safari, IE8+)
  • Mobile-compatible (touch, responsive)
  • An original JavaScript physics implementation (not a port)
반응형
반응형

Snabbt.js: A minimalist JavaScript animation library

 

Snabbt.js is a minimalist JavaScript animation library that offers 60FPS animation, even on mobile. It’s lightweight (less than 4kb minified and gzipped), and simple to use.

snabbt.js

 

 

 

 

 

반응형
반응형

[javascript] DropzoneJS - drag'n'drop file uploads with image previews library

 

http://www.dropzonejs.com/

 

Github : https://github.com/enyo/dropzone

 

Dropzone.js 

Installation

Download the standalone dropzone.js and include it like this:

<script src="./path/to/dropzone.js"></script>

Dropzone is now activated and available as window.Dropzone.

Dropzone does not handle your file uploads on the server. You have to implement the code to receive and store the file yourself.

With component

If you use component you can just add dropzone as a dependency:

"enyo/dropzone": "*"

Then include it like this:

var Dropzone = require("dropzone");

so it is activated and scans the document.

The basic CSS markup is also included with component, but if you want it to look the same as on this page, you have to download the CSS (see below).

With RequireJS

Dropzone is also available as an AMD module for RequireJS.

You can find the dropzone-amd-module in the downloads folder.


This is all you need to get dropzone up and running. But if you want it to look as cool as my dropzone, you’ll need to download the css/dropzone.css, images/spritemap.png and images/spritemap@2x.png as well from the downloads folder.

If you change the folder names make sure you adjust the paths in the css.

The @2x.png spritemap is to support high density (retina) displays.

Usage

The typical way of using dropzone is by creating a form element with the class dropzone:

<form action="/file-upload"
      class="dropzone"
      id="my-awesome-dropzone"></form>

That’s it. Dropzone will find all form elements with the class dropzone, automatically attach itself to it, and upload files dropped into it to the specified action attribute. The uploaded files can be handled just as if there would have been a html input like this:

<input type="file" name="file" />

If you want another name than file you can configure dropzone with the option paramName.

If you’re using component don’t forget to require("dropzone"); otherwise it won’t be activated.

If you want your file uploads to work even without JavaScript, you can include an element with the class fallback that dropzone will remove if the browser is supported. If the browser isn’t supported, Dropzone will not create fallback elements if there is a fallback element already provided. (Obviously, if the browser doesn’t support JavaScript, the form will stay as is)

Typically this will look like this:

<form action="/file-upload" class="dropzone">
  <div class="fallback">
    <input name="file" type="file" multiple />
  </div>
</form>
반응형
반응형

남은 시간 카운터 - 자바 스크립트

 

 

 

 

 

 

 

 

 

 

 

 

 

.

반응형
반응형

javascript - setTimeOut

 

 

Example

Display an alert box after 3 seconds (3000 milliseconds):

 

setTimeout(function(){ alert("Hello"); }, 3000);

 

Definition and Usage

The setTimeout() method calls a function or evaluates an expression after a specified number of milliseconds.

Tip: 1000 ms = 1 second.

Tip: The function is only executed once. If you need to repeat execution, use the setInterval() method.

Tip: Use the clearTimeout() method to prevent the function to run. 

반응형
반응형

Paperclip.js: A powerful template engine for Node.js and the browser

 

Paperclip.js is a powerful template engine that’s built for extensibility and speed. It creates compiled templates for the browser and Node.js.

paperclip.js

reactive DOM template engine built for speed, and extensibility 

 

 

 

 

 

 

 

 

반응형

+ Recent posts