-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
159 lines (159 loc) · 4.56 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<html>
<head>
<title>crisp.js</title>
<meta content="sexy css3 buttons with one line of js." name="description" />
<link href="http://fonts.googleapis.com/css?family=Amaranth:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="demo/demo.css" type="text/css" />
<link href="demo/google-code-prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="demo/google-code-prettify/prettify.js"></script>
<script src="crisp.js"></script>
</head>
<body onload="prettyPrint()">
<div class="title">crisp.js</div>
<div class="subtitle">
sexy css3 buttons with one line of js
</div>
<div id="demo">
<span class="examples">Examples</span><span class="features">Features</span><br>
<div id="demoHolder"></div>
<div id="featureHolder">
<ul>
<li>Less than 4 kb</li>
<li>No extenral images, widgets, or css</li>
<li>Compatible with all JS frameworks</li>
<li>Easily customizable</li>
<li>Use just like any other node</li>
<li>No more styling ugly framework buttons</li>
<li><a href="http://sam.zoy.org/wtfpl/" target="_blank">WTFPL</a> license</li>
</div>
</div>
<div id="usage">
<span class="examples">Usage</span><br>
Build a fricken button
<pre class="prettyprint code">
var button = crisp.create({innerHTML: 'click me'});</pre>
Build a fricken button and place it in the DOM
<pre class="prettyprint code">
var button = crisp.create({innerHTML: 'click me'});
document.getElementById('foo').appendChild(button);</pre>
Build a fricken button using all config options
<pre class="prettyprint code">
var args = {
innerHTML: 'click me', // button text
width: '100px', // button width
height: '40px', // button height
color: '#FF0022', // text color
bgColor: 'green', // background color
fontFamily: 'Arial', // font face
fontSize: '20px' // font size
padding: '10px' // button padding
}
var button = crisp.create(args);</pre>
<span class="examples">Notes</span><br>
It's just a regular elment<br>
<span style="font-size:12px">A button is just a regular element. To change its look or feel more than the in the example above, just create it and style it like you would any other element. Same goes for registering event handlers and positioning.</span>
</div>
<div id="get">
<a href="crisp.js"><span id="crisp"></span></a><br>
<a href="crisp.min.js"><span id="crispMin"></span></a>
</div>
<script>
var node = document.getElementById('demoHolder');
//gordon freeman lives on
crisp.create({
domNode:node,
innerHTML:'gordon',
width:'100px',
height:'40px'
});
crisp.create({
domNode:node,
innerHTML:'freeman',
bgColor:'#FF6600',
width:'110px',
height:'40px',
fontFamily:'Impact'
});
crisp.create({
domNode:node,
innerHTML:'has',
bgColor:'#660088',
width:'64px',
height:'40px',
fontFamily: 'Times'
});
node.appendChild(document.createElement('br'));
crisp.create({
domNode:node,
innerHTML:'escaped',
bgColor:'#FF0022',
width:'110px',
height:'40px',
fontFamily:'Courier'
});
crisp.create({
domNode:node,
innerHTML:'black',
bgColor:'black',
width:'80px',
height:'40px',
});
crisp.create({
domNode:node,
innerHTML:'mesa.',
bgColor:'white',
width:'85px',
height:'40px',
color:'black'
});
node.appendChild(document.createElement('br'));
crisp.create({
domNode:node,
innerHTML:'BIG',
width:'148px',
height:'100px',
fontSize:'65px'
});
crisp.create({
domNode:node,
innerHTML:'small',
width:'39px',
height:'20px',
fontSize:'12px',
bgColor:'#CC33AA'
}).style.top = '-40px';
crisp.create({
domNode:node,
innerHTML:'small',
width:'39px',
height:'20px',
fontSize:'12px',
bgColor:'#CC0011'
}).style.top = '-40px';
crisp.create({
domNode:node,
innerHTML:'small',
width:'39px',
height:'20px',
fontSize:'12px',
bgColor:'grey'
}).style.top = '-40px';
node.appendChild(document.createElement('br'));
crisp.create({
domNode:document.getElementById('crisp'),
innerHTML:'crisp.js',
bgColor:'#FF6600',
width:'130px',
height:'40px',
});
crisp.create({
domNode:document.getElementById('crispMin'),
innerHTML:'crisp.min.js',
bgColor:'#FF6600',
width:'130px',
height:'40px',
}).style;
</script>
<a href="http://github.com/bouchon/crisp.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="demo/fork.png" alt="Fork me on GitHub"></a>
</body>
</html>