• Stars
    star
    632
  • Rank 71,124 (Top 2 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Buttons made of Quantum Paper

#Quttons are buttons made of Quantum Paper

  • Qunatum Paper is a digital paper that can change its size, shape and color to accommodate new content. Quantum paper is part of Google's new Material Design language.

  • With this plugin you can hide any div behind a Quantum [Paper] Button or Qutton

#Online Demo

Slow Mo Demo

#Dependencies

#How To Use

Switch to gh-pages branch to look at code used in demo site.

##Step 1, Include Dependencies :

  • Download and include all dependencies in your html file.
  • After all the dependencies have been included, include Quttons.js or Quttons.min.js and Quttons.css after downloading from this repo.
  • In the following order
<script src = "Path/To/jQuery" type = "text/javascript"></script>
<script src = "Path/To/velocity.js" type = "text/javascript"></script>
<script src = "Path/To/velocity.ui.js" type = "text/javascript"></script>
<script src = "Path/To/Quttons.js" type = "text/javascript"></script>
  • And CSS
<link rel = "stylesheet" href = "Path/To/Quttons.css" />

##Step 2, Design your dialog :

  • Design your dialog box.
  • Design a div as you normally would, with all the css styles you want. You can put whatever you want inside your div.
  • You can also add event listeners to buttons inside the dialog as you normally would.
  • You can add a close button, just remember to give it a class of close.
  • Here is sample code for the Upload File Qutton from the Demo Site.
<div id="uploadDialog">
	<h2>Upload a new file</h2>
		<input type="text" id = "fileUrl" placeholder = "Enter URL">
	<div id="button_basic_upload"> Choose a file to upload
	</div>
</div>

##Step 3, Wrap created dialog in a div

  • Wrap dialog created in previous step in a div with class of qutton and one custom id which will be used to reference this qutton in your js file.
  • Example
<div class = "qutton" id = "qutton_upload">
 ...(Dialog created in previous step) ...
</div>

##Step 4, Initialize Qutton

  • In your .js file start by referencing the qutton in the following manner.
var quttonUpload = Qutton.getInstance($('#qutton_upload'));
quttonUpload.init({
	icon : './images/icon_upload.png',
	backgroundColor : "#917466"
});
  • Inside getInstance you pass in a jQuery object referencing the custom id you set up in previous step
  • init function takes in an object specifying the configuration of the button, following are currently supported

|Argument | Description | Default | |---|---|---|---|---| | icon | Icon to be displayed in Qutton | None | | backgroundColor | Background Color of Qutton | #FE0000 | | width | Width of the Qutton | 60 | | height | Height of the Qutton | 60 |
| easing | Easing for the animation | easeInOutQuint |

More Repositories

1

ReactPathMenu

Path Fly Out menu recreated using React Motion
JavaScript
282
star
2

ATVIcons

Apple TV 2015 icons recreated in HTML, CSS and JS
CSS
154
star
3

X-Days-of-Swift

Some iOS apps.
Swift
123
star
4

Chronus

Chronus is a "new-tab" chrome extension that tracks time you waste online in order to increase your productivity.
CSS
105
star
5

SplashWalls

iOS Wallpaper downloading app created in React Native.
JavaScript
75
star
6

BezierCurveGenerator

Draws Bezier Curves in SVG based on actual Mathematics
JavaScript
64
star
7

loving-recursion

An open-source book about Recursion.
JavaScript
22
star
8

SmootherTrello

A chrome extension that makes card dragging animation in Trello smoother.
JavaScript
18
star
9

blog

My website and blog
JavaScript
17
star
10

Beginner-React-Projects

A collection of beginner projects that I am building while learning react.
JavaScript
17
star
11

Muses

Muses is a chrome extension that helps you memorise facts and notes.
JavaScript
15
star
12

Wireframe.sketch

A simple wireframing library for Sketch
13
star
13

Data-Structures

Includes implementation of common data structures along with specific algorithmic operations.
C
9
star
14

JS-TicTacToe-AI

Implementation of Minimax algorithm in JavaScript allowing the computer to play TicTacToe.
JavaScript
9
star
15

CG-DrawingAlgorithms

Basic Computer Graphics drawing algorithms in HTML5 Canvas and JavaScript.
JavaScript
4
star
16

react-native-redux-todoapp

A simple iOS ToDo app created using React Native and redux
HTML
3
star
17

JSUtilities

JavaScript
3
star
18

ReactNoteTaker

Messing around with React js.
JavaScript
2
star
19

Eloquent-javascript-exercise-solutions

Solutions to exercises in the Eloquent Javascript book
HTML
2
star
20

CanvasPhysics

Contains objects for creating physics simulation in HTML5 canvas
JavaScript
2
star
21

react-face-mash

Face-Mash(ish) UI created in React js
CSS
2
star
22

CanvasExperiments

Playing around with HTML5 canvas
JavaScript
1
star