sibilant 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -4
- data/js/sibilant/.gitignore +4 -0
- data/js/sibilant/.travis.yml +6 -0
- data/js/sibilant/LICENSE +20 -0
- data/js/sibilant/README.md +70 -0
- data/js/sibilant/bin/sibilant +3 -0
- data/js/sibilant/cli-help +79 -0
- data/js/sibilant/include/functional.sibilant +57 -0
- data/js/sibilant/include/macros.sibilant +374 -0
- data/js/sibilant/include/node.sibilant +2 -0
- data/js/sibilant/lib/browser.js +685 -0
- data/js/sibilant/lib/cli.js +153 -0
- data/js/sibilant/lib/options.js +232 -0
- data/js/sibilant/lib/repl.js +78 -0
- data/js/sibilant/lib/sibilant.js +688 -0
- data/js/sibilant/misc/sibilant-mode.el +129 -0
- data/js/sibilant/package.json +19 -0
- data/js/sibilant/package.sibilant +16 -0
- data/js/sibilant/public/index.html +502 -0
- data/js/sibilant/public/javascripts/browser.js +685 -0
- data/js/sibilant/public/javascripts/jquery-ui.js +392 -0
- data/js/sibilant/public/javascripts/jquery.js +154 -0
- data/js/sibilant/public/javascripts/macros.sibilant +374 -0
- data/js/sibilant/public/javascripts/sibilant.info.sibilant +77 -0
- data/js/sibilant/public/sass/_mixins.sass +98 -0
- data/js/sibilant/public/sass/sibilant.sass +156 -0
- data/js/sibilant/public/stylesheets/Anonymous_Pro-webfont.eot +0 -0
- data/js/sibilant/public/stylesheets/Anonymous_Pro-webfont.svg +241 -0
- data/js/sibilant/public/stylesheets/Anonymous_Pro-webfont.ttf +0 -0
- data/js/sibilant/public/stylesheets/Anonymous_Pro-webfont.woff +0 -0
- data/js/sibilant/public/stylesheets/sibilant.css +166 -0
- data/js/sibilant/src/browser.sibilant +45 -0
- data/js/sibilant/src/cli.sibilant +93 -0
- data/js/sibilant/src/core.sibilant +338 -0
- data/js/sibilant/src/options.sibilant +65 -0
- data/js/sibilant/src/repl.sibilant +59 -0
- data/js/sibilant/src/sibilant.sibilant +78 -0
- data/js/sibilant/test/defvar.sibilant +5 -0
- data/js/sibilant/test/includeFile1.sibilant +1 -0
- data/js/sibilant/test/includeFile2.sibilant +1 -0
- data/js/sibilant/test/node.sibilant +10 -0
- data/js/sibilant/test/slice.sibilant +3 -0
- data/js/sibilant/test/test.sibilant +464 -0
- data/js/sibilant/test/testHelper.sibilant +80 -0
- data/lib/sibilant/version.rb +1 -1
- data/sibilant.gemspec +3 -1
- metadata +44 -1
@@ -0,0 +1,374 @@
|
|
1
|
+
(defmacro cons (first rest)
|
2
|
+
(macros.send (macros.list first) 'concat rest))
|
3
|
+
|
4
|
+
(defmacro join (glue arr)
|
5
|
+
(concat "(" (translate arr) ").join(" (translate glue) ")"))
|
6
|
+
|
7
|
+
(defmacro list (&rest args)
|
8
|
+
(concat "[ " (join ", " (map args translate)) " ]"))
|
9
|
+
|
10
|
+
(defmacro get (arr i) (concat "(" (translate arr) ")[" (translate i) "]"))
|
11
|
+
|
12
|
+
(defmacro + (&rest args)
|
13
|
+
(concat "(" (join " + " (map args translate)) ")"))
|
14
|
+
(defmacro - (&rest args)
|
15
|
+
(concat "(" (join " - " (map args translate)) ")"))
|
16
|
+
(defmacro * (&rest args)
|
17
|
+
(concat "(" (join " * " (map args translate)) ")"))
|
18
|
+
(defmacro / (&rest args)
|
19
|
+
(concat "(" (join " / " (map args translate)) ")"))
|
20
|
+
(defmacro or (&rest args)
|
21
|
+
(concat "(" (join " || " (map args translate)) ")"))
|
22
|
+
(defmacro and (&rest args)
|
23
|
+
(concat "(" (join " && " (map args translate)) ")"))
|
24
|
+
(defmacro mod (&rest args)
|
25
|
+
(concat "(" (join " % " (map args translate)) ")"))
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
(defmacro infix-comparator (comparator args)
|
30
|
+
(concat "("
|
31
|
+
(join " && "
|
32
|
+
(map (args.slice 0 -1)
|
33
|
+
(lambda (item index)
|
34
|
+
(concat item
|
35
|
+
" " comparator " "
|
36
|
+
(get args (+ 1 index))))))
|
37
|
+
")"))
|
38
|
+
|
39
|
+
(defmacro > (&rest args) (macros.infix-comparator ">" (map args translate)))
|
40
|
+
(defmacro < (&rest args) (macros.infix-comparator "<" (map args translate)))
|
41
|
+
(defmacro <= (&rest args) (macros.infix-comparator "<=" (map args translate)))
|
42
|
+
(defmacro >= (&rest args) (macros.infix-comparator ">=" (map args translate)))
|
43
|
+
(defmacro != (&rest args) (macros.infix-comparator "!==" (map args translate)))
|
44
|
+
|
45
|
+
(defmacro pow (base exponent)
|
46
|
+
(macros.call "Math.pow" base exponent))
|
47
|
+
|
48
|
+
(defmacro incr-by (item increment)
|
49
|
+
(concat (translate item) " += " (translate increment)))
|
50
|
+
|
51
|
+
(defmacro incr (item)
|
52
|
+
(concat "((" (translate item) ")++)"))
|
53
|
+
|
54
|
+
(defmacro decr (item)
|
55
|
+
(concat "((" (translate item) ")--)"))
|
56
|
+
|
57
|
+
(defmacro set (arr &rest kv-pairs)
|
58
|
+
(join "\n" (bulk-map kv-pairs
|
59
|
+
(lambda (k v)
|
60
|
+
(concat "(" (translate arr) ")"
|
61
|
+
"[" (translate k) "] = " (translate v) ";")))))
|
62
|
+
|
63
|
+
(defmacro send (object method &rest args)
|
64
|
+
(concat (translate object) "." (translate method)
|
65
|
+
"(" (join ", " (map args translate)) ")"))
|
66
|
+
|
67
|
+
(defmacro new (fn)
|
68
|
+
(concat "(new " (translate fn) ")"))
|
69
|
+
|
70
|
+
(defmacro regex (string &optional glim)
|
71
|
+
((get macros 'new) (macros.call "RegExp" string (or glim "undefined"))))
|
72
|
+
|
73
|
+
(defmacro timestamp ()
|
74
|
+
(concat "\"" (send (new (-date)) to-string) "\""))
|
75
|
+
|
76
|
+
(defmacro comment (&rest contents)
|
77
|
+
(map contents
|
78
|
+
(lambda (item)
|
79
|
+
(join "\n" (map (send (translate item) split "\n")
|
80
|
+
(lambda (line) (concat "// " line)))))))
|
81
|
+
|
82
|
+
(defmacro meta (body)
|
83
|
+
(eval (translate body)))
|
84
|
+
|
85
|
+
(defmacro apply (fn arglist)
|
86
|
+
(macros.send fn 'apply 'undefined arglist))
|
87
|
+
|
88
|
+
(defmacro zero? (item)
|
89
|
+
((get macros "=") (translate item) 0))
|
90
|
+
|
91
|
+
(defmacro empty? (arr)
|
92
|
+
(concat "((" (translate arr) ").length === 0)"))
|
93
|
+
|
94
|
+
(defmacro odd? (number)
|
95
|
+
((get macros "!=") 0
|
96
|
+
(macros.mod (translate number) 2)))
|
97
|
+
|
98
|
+
(defmacro even? (number)
|
99
|
+
((get macros "=") 0
|
100
|
+
(macros.mod (translate number) 2)))
|
101
|
+
|
102
|
+
|
103
|
+
(defmacro function? (thing)
|
104
|
+
(concat "typeof(" (translate thing) ") === 'function'"))
|
105
|
+
|
106
|
+
(defmacro undefined? (thing)
|
107
|
+
(concat "typeof(" (translate thing) ") === 'undefined'"))
|
108
|
+
|
109
|
+
(defmacro defined? (thing)
|
110
|
+
(concat "typeof(" (translate thing) ") !== 'undefined'"))
|
111
|
+
|
112
|
+
(defmacro number? (thing)
|
113
|
+
(concat "typeof(" (translate thing) ") === 'number'"))
|
114
|
+
|
115
|
+
(defmacro first (arr) (macros.get arr 0))
|
116
|
+
(defmacro second (arr) (macros.get arr 1))
|
117
|
+
(defmacro third (arr) (macros.get arr 2))
|
118
|
+
(defmacro fourth (arr) (macros.get arr 3))
|
119
|
+
(defmacro fifth (arr) (macros.get arr 4))
|
120
|
+
(defmacro sixth (arr) (macros.get arr 5))
|
121
|
+
(defmacro seventh (arr) (macros.get arr 6))
|
122
|
+
(defmacro eighth (arr) (macros.get arr 7))
|
123
|
+
(defmacro ninth (arr) (macros.get arr 8))
|
124
|
+
|
125
|
+
(defmacro rest (arr)
|
126
|
+
(macros.send arr 'slice 1))
|
127
|
+
|
128
|
+
(defmacro length (arr)
|
129
|
+
(macros.get arr "\"length\""))
|
130
|
+
|
131
|
+
(defmacro last (arr)
|
132
|
+
(macros.get (macros.send arr 'slice -1) 0))
|
133
|
+
|
134
|
+
(defmacro if (arg truebody falsebody)
|
135
|
+
(concat
|
136
|
+
"(function() {"
|
137
|
+
(indent (concat
|
138
|
+
"if (" (translate arg) ") {"
|
139
|
+
(indent (macros.progn truebody))
|
140
|
+
"} else {"
|
141
|
+
(indent (macros.progn falsebody))
|
142
|
+
"}"))
|
143
|
+
"})()"))
|
144
|
+
|
145
|
+
(defmacro defvar (&rest pairs)
|
146
|
+
(as-statement
|
147
|
+
(concat "var "
|
148
|
+
(join ",\n "
|
149
|
+
(bulk-map pairs
|
150
|
+
(lambda (name value)
|
151
|
+
(concat (translate name) " = "
|
152
|
+
(translate value)))))
|
153
|
+
";")))
|
154
|
+
|
155
|
+
(defmacro = (first-thing &rest other-things)
|
156
|
+
(defvar translated-first-thing (translate first-thing))
|
157
|
+
(concat "("
|
158
|
+
(join " &&\n "
|
159
|
+
(map other-things
|
160
|
+
(lambda (thing)
|
161
|
+
(concat translated-first-thing
|
162
|
+
" === "
|
163
|
+
(translate thing)))))
|
164
|
+
")"))
|
165
|
+
|
166
|
+
|
167
|
+
(defmacro string? (thing)
|
168
|
+
(concat "typeof(" (translate thing) ") === \"string\""))
|
169
|
+
|
170
|
+
(defmacro list? (thing)
|
171
|
+
(defvar translated (concat "(" (translate thing) ")"))
|
172
|
+
(concat translated " && "
|
173
|
+
translated ".constructor.name === \"Array\""))
|
174
|
+
|
175
|
+
|
176
|
+
(defmacro when (arg &rest body)
|
177
|
+
(concat
|
178
|
+
"(function() {"
|
179
|
+
(indent (concat
|
180
|
+
"if (" (translate arg) ") {"
|
181
|
+
(indent (apply macros.progn body))
|
182
|
+
"}"))
|
183
|
+
"})()"))
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
(defmacro not (exp)
|
188
|
+
(concat "(!" (translate exp) ")"))
|
189
|
+
|
190
|
+
(defmacro slice (arr start &optional end)
|
191
|
+
(macros.send (translate arr) "slice" start end))
|
192
|
+
|
193
|
+
(defmacro inspect (&rest args)
|
194
|
+
(join " + \"\\n\" + "
|
195
|
+
(map args
|
196
|
+
(lambda (arg)
|
197
|
+
(concat "\"" arg ":\" + " (translate arg))))))
|
198
|
+
|
199
|
+
(defmacro each (item array &rest body)
|
200
|
+
(macros.send (translate array) 'for-each
|
201
|
+
(apply macros.lambda (cons item body))))
|
202
|
+
|
203
|
+
|
204
|
+
(defmacro setf (&rest args)
|
205
|
+
(join "\n"
|
206
|
+
(bulk-map args (lambda (name value)
|
207
|
+
(as-statement (concat (translate name) " = "
|
208
|
+
(translate value)))))))
|
209
|
+
|
210
|
+
|
211
|
+
(defmacro macro-list ()
|
212
|
+
(concat "["
|
213
|
+
(indent (join ",\n"
|
214
|
+
(map (-object.keys macros)
|
215
|
+
macros.quote)))
|
216
|
+
"]"))
|
217
|
+
|
218
|
+
(defmacro macroexpand (name)
|
219
|
+
(defvar macro (get macros (translate name)))
|
220
|
+
(if macro
|
221
|
+
(concat "// macro: " name "\n" (send macro to-string))
|
222
|
+
"undefined"))
|
223
|
+
|
224
|
+
(defmacro throw (&rest string)
|
225
|
+
(concat "throw new Error (" (join " " (map string translate)) ")"))
|
226
|
+
|
227
|
+
(defmacro as-boolean (expr)
|
228
|
+
(concat "(!!(" (translate expr) "))"))
|
229
|
+
|
230
|
+
(defmacro chain (object &rest calls)
|
231
|
+
(concat (translate object) " // chain"
|
232
|
+
(indent (join "\n"
|
233
|
+
(map calls
|
234
|
+
(lambda (call, index)
|
235
|
+
(defvar method (first call))
|
236
|
+
(defvar args (rest call))
|
237
|
+
(concat "." (translate method)
|
238
|
+
"(" (join ", " (map args translate)) ")")))))))
|
239
|
+
|
240
|
+
(defmacro try (tryblock catchblock)
|
241
|
+
(concat
|
242
|
+
"(function() {"
|
243
|
+
(indent (concat
|
244
|
+
"try {"
|
245
|
+
(indent (macros.progn tryblock))
|
246
|
+
"} catch (e) {"
|
247
|
+
(indent (macros.progn catchblock))
|
248
|
+
"}"))
|
249
|
+
"})()"))
|
250
|
+
|
251
|
+
|
252
|
+
(defmacro while (condition &rest block)
|
253
|
+
(macros.scoped
|
254
|
+
(macros.defvar '**return-value**)
|
255
|
+
(concat "while (" (translate condition) ") {"
|
256
|
+
(indent (macros.setf '**return-value**
|
257
|
+
(apply macros.scoped block))))
|
258
|
+
"}"
|
259
|
+
'**return-value**))
|
260
|
+
|
261
|
+
(defmacro until (condition &rest block)
|
262
|
+
(apply (get macros 'while)
|
263
|
+
(cons ['not condition] block)))
|
264
|
+
|
265
|
+
|
266
|
+
(defmacro thunk (&rest args)
|
267
|
+
(apply macros.lambda (cons [] args)))
|
268
|
+
|
269
|
+
(defmacro keys (obj)
|
270
|
+
(macros.call "Object.keys" (translate obj)))
|
271
|
+
|
272
|
+
(defmacro delete (&rest objects)
|
273
|
+
(join "\n" (map objects (lambda (obj)
|
274
|
+
(concat "delete " (translate obj) ";")))))
|
275
|
+
|
276
|
+
(defmacro delmacro (macro-name)
|
277
|
+
(delete (get macros (translate macro-name)))
|
278
|
+
"")
|
279
|
+
|
280
|
+
(defmacro alias-macro (current-macro-name desired-macro-name)
|
281
|
+
(defvar current-macro-name (translate current-macro-name)
|
282
|
+
desired-macro-name (translate desired-macro-name))
|
283
|
+
(set macros desired-macro-name (get macros current-macro-name))
|
284
|
+
"")
|
285
|
+
|
286
|
+
(defmacro rename-macro (current-macro-name desired-macro-name)
|
287
|
+
(macros.alias-macro current-macro-name desired-macro-name)
|
288
|
+
(macros.delmacro current-macro-name)
|
289
|
+
"")
|
290
|
+
|
291
|
+
(defmacro defhash (name &rest pairs)
|
292
|
+
(macros.defvar name (apply macros.hash pairs)))
|
293
|
+
|
294
|
+
(defmacro arguments ()
|
295
|
+
"(Array.prototype.slice.apply(arguments))")
|
296
|
+
|
297
|
+
(defmacro scoped (&rest body)
|
298
|
+
(macros.call (apply macros.thunk body)))
|
299
|
+
|
300
|
+
(defmacro each-key (as obj &rest body)
|
301
|
+
(concat "(function() {"
|
302
|
+
(indent
|
303
|
+
(concat "for (var " (translate as) " in " (translate obj) ") "
|
304
|
+
(apply macros.scoped body)
|
305
|
+
";"))
|
306
|
+
"})();"))
|
307
|
+
|
308
|
+
(defmacro match? (regexp string)
|
309
|
+
(macros.send string 'match regexp))
|
310
|
+
|
311
|
+
(defmacro switch (obj &rest cases)
|
312
|
+
|
313
|
+
;; the complexity of this macro indicates there's a problem
|
314
|
+
;; I'm not quite sure where to fix this, but it has to do with quoting.
|
315
|
+
(defvar lines (list (concat "switch(" (translate obj) ") {")))
|
316
|
+
(each (case-def) cases
|
317
|
+
(defvar case-name (first case-def))
|
318
|
+
(when (and (list? case-name)
|
319
|
+
(= (first case-name) 'quote))
|
320
|
+
(defvar second (second case-name))
|
321
|
+
(setf case-name (if (list? second)
|
322
|
+
(map second macros.quote)
|
323
|
+
(macros.quote second))))
|
324
|
+
|
325
|
+
(defvar case-string
|
326
|
+
(if (list? case-name)
|
327
|
+
(join "\n" (map case-name (lambda (c)
|
328
|
+
(concat "case " (translate c) ":"))))
|
329
|
+
(if (= 'default case-name) "default:"
|
330
|
+
(concat "case " (translate case-name) ":"))))
|
331
|
+
|
332
|
+
(lines.push (concat case-string
|
333
|
+
(indent (apply macros.progn (case-def.slice 1))))))
|
334
|
+
|
335
|
+
;; the following two lines are to get the whitespace right
|
336
|
+
;; this is necessary because switches are indented weird
|
337
|
+
(set lines (- lines.length 1)
|
338
|
+
(chain (get lines (- lines.length 1)) (concat "}")))
|
339
|
+
|
340
|
+
(concat "(function() {" (apply indent lines) "})()"))
|
341
|
+
|
342
|
+
|
343
|
+
(defmacro if-else (&rest args)
|
344
|
+
(concat "(function() {"
|
345
|
+
(indent
|
346
|
+
(join " else "
|
347
|
+
(bulk-map args
|
348
|
+
(lambda (cond val)
|
349
|
+
(if (undefined? val)
|
350
|
+
(concat "{" (indent (macros.progn cond)) "}")
|
351
|
+
(concat "if (" (translate cond) ") {"
|
352
|
+
(indent (macros.progn val))
|
353
|
+
"}"))))))
|
354
|
+
"})()"))
|
355
|
+
|
356
|
+
(defmacro let (args &optional body)
|
357
|
+
(concat "let (" (bulk-map args
|
358
|
+
(lambda (h k v)
|
359
|
+
(concat (translate k) " = " (translate v))))
|
360
|
+
(if (undefined? body) ");"
|
361
|
+
(concat ") {" (indent (translate body)) "}"))))
|
362
|
+
|
363
|
+
(defmacro instance-of? (item type)
|
364
|
+
(concat "(" (translate item) " instanceof " (translate type) ")"))
|
365
|
+
|
366
|
+
(defmacro slice (list &optional begin &optional end)
|
367
|
+
(concat "Array.prototype.slice.call(" (translate list)
|
368
|
+
", " (or (translate begin) 0)
|
369
|
+
(if (defined? end) (concat ", " (translate end) ")") ")")))
|
370
|
+
|
371
|
+
(defmacro ternary (cond if-true if-false)
|
372
|
+
(concat "(" (translate cond) ") ? "
|
373
|
+
(translate if-true) " : "
|
374
|
+
(translate if-false)))
|
@@ -0,0 +1,77 @@
|
|
1
|
+
(defmacro trim (item)
|
2
|
+
(macros.send item 'replace "/^\\s*|\\s*$/g" "\"\""))
|
3
|
+
|
4
|
+
(defmacro contains? (item arr)
|
5
|
+
((get macros "!=") -1 (macros.send (translate arr) 'index-of item)))
|
6
|
+
|
7
|
+
|
8
|
+
($ (thunk
|
9
|
+
(defvar $window ($ window))
|
10
|
+
|
11
|
+
(defun check-hash ()
|
12
|
+
(when (defined? check-hash.timeout)
|
13
|
+
(clear-timeout check-hash.timeout)
|
14
|
+
(delete check-hash.timeout))
|
15
|
+
|
16
|
+
|
17
|
+
(when (!= window.location.hash ($window.data 'last-hash))
|
18
|
+
(chain $window
|
19
|
+
(data 'last-hash window.location.hash)
|
20
|
+
(trigger 'hash-change window.location.hash)))
|
21
|
+
|
22
|
+
(setf check-hash.timeout (set-timeout check-hash 500)))
|
23
|
+
|
24
|
+
(defvar items ($ "script[language=sibilant/example]"))
|
25
|
+
|
26
|
+
($window.click (thunk (set-timeout check-hash 25)))
|
27
|
+
|
28
|
+
($window.bind 'hash-change
|
29
|
+
(lambda (evt hash)
|
30
|
+
(defvar item (send items filter hash))
|
31
|
+
(when (< 0 item.length)
|
32
|
+
(defvar content (chain item
|
33
|
+
(text)
|
34
|
+
(replace "<![CDATA[\n", "")
|
35
|
+
(replace "]]>" "")))
|
36
|
+
(defvar title (send item attr "data-title"))
|
37
|
+
(send ($ "header h2") html title)
|
38
|
+
(defvar next (send item next items.selector))
|
39
|
+
(defvar prev (send item prev items.selector))
|
40
|
+
|
41
|
+
(if (> next.length 0)
|
42
|
+
(chain ($ "#next")
|
43
|
+
(attr 'href (concat "#" (send next attr 'id)))
|
44
|
+
(show))
|
45
|
+
(send ($ "#next") hide))
|
46
|
+
|
47
|
+
(if (> prev.length 0)
|
48
|
+
(chain ($ "#prev")
|
49
|
+
(attr 'href (concat "#" (send prev attr 'id)))
|
50
|
+
(show))
|
51
|
+
(send ($ "#prev") hide))
|
52
|
+
|
53
|
+
(chain ($ "textarea")
|
54
|
+
(val (trim content))
|
55
|
+
(keyup)))))
|
56
|
+
|
57
|
+
|
58
|
+
(switch window.location.hash
|
59
|
+
(("" "#")
|
60
|
+
(setf window.location.hash
|
61
|
+
(chain items (first) (attr 'id)))))
|
62
|
+
|
63
|
+
(defvar textarea ($ 'textarea))
|
64
|
+
|
65
|
+
(chain textarea
|
66
|
+
(focus)
|
67
|
+
(keyup (lambda (evt)
|
68
|
+
(defvar output ($ "#output"))
|
69
|
+
(try (chain output
|
70
|
+
(text (sibilant.translate-all (textarea.val)))
|
71
|
+
(remove-class 'error))
|
72
|
+
(chain output
|
73
|
+
(text e.stack)
|
74
|
+
(add-class 'error))))))
|
75
|
+
(check-hash)))
|
76
|
+
|
77
|
+
|
@@ -0,0 +1,98 @@
|
|
1
|
+
=clearfix
|
2
|
+
*display: inline-block
|
3
|
+
&:after
|
4
|
+
content: " "
|
5
|
+
display: block
|
6
|
+
height: 0
|
7
|
+
clear: both
|
8
|
+
visibility: hidden
|
9
|
+
|
10
|
+
=border_radius($radius)
|
11
|
+
-moz-border-radius: $radius
|
12
|
+
-webkit-border-radius: $radius
|
13
|
+
|
14
|
+
=border_radius_corners($top_left, $top_right, $bottom_right, $bottom_left)
|
15
|
+
+border_radius_top_left($top_left)
|
16
|
+
+border_radius_top_right($top_right)
|
17
|
+
+border_radius_bottom_right($bottom_right)
|
18
|
+
+border_radius_bottom_left($bottom_left)
|
19
|
+
|
20
|
+
=border_radius_top($radius)
|
21
|
+
+border_radius_top_left($radius)
|
22
|
+
+border_radius_top_right($radius)
|
23
|
+
|
24
|
+
=border_radius_bottom($radius)
|
25
|
+
+border_radius_bottom_left($radius)
|
26
|
+
+border_radius_bottom_right($radius)
|
27
|
+
|
28
|
+
=border_radius_right($radius)
|
29
|
+
+border_radius_bottom_right($radius)
|
30
|
+
+border_radius_top_right($radius)
|
31
|
+
|
32
|
+
=border_radius_left($radius)
|
33
|
+
+border_radius_bottom_left($radius)
|
34
|
+
+border_radius_top_left($radius)
|
35
|
+
|
36
|
+
=border_radius_top_left($radius)
|
37
|
+
-moz-border-radius-topleft: $radius
|
38
|
+
-webkit-border-top-left-radius: $radius
|
39
|
+
|
40
|
+
=border_radius_top_right($radius)
|
41
|
+
-moz-border-radius-topright: $radius
|
42
|
+
-webkit-border-top-right-radius: $radius
|
43
|
+
|
44
|
+
=border_radius_bottom_right($radius)
|
45
|
+
-moz-border-radius-bottomright: $radius
|
46
|
+
-webkit-border-bottom-right-radius: $radius
|
47
|
+
|
48
|
+
=border_radius_bottom_left($radius)
|
49
|
+
-moz-border-radius-bottomleft: $radius
|
50
|
+
-webkit-border-bottom-left-radius: $radius
|
51
|
+
|
52
|
+
=box_shadow($shadow)
|
53
|
+
-webkit-box-shadow: $shadow
|
54
|
+
-moz-box-shadow: $shadow
|
55
|
+
|
56
|
+
=button
|
57
|
+
+border_radius(4px)
|
58
|
+
color: rgba(0,0,0,0.75)
|
59
|
+
text-decoration: none
|
60
|
+
cursor: pointer
|
61
|
+
background: rgba(128,128,128,0.25)
|
62
|
+
border: 1px solid rgba(0, 0, 0, 0.25)
|
63
|
+
padding: 5px
|
64
|
+
display: inline-block
|
65
|
+
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5)
|
66
|
+
font-weight: normal
|
67
|
+
+box_shadow(0 0 10px rgba(0,0,0,0.2))
|
68
|
+
&:hover
|
69
|
+
background: rgba(128,128,128,0.15)
|
70
|
+
+box_shadow(0 0 10px rgba(0,0,0,0.1))
|
71
|
+
|
72
|
+
|
73
|
+
=small_button
|
74
|
+
+button
|
75
|
+
line-height: 15px
|
76
|
+
height: 15px
|
77
|
+
padding: 2px 5px
|
78
|
+
|
79
|
+
=large_button
|
80
|
+
+button
|
81
|
+
font-size: 15px
|
82
|
+
display: block
|
83
|
+
text-align: center
|
84
|
+
width: 200px
|
85
|
+
height: 40px
|
86
|
+
&[href]
|
87
|
+
line-height: 40px
|
88
|
+
&[type=submit]
|
89
|
+
line-height: 30px
|
90
|
+
padding: 5px
|
91
|
+
vertical-align: middle
|
92
|
+
margin: auto
|
93
|
+
|
94
|
+
|
95
|
+
=rotate($rotation)
|
96
|
+
-webkit-transform: unquote("rotate(") $rotation unquote(")")
|
97
|
+
-moz-transform: unquote("rotate(") $rotation unquote(")")
|
98
|
+
|
@@ -0,0 +1,156 @@
|
|
1
|
+
@import _mixins.sass
|
2
|
+
@font-face
|
3
|
+
font-family: 'AnonymousProRegular'
|
4
|
+
src: url('Anonymous_Pro-webfont.eot')
|
5
|
+
src: url('Anonymous_Pro-webfont.woff') format('woff'), url('Anonymous_Pro-webfont.ttf') format('truetype'), url('Anonymous_Pro-webfont.svg#webfontqJs74pnE') format('svg')
|
6
|
+
font-weight: normal
|
7
|
+
font-style: normal
|
8
|
+
|
9
|
+
body, textarea
|
10
|
+
font-family: 'AnonymousProRegular', Arial, sans-serif
|
11
|
+
|
12
|
+
|
13
|
+
#fork-me-on-github
|
14
|
+
:text-decoration none
|
15
|
+
font: 20px 'AnonymousProRegular', Arial, sans-serif
|
16
|
+
display: block
|
17
|
+
position: absolute
|
18
|
+
top: 70px
|
19
|
+
right: -70px
|
20
|
+
+rotate(45deg)
|
21
|
+
span
|
22
|
+
:background rgba(0,0,0,0.1)
|
23
|
+
:line-height 20px
|
24
|
+
:padding 3px 60px 7px
|
25
|
+
:color rgba(0,0,0,0.5)
|
26
|
+
+box_shadow(0 0 5px rgba(0,0,0,0.4))
|
27
|
+
:text-shadow 1px 1px 2px white
|
28
|
+
background-image: -webkit-gradient(linear,left top, left bottom, color-stop(0, rgb(230,230,230)), color-stop(1, rgb(255,255,255)))
|
29
|
+
background-image: -moz-linear-gradient(center bottom, rgb(230,230,230) 0%, rgb(255,255,255) 100%)
|
30
|
+
&:hover
|
31
|
+
+box_shadow(1px 1px 10px rgba(0,0,0,0.5))
|
32
|
+
|
33
|
+
#controls
|
34
|
+
:position absolute
|
35
|
+
:bottom 0
|
36
|
+
:height 75px
|
37
|
+
:width 100%
|
38
|
+
:display block
|
39
|
+
a
|
40
|
+
:display inline-block
|
41
|
+
:margin 0 5px
|
42
|
+
+border_radius(10px)
|
43
|
+
:width 100px
|
44
|
+
:height 40px
|
45
|
+
:line-height 40px
|
46
|
+
:text-decoration none
|
47
|
+
:color rgba(0,0,0,0.6)
|
48
|
+
:text-shadow 0 1px 1px white
|
49
|
+
+box-shadow(3px 3px 3px rgba(0,0,0,0.1))
|
50
|
+
:background-color rgb(240,240,240)
|
51
|
+
:background-image -webkit-gradient(linear,left top, left bottom, color-stop(0, rgba(255,255,255,0.1)), color-stop(0.15, rgba(255,255,255,0.75)), color-stop(0.5, rgba(255,255,255,0)), color-stop(0.6, rgba(0,0,0,0)), color-stop(0.75, rgba(0,0,0,0.1)), color-stop(1, rgba(0,0,0,0.4))), -webkit-gradient(linear, left top, right top, color-stop(0, rgba(0,0,0,0.1)), color-stop(0.05, rgba(0,0,0,0)), color-stop(0.7, rgba(0,0,0,0)), color-stop(0.9, rgba(0,0,0,0.1)), color-stop(1, rgba(0,0,0,0.4)))
|
52
|
+
:background-image -moz-linear-gradient(center bottom, rgba(0,0,0,0.1) 3%, rgba(0,0,0,0.2) 5%, rgba(0,0,0,0) 40%)
|
53
|
+
:outline 0
|
54
|
+
|
55
|
+
&:hover
|
56
|
+
:background-color rgb(250,250,250)
|
57
|
+
:color rgba(0,0,0,0.75)
|
58
|
+
&:active
|
59
|
+
:background-image -webkit-gradient(linear,left bottom, left top, color-stop(0, rgba(0,0,0,0.1)), color-stop(0.1, rgba(0,0,0,0.2)), color-stop(0.5, rgba(255,255,255,0)), color-stop(0.6, rgba(0,0,0,0)), color-stop(0.75, rgba(0,0,0,0.1)), color-stop(1, rgba(0,0,0,0.4))), -webkit-gradient(linear, right top, left top, color-stop(0, rgba(0,0,0,0.1)), color-stop(0.05, rgba(0,0,0,0)), color-stop(0.7, rgba(0,0,0,0)), color-stop(0.9, rgba(0,0,0,0.1)), color-stop(1, rgba(0,0,0,0.4)))
|
60
|
+
:color rgba(0,0,0,1)
|
61
|
+
+box-shadow(3px 3px 3px rgb(255,255,255))
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
html
|
68
|
+
padding: 0
|
69
|
+
background: white
|
70
|
+
|
71
|
+
body
|
72
|
+
text-align: center
|
73
|
+
overflow: hidden
|
74
|
+
padding: 0
|
75
|
+
margin: 0
|
76
|
+
width: 100%
|
77
|
+
+clearfix
|
78
|
+
min-height: 500px
|
79
|
+
height: 100%
|
80
|
+
background-color: white
|
81
|
+
background-image: -webkit-gradient(linear,left top, left bottom, color-stop(0, rgb(230,230,230)), color-stop(1, rgb(255,255,255)))
|
82
|
+
background-image: -moz-linear-gradient(center bottom, rgb(255,255,255) 0%, rgb(230,230,230) 100%)
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
h1, textarea, #output
|
87
|
+
+border_radius(5px)
|
88
|
+
:text-shadow 1px 1px 2px white
|
89
|
+
+box_shadow(2px 2px 5px rgba(255,255,255,1))
|
90
|
+
:border 1px solid rgba(0,0,0,0.1)
|
91
|
+
bottom: none
|
92
|
+
right: none
|
93
|
+
|
94
|
+
|
95
|
+
h1
|
96
|
+
:background-color rgba(0,0,0,0.03)
|
97
|
+
+clearfix
|
98
|
+
font: 60px 'AnonymousProRegular', Arial, sans-serif
|
99
|
+
letter-spacing: 0
|
100
|
+
text-align: center
|
101
|
+
margin: 30px auto 15px
|
102
|
+
padding: 15px 25px
|
103
|
+
display: inline-block
|
104
|
+
+border_radius(10px)
|
105
|
+
:border-color rgba(0,0,0,0.2)
|
106
|
+
color: rgba(0,0,0,0.4)
|
107
|
+
background-image: -webkit-gradient(linear,left top, left bottom, color-stop(0, rgba(0,0,0,0.1)), color-stop(0.05, rgba(0,0,0,0.01)), color-stop(0.1, rgba(0,0,0,0.0))), -webkit-gradient(linear,left top, right top, color-stop(0, rgba(0,0,0,0.1)), color-stop(0.01, rgba(0,0,0,0.01)), color-stop(0.05, rgba(0,0,0,0.0)))
|
108
|
+
background-image: -moz-linear-gradient(center bottom, rgba(230,230,230, 0) 0%, rgba(255,255,255, 0.5) 10%)
|
109
|
+
|
110
|
+
h2
|
111
|
+
font: 30px 'AnonymousProRegular', Arial, sans-serif
|
112
|
+
letter-spacing: 0
|
113
|
+
margin: 10px 0
|
114
|
+
text-align: center
|
115
|
+
color: rgba(0,0,0,0.5)
|
116
|
+
:text-shadow 0 1px 1px white
|
117
|
+
|
118
|
+
|
119
|
+
textarea, #output
|
120
|
+
:background-color rgba(0,0,0,0.05)
|
121
|
+
+border_radius(5px)
|
122
|
+
:letter-spacing 2px
|
123
|
+
:text-align left
|
124
|
+
font: 16px 'AnonymousProRegular', Arial, sans-serif
|
125
|
+
:font-weight normal
|
126
|
+
:text-shadow 0 1px 0 white
|
127
|
+
:width 85%
|
128
|
+
:margin auto
|
129
|
+
:height 300px
|
130
|
+
:display block
|
131
|
+
:padding 20px
|
132
|
+
:resize none
|
133
|
+
|
134
|
+
#output
|
135
|
+
:overflow auto
|
136
|
+
:margin-left 0
|
137
|
+
&.error
|
138
|
+
:font-size 10px
|
139
|
+
:color rgba(200,0,0,0.75)
|
140
|
+
&:first-line
|
141
|
+
:font-size 18px
|
142
|
+
:color rgba(200,0,0,0.85)
|
143
|
+
|
144
|
+
#left, #right
|
145
|
+
:width 50%
|
146
|
+
:margin 0
|
147
|
+
:float left
|
148
|
+
:display block
|
149
|
+
:padding 0
|
150
|
+
|
151
|
+
textarea:focus
|
152
|
+
outline: none
|
153
|
+
|
154
|
+
|
155
|
+
.example
|
156
|
+
:display none
|
Binary file
|