forked from LeaVerou/dabblet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
259 lines (222 loc) · 10.2 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>dabblet.com</title>
<meta name="author" content="Lea Verou" />
<meta name="description" content="An interactive CSS playground and code sharing tool. Dabblet saves to Github gists and offers many conveniences for CSS editing." />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/style.css" />
<script src="/code/prefixfree.min.js"></script>
<script>window._gaq = [['_setAccount', 'UA-27750908-1'], ['_trackPageview']];</script>
<script src="http://www.google-analytics.com/ga.js" async></script>
</head>
<body>
<header>
<h1><a href="/">dabblet</a></h1>
<a id="currentuser" target="_blank" class="user button">Log in</a>
<div class="with-dropdown" title="Settings">
<button class="with-symbol" title="Settings">⚙</button>
<form id="settings" class="dropdown">
<fieldset id="view">
<legend>View mode</legend>
<input type="radio" name="view" value="behind" id="view-behind" data-scope="file" />
<label for="view-behind" class="button" title="Behind code">Behind code</label>
<input type="radio" name="view" value="split" id="view-split" checked data-scope="file" />
<label for="view-split" class="button" title="Horizontal split">Horizontal split</label>
<input type="radio" name="view" value="split-vertical" id="view-split-vertical" data-scope="file" />
<label for="view-split-vertical" class="button" title="Vertical split">Vertical split</label>
<input type="radio" name="view" value="separate" id="view-separate" data-scope="file" />
<label for="view-separate" class="button" title="Separate">Separate</label>
</fieldset>
<fieldset>
<legend>Libraries</legend>
<label>
<input type="checkbox" name="prefixfree" value="1" data-scope="file" checked />
Use -prefix-free
</label>
</fieldset>
</form>
</div>
<div class="with-dropdown">
<button id="save-button" class="with-symbol" title="Save">💾</button>
<menu class="dropdown">
<a id="save-cmd" tabindex="0" class="command" data-keyboard="⌘S" data-disabled>Save</a>
<a onclick="gist.save({forceNew: true})" id="save-new-cmd" class="command" tabindex="0" data-disabled>Save as new</a>
<a onclick="gist.save({anon: true})" class="command" tabindex="0">Save anonymously</a>
<hr />
<a href="/" onclick="Dabblet.wipe()" class="command" data-keyboard="⌘N">New dabblet</a>
<hr />
<a data-href="https://gist.github.com/{gist-id}" target="_blank" class="command" data-disabled>View gist</a>
<a data-href="/result/gist/{gist-id}" class="command" target="_blank" aria-hidden="true">View full page result</a>
<a class="user command" target="_blank" aria-hidden="true" id="gist-user"></a>
</menu>
</div>
<div class="controls-group">
<a href="#help" class="button" title="Help & credits">?</a>
<div class="tabs">
<input type="radio" name="page" value="css" id="page-css" checked data-scope="file" />
<label for="page-css" title="⌘1">CSS</label>
<input type="radio" name="page" value="html" id="page-html" data-scope="file"/>
<label for="page-html" title="⌘2">HTML</label>
<input type="radio" name="page" value="result" id="page-result" data-scope="file" />
<label for="page-result" title="⌘3">Result</label>
</div>
</div>
</header>
<iframe class="page" id="result" name="result" src="/result.html"></iframe>
<div id="css-container" class="editor page">
<pre id="css" lang="css" contenteditable spellcheck="false">/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;</pre>
</div>
<div id="html-container" class="editor page">
<pre id="html" lang="html" contenteditable spellcheck="false"><!-- content to be placed inside <body>…</body> --></pre>
</div>
<section id="help" class="popup">
<h1>Help & About</h1>
<a href="#" class="close" title="Close">×</a>
<div class="content"><div>
<p>dabblet is an interactive playground for quickly testing snippets of CSS and HTML code.
It uses <a href="http://leaverou.github.com/prefixfree" target="_blank">-prefix-free</a>,
so that you won't have to add any prefixes in your CSS code. You can save your work in
<a href="http://gist.github.com">Github gists</a>, embed it in other websites and share it
with others. <a href="http://twitter.com/dabblet">Follow @dabblet on twitter</a></p>
<p>It currently only supports modern versions of Chrome, Safari and Firefox but I'm hoping
to expand browser support soon.</p>
<p>It’s handcoded by <a href="http://lea.verou.me">Lea Verou</a> with care
but <a href="https://github.com/leaverou/dabblet/contributors" target="_blank">some other nice folks</a> helped too.</p>
<h2>Keyboard shortcuts</h2>
<a href="#keyboard">View keyboard shortcuts</a>
<h2>Where can I report bugs?</h2>
<p>Please report any bugs and suggest features in <a href="https://github.com/LeaVerou/dabblet/issues" target="_blank">dabblet’s bug tracker</a>.
An extensive description and (for bugs) a reduced testcase are appreciated. Thanks for your effort towards making dabblet better!</p>
<h2>What about JavaScript?</h2>
<p>You may use <script> tags as usual in your HTML markup in order to execute JavaScript code in your dabblet.
However, keep in mind that dabblet is CSS-focused. If your demo needs a lot of JavaScript, you might
find something like <a href="http://jsfiddle.net/">jsFiddle</a>
or <a href="http://jsbin.com/" target="_blank">JSBin</a> more helpful.
<h2>License</h2>
<p>All posted code belongs to the poster and no license is enforced.</p>
<p>I am not responsible or liable for any loss or damage of any kind during the usage of dabblet or provided code.</p>
<p>dabblet itself is open source software and is distributed under a
<a href="http://www.opensource.org/licenses/NPOSL-3.0">NPOSL-3.0 license</a>.
<a href="http://github.com/LeaVerou/dabblet">Fork dabblet on github</a>.
</div></div>
</section>
<section id="keyboard" class="popup">
<h1>Keyboard shortcuts</h1>
<a href="#" class="close" title="Close">×</a>
<div class="content">
<p>I’m a heavy keyboard user myself, so lots of effort has been put into making dabblet
a breeze to use with the keyboard:</p>
<table>
<thead>
<tr>
<td>Action</td>
<td>Result</td>
</tr>
</thead>
<tbody>
<tr>
<td><kbd title="Cmd">⌘</kbd><kbd>S</kbd></td>
<td>Save if not saved, update if saved, fork if not own</td>
</tr>
<tr>
<td><kbd title="Cmd">⌘</kbd><kbd>1</kbd></td>
<td>Go to CSS editing</td>
</tr>
<tr>
<td><kbd title="Cmd">⌘</kbd><kbd>2</kbd></td>
<td>Go to HTML editing</td>
</tr>
<tr>
<td><kbd title="Cmd">⌘</kbd><kbd>3</kbd></td>
<td>Go to result</td>
</tr>
<tr>
<td><kbd title="Cmd">⌘</kbd><kbd title="Shift">⇧</kbd><kbd>[</kbd></td>
<td>Go to previous tab</td>
</tr>
<tr>
<td><kbd title="Cmd">⌘</kbd><kbd title="Shift">⇧</kbd><kbd>]</kbd></td>
<td>Go to next tab</td>
</tr>
<tr>
<td><kbd title="Tab">⇥</kbd><div class="note">in editing mode</div></td>
<td>Enters a Tab (<code>\t</code>) character</td>
</tr>
<tr>
<td><kbd title="Tab">⇥</kbd> <div class="note">after selecting text</div></td>
<td>Indents the selected lines (including partially selected lines)</td>
</tr>
<tr>
<td><kbd title="Shift">⇧</kbd><kbd title="Tab">⇥</kbd> <div class="note">after selecting text</div></td>
<td>Removes one indent (Tab or space) from the beginning of each (partially) selected line.</td>
</tr>
<tr>
<td><kbd title="Cmd">⌘</kbd><kbd>/</kbd><div class="note">in editing mode</div></td>
<td>Comments the current selection (or line if there is none) or uncomments if within a comment</td>
</tr>
<tr>
<td><kbd title="Alt">⌥</kbd><kbd title="Up arrow">↑</kbd> / <kbd title="Alt">⌥</kbd><kbd title="Down arrow">↓</kbd></td>
<td>Increment/decrement value by 1</td>
</tr>
<tr>
<td><kbd title="Shift">⇧</kbd><kbd title="Alt">⌥</kbd><kbd title="Up arrow">↑</kbd> / <kbd title="Shift">⇧</kbd><kbd title="Alt">⌥</kbd><kbd title="Down arrow">↓</kbd></td>
<td>Increment/decrement value by 10</td>
</tr>
<tr>
<td><kbd title="Ctrl">⌃</kbd><kbd title="Alt">⌥</kbd><kbd title="Up arrow">↑</kbd> / <kbd title="Ctrl">⌃</kbd><kbd title="Alt">⌥</kbd><kbd title="Down arrow">↓</kbd></td>
<td>Increment/decrement value by 0.1</td>
</tr>
<tr>
<td><kbd title="Esc">⎋</kbd><div class="note">in editing mode</div></td>
<td>The editing area loses focus, so after pressing <kbd title="Tab">⇥</kbd> you can use
the navigation bar through the keyboard</td>
</tr>
</tbody>
</table>
<p><strong>Note:</strong> Wherever <kbd title="Cmd">⌘</kbd> is used, it means either <kbd title="Cmd">⌘</kbd> or <kbd title="Ctrl">⌃</kbd>.</p>
</div>
</section>
<div id="color" class="previewer"></div>
<div id="abslength" class="previewer"></div>
<div id="time" class="previewer">
<svg>
<circle cx="32" cy="32" r="15.9">
<animate attributeName="stroke-dasharray" values="0,500;100,500;0,500" dur="5s" repeatCount="indefinite" />
<animate attributeName="stroke-dashoffset" values="0;0;-100" dur="5s" repeatCount="indefinite" />
</circle>
</svg>
</div>
<div id="angle" class="previewer">
<svg>
<circle cx="32" cy="32" r="15.9" stroke-dasharray="0,500" />
</svg>
</div>
<div id="fontfamily" class="previewer">ABCabc123#$%</div>
<div id="gradient" class="previewer"><div></div></div>
<div id="easing" class="previewer">
<svg width="100" height="100" viewBox="-20 -20 140 140">
<defs>
<marker id="marker" viewBox="0 0 4 4" refX="2" refY="2" markerUnits="strokeWidth">
<circle cx="2" cy="2" r="1.5" />
</marker>
</defs>
<path d="M0,100 C20,50, 40,30, 100,0" />
<line x1="0" y1="100" x2="20" y2="50" />
<line x1="100" y1="0" x2="40" y2="30" />
</svg>
</div>
<div id="loader">Loading…</div>
<script src="/code/util.js"></script>
<script src="/code/selection.js"></script>
<script src="/code/code-highlight.js"></script>
<script src="/code/dabblet.js"></script>
<script src="/code/previewers.js" async defer></script>
</body>
</html>