tres 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +67 -0
- data/README.md +50 -0
- data/Rakefile +16 -0
- data/VERSION +1 -0
- data/bin/tres +103 -0
- data/examples/anagen/anagen.coffee +61 -0
- data/examples/anagen/anagen.css +1413 -0
- data/examples/anagen/anagen.js +182 -0
- data/examples/anagen/anagen.scss +20 -0
- data/examples/anagen/backbone-min.js +38 -0
- data/examples/anagen/index.html +50 -0
- data/examples/anagen/jquery-1.8.0.min.js +2 -0
- data/examples/anagen/templates.coffee +6 -0
- data/examples/anagen/templates.js +13 -0
- data/examples/anagen/tres.js +375 -0
- data/examples/anagen/underscore-min.js +32 -0
- data/font/fontawesome-webfont.eot +0 -0
- data/font/fontawesome-webfont.svg +255 -0
- data/font/fontawesome-webfont.ttf +0 -0
- data/font/fontawesome-webfont.woff +0 -0
- data/javascripts/backbone-min.js +38 -0
- data/javascripts/jquery-1.8.0.min.js +2 -0
- data/javascripts/tres.coffee +210 -0
- data/javascripts/underscore-min.js +32 -0
- data/lib/ext/.filemethods.rb.swp +0 -0
- data/lib/ext/filemethods.rb +109 -0
- data/lib/ext/string.rb +33 -0
- data/lib/tres/app.rb +92 -0
- data/lib/tres/asset_packager.rb +45 -0
- data/lib/tres/errors.rb +6 -0
- data/lib/tres/logger.rb +9 -0
- data/lib/tres/rack_logger.rb +37 -0
- data/lib/tres/server.rb +50 -0
- data/lib/tres/template_compiler.rb +113 -0
- data/lib/tres.rb +64 -0
- data/sass/font-awesome.scss +329 -0
- data/sass/tres/base.scss +131 -0
- data/sass/tres/themes/default.scss +71 -0
- data/spec/app_spec.rb +44 -0
- data/spec/asset_packager_spec.rb +74 -0
- data/spec/filemethods_spec.rb +84 -0
- data/spec/fixtures/index.haml +41 -0
- data/spec/fixtures/index.html +50 -0
- data/spec/sample/assets/javascripts/all.coffee +12 -0
- data/spec/sample/assets/javascripts/anagen.coffee +7 -0
- data/spec/sample/assets/javascripts/backbone-min.js +38 -0
- data/spec/sample/assets/javascripts/jquery-1.8.0.min.js +2 -0
- data/spec/sample/assets/javascripts/underscore-min.js +32 -0
- data/spec/sample/assets/stylesheets/app.scss +7 -0
- data/spec/sample/assets/stylesheets/with_imports.scss +10 -0
- data/spec/sample/templates/article.html +0 -0
- data/spec/sample/templates/book.haml +4 -0
- data/spec/sample/templates/books/li.haml +2 -0
- data/spec/sample/templates/index.html +50 -0
- data/spec/server_spec.rb +35 -0
- data/spec/spec_helper.rb +69 -0
- data/spec/template_compiler_spec.rb +96 -0
- data/templates/all.coffee +21 -0
- data/templates/all.scss +11 -0
- data/templates/app.coffee +10 -0
- data/templates/collection_script.coffee.erb +6 -0
- data/templates/config.ru +3 -0
- data/templates/home.coffee +7 -0
- data/templates/home.haml +17 -0
- data/templates/index.html +15 -0
- data/templates/model_script.coffee.erb +3 -0
- data/templates/screen_script.coffee.erb +5 -0
- data/templates/templates.js +2 -0
- data/tres.gemspec +29 -0
- metadata +257 -0
@@ -0,0 +1,329 @@
|
|
1
|
+
/* Font Awesome
|
2
|
+
the iconic font designed for use with Twitter Bootstrap
|
3
|
+
-------------------------------------------------------
|
4
|
+
The full suite of pictographic icons, examples, and documentation
|
5
|
+
can be found at: http://fortawesome.github.com/Font-Awesome/
|
6
|
+
|
7
|
+
License
|
8
|
+
-------------------------------------------------------
|
9
|
+
The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0:
|
10
|
+
http://creativecommons.org/licenses/by/3.0/ A mention of
|
11
|
+
'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable
|
12
|
+
source code is considered acceptable attribution (most common on the web).
|
13
|
+
If human readable source code is not available to the end user, a mention in
|
14
|
+
an 'About' or 'Credits' screen is considered acceptable (most common in desktop
|
15
|
+
or mobile software).
|
16
|
+
|
17
|
+
Contact
|
18
|
+
-------------------------------------------------------
|
19
|
+
Email: dave@davegandy.com
|
20
|
+
Twitter: http://twitter.com/fortaweso_me
|
21
|
+
Work: Lead Product Designer @ http://kyruus.com
|
22
|
+
|
23
|
+
*/
|
24
|
+
|
25
|
+
@import "compass/css3/font-face";
|
26
|
+
$fontAwesomePath: "/font/fontawesome-webfont" !default;
|
27
|
+
|
28
|
+
@include font-face(
|
29
|
+
'FontAwesome',
|
30
|
+
font-files(
|
31
|
+
"#{$fontAwesomePath}.woff", woff,
|
32
|
+
"#{$fontAwesomePath}.ttf", truetype,
|
33
|
+
"#{$fontAwesomePath}.svg#FontAwesomeRegular", svg),
|
34
|
+
'#{$fontAwesomePath}.eot',
|
35
|
+
normal,
|
36
|
+
normal);
|
37
|
+
|
38
|
+
/* Font Awesome styles
|
39
|
+
------------------------------------------------------- */
|
40
|
+
[class^="icon-"]:before,
|
41
|
+
[class*=" icon-"]:before {
|
42
|
+
font-family: FontAwesome;
|
43
|
+
font-weight: normal;
|
44
|
+
font-style: normal;
|
45
|
+
display: inline-block;
|
46
|
+
text-decoration: inherit;
|
47
|
+
}
|
48
|
+
|
49
|
+
a [class^="icon-"],
|
50
|
+
a [class*=" icon-"] {
|
51
|
+
display: inline-block;
|
52
|
+
text-decoration: inherit;
|
53
|
+
}
|
54
|
+
|
55
|
+
/* makes the font 33% larger relative to the icon container */
|
56
|
+
.icon-large:before {
|
57
|
+
vertical-align: middle;
|
58
|
+
font-size: 4/3em;
|
59
|
+
}
|
60
|
+
|
61
|
+
.btn, .nav-tabs {
|
62
|
+
[class^="icon-"],
|
63
|
+
[class*=" icon-"] {
|
64
|
+
/* keeps button heights with and without icons the same */
|
65
|
+
line-height: .9em;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
li {
|
70
|
+
[class^="icon-"],
|
71
|
+
[class*=" icon-"] {
|
72
|
+
display: inline-block;
|
73
|
+
width: 1.25em;
|
74
|
+
text-align: center;
|
75
|
+
}
|
76
|
+
.icon-large:before,
|
77
|
+
.icon-large:before {
|
78
|
+
/* 1.5 increased font size for icon-large * 1.25 width */
|
79
|
+
width: 1.5*1.25em;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
ul.icons {
|
84
|
+
list-style-type: none;
|
85
|
+
margin-left: 2em;
|
86
|
+
text-indent: -.8em;
|
87
|
+
|
88
|
+
li {
|
89
|
+
[class^="icon-"],
|
90
|
+
[class*=" icon-"] {
|
91
|
+
width: .8em;
|
92
|
+
}
|
93
|
+
.icon-large:before,
|
94
|
+
.icon-large:before {
|
95
|
+
/* 1.5 increased font size for icon-large * 1.25 width */
|
96
|
+
vertical-align: initial;
|
97
|
+
// width: 1.5*1.25em;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
|
103
|
+
readers do not read off random characters that represent icons */
|
104
|
+
.icon-glass:before { content: "\f000"; }
|
105
|
+
.icon-music:before { content: "\f001"; }
|
106
|
+
.icon-search:before { content: "\f002"; }
|
107
|
+
.icon-envelope:before { content: "\f003"; }
|
108
|
+
.icon-heart:before { content: "\f004"; }
|
109
|
+
.icon-star:before { content: "\f005"; }
|
110
|
+
.icon-star-empty:before { content: "\f006"; }
|
111
|
+
.icon-user:before { content: "\f007"; }
|
112
|
+
.icon-film:before { content: "\f008"; }
|
113
|
+
.icon-th-large:before { content: "\f009"; }
|
114
|
+
.icon-th:before { content: "\f00a"; }
|
115
|
+
.icon-th-list:before { content: "\f00b"; }
|
116
|
+
.icon-ok:before { content: "\f00c"; }
|
117
|
+
.icon-remove:before { content: "\f00d"; }
|
118
|
+
.icon-zoom-in:before { content: "\f00e"; }
|
119
|
+
|
120
|
+
.icon-zoom-out:before { content: "\f010"; }
|
121
|
+
.icon-off:before { content: "\f011"; }
|
122
|
+
.icon-signal:before { content: "\f012"; }
|
123
|
+
.icon-cog:before { content: "\f013"; }
|
124
|
+
.icon-trash:before { content: "\f014"; }
|
125
|
+
.icon-home:before { content: "\f015"; }
|
126
|
+
.icon-file:before { content: "\f016"; }
|
127
|
+
.icon-time:before { content: "\f017"; }
|
128
|
+
.icon-road:before { content: "\f018"; }
|
129
|
+
.icon-download-alt:before { content: "\f019"; }
|
130
|
+
.icon-download:before { content: "\f01a"; }
|
131
|
+
.icon-upload:before { content: "\f01b"; }
|
132
|
+
.icon-inbox:before { content: "\f01c"; }
|
133
|
+
.icon-play-circle:before { content: "\f01d"; }
|
134
|
+
.icon-repeat:before { content: "\f01e"; }
|
135
|
+
|
136
|
+
/* \f020 doesn't work in Safari. all shifted one down */
|
137
|
+
.icon-refresh:before { content: "\f021"; }
|
138
|
+
.icon-list-alt:before { content: "\f022"; }
|
139
|
+
.icon-lock:before { content: "\f023"; }
|
140
|
+
.icon-flag:before { content: "\f024"; }
|
141
|
+
.icon-headphones:before { content: "\f025"; }
|
142
|
+
.icon-volume-off:before { content: "\f026"; }
|
143
|
+
.icon-volume-down:before { content: "\f027"; }
|
144
|
+
.icon-volume-up:before { content: "\f028"; }
|
145
|
+
.icon-qrcode:before { content: "\f029"; }
|
146
|
+
.icon-barcode:before { content: "\f02a"; }
|
147
|
+
.icon-tag:before { content: "\f02b"; }
|
148
|
+
.icon-tags:before { content: "\f02c"; }
|
149
|
+
.icon-book:before { content: "\f02d"; }
|
150
|
+
.icon-bookmark:before { content: "\f02e"; }
|
151
|
+
.icon-print:before { content: "\f02f"; }
|
152
|
+
|
153
|
+
.icon-camera:before { content: "\f030"; }
|
154
|
+
.icon-font:before { content: "\f031"; }
|
155
|
+
.icon-bold:before { content: "\f032"; }
|
156
|
+
.icon-italic:before { content: "\f033"; }
|
157
|
+
.icon-text-height:before { content: "\f034"; }
|
158
|
+
.icon-text-width:before { content: "\f035"; }
|
159
|
+
.icon-align-left:before { content: "\f036"; }
|
160
|
+
.icon-align-center:before { content: "\f037"; }
|
161
|
+
.icon-align-right:before { content: "\f038"; }
|
162
|
+
.icon-align-justify:before { content: "\f039"; }
|
163
|
+
.icon-list:before { content: "\f03a"; }
|
164
|
+
.icon-indent-left:before { content: "\f03b"; }
|
165
|
+
.icon-indent-right:before { content: "\f03c"; }
|
166
|
+
.icon-facetime-video:before { content: "\f03d"; }
|
167
|
+
.icon-picture:before { content: "\f03e"; }
|
168
|
+
|
169
|
+
.icon-pencil:before { content: "\f040"; }
|
170
|
+
.icon-map-marker:before { content: "\f041"; }
|
171
|
+
.icon-adjust:before { content: "\f042"; }
|
172
|
+
.icon-tint:before { content: "\f043"; }
|
173
|
+
.icon-edit:before { content: "\f044"; }
|
174
|
+
.icon-share:before { content: "\f045"; }
|
175
|
+
.icon-check:before { content: "\f046"; }
|
176
|
+
.icon-move:before { content: "\f047"; }
|
177
|
+
.icon-step-backward:before { content: "\f048"; }
|
178
|
+
.icon-fast-backward:before { content: "\f049"; }
|
179
|
+
.icon-backward:before { content: "\f04a"; }
|
180
|
+
.icon-play:before { content: "\f04b"; }
|
181
|
+
.icon-pause:before { content: "\f04c"; }
|
182
|
+
.icon-stop:before { content: "\f04d"; }
|
183
|
+
.icon-forward:before { content: "\f04e"; }
|
184
|
+
|
185
|
+
.icon-fast-forward:before { content: "\f050"; }
|
186
|
+
.icon-step-forward:before { content: "\f051"; }
|
187
|
+
.icon-eject:before { content: "\f052"; }
|
188
|
+
.icon-chevron-left:before { content: "\f053"; }
|
189
|
+
.icon-chevron-right:before { content: "\f054"; }
|
190
|
+
.icon-plus-sign:before { content: "\f055"; }
|
191
|
+
.icon-minus-sign:before { content: "\f056"; }
|
192
|
+
.icon-remove-sign:before { content: "\f057"; }
|
193
|
+
.icon-ok-sign:before { content: "\f058"; }
|
194
|
+
.icon-question-sign:before { content: "\f059"; }
|
195
|
+
.icon-info-sign:before { content: "\f05a"; }
|
196
|
+
.icon-screenshot:before { content: "\f05b"; }
|
197
|
+
.icon-remove-circle:before { content: "\f05c"; }
|
198
|
+
.icon-ok-circle:before { content: "\f05d"; }
|
199
|
+
.icon-ban-circle:before { content: "\f05e"; }
|
200
|
+
|
201
|
+
.icon-arrow-left:before { content: "\f060"; }
|
202
|
+
.icon-arrow-right:before { content: "\f061"; }
|
203
|
+
.icon-arrow-up:before { content: "\f062"; }
|
204
|
+
.icon-arrow-down:before { content: "\f063"; }
|
205
|
+
.icon-share-alt:before { content: "\f064"; }
|
206
|
+
.icon-resize-full:before { content: "\f065"; }
|
207
|
+
.icon-resize-small:before { content: "\f066"; }
|
208
|
+
.icon-plus:before { content: "\f067"; }
|
209
|
+
.icon-minus:before { content: "\f068"; }
|
210
|
+
.icon-asterisk:before { content: "\f069"; }
|
211
|
+
.icon-exclamation-sign:before { content: "\f06a"; }
|
212
|
+
.icon-gift:before { content: "\f06b"; }
|
213
|
+
.icon-leaf:before { content: "\f06c"; }
|
214
|
+
.icon-fire:before { content: "\f06d"; }
|
215
|
+
.icon-eye-open:before { content: "\f06e"; }
|
216
|
+
|
217
|
+
.icon-eye-close:before { content: "\f070"; }
|
218
|
+
.icon-warning-sign:before { content: "\f071"; }
|
219
|
+
.icon-plane:before { content: "\f072"; }
|
220
|
+
.icon-calendar:before { content: "\f073"; }
|
221
|
+
.icon-random:before { content: "\f074"; }
|
222
|
+
.icon-comment:before { content: "\f075"; }
|
223
|
+
.icon-magnet:before { content: "\f076"; }
|
224
|
+
.icon-chevron-up:before { content: "\f077"; }
|
225
|
+
.icon-chevron-down:before { content: "\f078"; }
|
226
|
+
.icon-retweet:before { content: "\f079"; }
|
227
|
+
.icon-shopping-cart:before { content: "\f07a"; }
|
228
|
+
.icon-folder-close:before { content: "\f07b"; }
|
229
|
+
.icon-folder-open:before { content: "\f07c"; }
|
230
|
+
.icon-resize-vertical:before { content: "\f07d"; }
|
231
|
+
.icon-resize-horizontal:before { content: "\f07e"; }
|
232
|
+
|
233
|
+
.icon-bar-chart:before { content: "\f080"; }
|
234
|
+
.icon-twitter-sign:before { content: "\f081"; }
|
235
|
+
.icon-facebook-sign:before { content: "\f082"; }
|
236
|
+
.icon-camera-retro:before { content: "\f083"; }
|
237
|
+
.icon-key:before { content: "\f084"; }
|
238
|
+
.icon-cogs:before { content: "\f085"; }
|
239
|
+
.icon-comments:before { content: "\f086"; }
|
240
|
+
.icon-thumbs-up:before { content: "\f087"; }
|
241
|
+
.icon-thumbs-down:before { content: "\f088"; }
|
242
|
+
.icon-star-half:before { content: "\f089"; }
|
243
|
+
.icon-heart-empty:before { content: "\f08a"; }
|
244
|
+
.icon-signout:before { content: "\f08b"; }
|
245
|
+
.icon-linkedin-sign:before { content: "\f08c"; }
|
246
|
+
.icon-pushpin:before { content: "\f08d"; }
|
247
|
+
.icon-external-link:before { content: "\f08e"; }
|
248
|
+
|
249
|
+
.icon-signin:before { content: "\f090"; }
|
250
|
+
.icon-trophy:before { content: "\f091"; }
|
251
|
+
.icon-github-sign:before { content: "\f092"; }
|
252
|
+
.icon-upload-alt:before { content: "\f093"; }
|
253
|
+
.icon-lemon:before { content: "\f094"; }
|
254
|
+
.icon-phone:before { content: "\f095"; }
|
255
|
+
.icon-check-empty:before { content: "\f096"; }
|
256
|
+
.icon-bookmark-empty:before { content: "\f097"; }
|
257
|
+
.icon-phone-sign:before { content: "\f098"; }
|
258
|
+
.icon-twitter:before { content: "\f099"; }
|
259
|
+
.icon-facebook:before { content: "\f09a"; }
|
260
|
+
.icon-github:before { content: "\f09b"; }
|
261
|
+
.icon-unlock:before { content: "\f09c"; }
|
262
|
+
.icon-credit-card:before { content: "\f09d"; }
|
263
|
+
.icon-rss:before { content: "\f09e"; }
|
264
|
+
|
265
|
+
.icon-hdd:before { content: "\f0a0"; }
|
266
|
+
.icon-bullhorn:before { content: "\f0a1"; }
|
267
|
+
.icon-bell:before { content: "\f0a2"; }
|
268
|
+
.icon-certificate:before { content: "\f0a3"; }
|
269
|
+
.icon-hand-right:before { content: "\f0a4"; }
|
270
|
+
.icon-hand-left:before { content: "\f0a5"; }
|
271
|
+
.icon-hand-up:before { content: "\f0a6"; }
|
272
|
+
.icon-hand-down:before { content: "\f0a7"; }
|
273
|
+
.icon-circle-arrow-left:before { content: "\f0a8"; }
|
274
|
+
.icon-circle-arrow-right:before { content: "\f0a9"; }
|
275
|
+
.icon-circle-arrow-up:before { content: "\f0aa"; }
|
276
|
+
.icon-circle-arrow-down:before { content: "\f0ab"; }
|
277
|
+
.icon-globe:before { content: "\f0ac"; }
|
278
|
+
.icon-wrench:before { content: "\f0ad"; }
|
279
|
+
.icon-tasks:before { content: "\f0ae"; }
|
280
|
+
|
281
|
+
.icon-filter:before { content: "\f0b0"; }
|
282
|
+
.icon-briefcase:before { content: "\f0b1"; }
|
283
|
+
.icon-fullscreen:before { content: "\f0b2"; }
|
284
|
+
|
285
|
+
.icon-group:before { content: "\f0c0"; }
|
286
|
+
.icon-link:before { content: "\f0c1"; }
|
287
|
+
.icon-cloud:before { content: "\f0c2"; }
|
288
|
+
.icon-beaker:before { content: "\f0c3"; }
|
289
|
+
.icon-cut:before { content: "\f0c4"; }
|
290
|
+
.icon-copy:before { content: "\f0c5"; }
|
291
|
+
.icon-paper-clip:before { content: "\f0c6"; }
|
292
|
+
.icon-save:before { content: "\f0c7"; }
|
293
|
+
.icon-sign-blank:before { content: "\f0c8"; }
|
294
|
+
.icon-reorder:before { content: "\f0c9"; }
|
295
|
+
.icon-list-ul:before { content: "\f0ca"; }
|
296
|
+
.icon-list-ol:before { content: "\f0cb"; }
|
297
|
+
.icon-strikethrough:before { content: "\f0cc"; }
|
298
|
+
.icon-underline:before { content: "\f0cd"; }
|
299
|
+
.icon-table:before { content: "\f0ce"; }
|
300
|
+
|
301
|
+
.icon-magic:before { content: "\f0d0"; }
|
302
|
+
.icon-truck:before { content: "\f0d1"; }
|
303
|
+
.icon-pinterest:before { content: "\f0d2"; }
|
304
|
+
.icon-pinterest-sign:before { content: "\f0d3"; }
|
305
|
+
.icon-google-plus-sign:before { content: "\f0d4"; }
|
306
|
+
.icon-google-plus:before { content: "\f0d5"; }
|
307
|
+
.icon-money:before { content: "\f0d6"; }
|
308
|
+
.icon-caret-down:before { content: "\f0d7"; }
|
309
|
+
.icon-caret-up:before { content: "\f0d8"; }
|
310
|
+
.icon-caret-left:before { content: "\f0d9"; }
|
311
|
+
.icon-caret-right:before { content: "\f0da"; }
|
312
|
+
.icon-columns:before { content: "\f0db"; }
|
313
|
+
.icon-sort:before { content: "\f0dc"; }
|
314
|
+
.icon-sort-down:before { content: "\f0dd"; }
|
315
|
+
.icon-sort-up:before { content: "\f0de"; }
|
316
|
+
|
317
|
+
.icon-envelope-alt:before { content: "\f0e0"; }
|
318
|
+
.icon-linkedin:before { content: "\f0e1"; }
|
319
|
+
.icon-undo:before { content: "\f0e2"; }
|
320
|
+
.icon-legal:before { content: "\f0e3"; }
|
321
|
+
.icon-dashboard:before { content: "\f0e4"; }
|
322
|
+
.icon-comment-alt:before { content: "\f0e5"; }
|
323
|
+
.icon-comments-alt:before { content: "\f0e6"; }
|
324
|
+
.icon-bolt:before { content: "\f0e7"; }
|
325
|
+
.icon-sitemap:before { content: "\f0e8"; }
|
326
|
+
.icon-umbrella:before { content: "\f0e9"; }
|
327
|
+
.icon-paste:before { content: "\f0ea"; }
|
328
|
+
|
329
|
+
.icon-user-md:before { content: "\f200"; }
|
data/sass/tres/base.scss
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
@import 'font-awesome';
|
2
|
+
|
3
|
+
// Quick FontAwesome fix so icons push the sentence
|
4
|
+
// a bit to the right
|
5
|
+
[class^="icon-"]:before { margin-right : .5rem }
|
6
|
+
|
7
|
+
* {
|
8
|
+
margin : 0;
|
9
|
+
padding : 0;
|
10
|
+
outline : 0;
|
11
|
+
border : 0;
|
12
|
+
-webkit-box-sizing : border-box
|
13
|
+
}
|
14
|
+
|
15
|
+
ul { list-style : none }
|
16
|
+
input, button, textarea { font-size : 100% }
|
17
|
+
|
18
|
+
html { height : 100%; min-height : 420px; font-size : 62.5%; overflow-x : hidden }
|
19
|
+
html, body { height : 99.9% }
|
20
|
+
body {
|
21
|
+
font-size : 1.5rem;
|
22
|
+
line-height : 2.3rem;
|
23
|
+
width : 100%;
|
24
|
+
-webkit-perspective : 800;
|
25
|
+
-webkit-text-size-adjust : none;
|
26
|
+
-webkit-transform-style : preserve-3d;
|
27
|
+
-webkit-user-select : none;
|
28
|
+
}
|
29
|
+
|
30
|
+
// A base section unit. Think of this as a "screen".
|
31
|
+
body > section {
|
32
|
+
display : block;
|
33
|
+
position : absolute;
|
34
|
+
padding : 1.6rem 0;
|
35
|
+
top : 0;
|
36
|
+
left : 0;
|
37
|
+
width : 100%;
|
38
|
+
opacity : 0;
|
39
|
+
overflow : auto;
|
40
|
+
overflow-x : hidden;
|
41
|
+
pointer-events : none;
|
42
|
+
-webkit-transition : all 0.25s ease-in-out;
|
43
|
+
-webkit-transform-style : preserve-3d;
|
44
|
+
-webkit-transform : translate3d(100%,0%,0);
|
45
|
+
&>*:not(header) {
|
46
|
+
margin-left : 1rem !important;
|
47
|
+
margin-right : 1rem !important;
|
48
|
+
}
|
49
|
+
&.current {
|
50
|
+
opacity : 1;
|
51
|
+
pointer-events : auto;
|
52
|
+
-webkit-transform : translate3d(0%,0%, 0)
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
// Floating header, header stuffs
|
57
|
+
body > section > header {
|
58
|
+
margin : 0;
|
59
|
+
text-align : center;
|
60
|
+
&.fixed {
|
61
|
+
position : fixed;
|
62
|
+
top : 0;
|
63
|
+
left : 0;
|
64
|
+
width : 100%;
|
65
|
+
z-index : 10000
|
66
|
+
}
|
67
|
+
& + * { margin-top : 4.6rem !important }
|
68
|
+
h1 {
|
69
|
+
font-size : 1.9rem;
|
70
|
+
margin : 0.9rem 0;
|
71
|
+
white-space : nowrap
|
72
|
+
}
|
73
|
+
a {
|
74
|
+
position : absolute;
|
75
|
+
font-size : 1.9rem;
|
76
|
+
margin-top : 0.9rem;
|
77
|
+
text-decoration : none;
|
78
|
+
&.left { left : 1.6rem }
|
79
|
+
&.right { right : 1.6rem }
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
// Type margins and sizes
|
84
|
+
body > section {
|
85
|
+
h1 { font-size: 2.9rem; margin-bottom : 1.6rem }
|
86
|
+
h2 { font-size: 2.6rem; margin: 1.3rem 0 }
|
87
|
+
p, input, textarea, button, li { font-size : 1.8rem }
|
88
|
+
p { margin : 0.9rem 0 }
|
89
|
+
}
|
90
|
+
|
91
|
+
form {
|
92
|
+
margin : 1.3rem 0;
|
93
|
+
label {
|
94
|
+
display : block;
|
95
|
+
margin : 0.25em 0;
|
96
|
+
font-weight : bold;
|
97
|
+
}
|
98
|
+
input, textarea {
|
99
|
+
display : block;
|
100
|
+
padding : 0.9rem;
|
101
|
+
width : 100%;
|
102
|
+
font-family : inherit;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
ul.common {
|
107
|
+
li {
|
108
|
+
padding : 0.9rem;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
// Rules for opting-in
|
113
|
+
.t-centered { text-align : center }
|
114
|
+
.t-padded-top { padding-top : 5rem }
|
115
|
+
.t-left-align { text-align : left }
|
116
|
+
h1.t-bigger { font-size : 3.9rem }
|
117
|
+
|
118
|
+
|
119
|
+
#notifications {
|
120
|
+
position : fixed;
|
121
|
+
right : 0;
|
122
|
+
bottom : 0;
|
123
|
+
left : 0;
|
124
|
+
li {
|
125
|
+
display : none;
|
126
|
+
padding : 0.6rem 1rem;
|
127
|
+
font-weight : bold;
|
128
|
+
font-size : 1.6rem;
|
129
|
+
&:before { margin-right : 1rem }
|
130
|
+
}
|
131
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
@import 'compass/css3/border-radius';
|
2
|
+
@import 'compass/css3/images';
|
3
|
+
@import 'compass/css3/box-shadow';
|
4
|
+
|
5
|
+
$hot : #d5253e;
|
6
|
+
$body-background : #f8f8f8;
|
7
|
+
$default-text-color : black;
|
8
|
+
$header-background : $hot;
|
9
|
+
$header-text : white;
|
10
|
+
$list-border : rgba(black,.75);
|
11
|
+
$list-text : black;
|
12
|
+
$list-background : white;
|
13
|
+
$link-color : $hot;
|
14
|
+
$textfield-background : -webkit-gradient(linear, 0% 0%, 0% 18%, from(#efefef), to(#FFFFFF));
|
15
|
+
$button-background : -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F5D201), to(#f5a101));
|
16
|
+
$notifications-background : rgba(0,0,0,.9);
|
17
|
+
$notifications-color : white;
|
18
|
+
$headings-color : $hot;
|
19
|
+
|
20
|
+
body {
|
21
|
+
background : $body-background;
|
22
|
+
color : $default-text-color;
|
23
|
+
font-family : 'PT Sans Narrow', 'Helvetica Neue';
|
24
|
+
}
|
25
|
+
|
26
|
+
body > section > header {
|
27
|
+
@include box-shadow(0 0 0.25rem rgba(black,.75));
|
28
|
+
background : $header-background;
|
29
|
+
h1 {
|
30
|
+
color : $header-text;
|
31
|
+
text-transform : uppercase;
|
32
|
+
text-align : center;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
// General text colours
|
37
|
+
a { color : $link-color }
|
38
|
+
h1, h2 { color : $headings-color }
|
39
|
+
|
40
|
+
// Constructs
|
41
|
+
ul.common {
|
42
|
+
@include border-radius(0.6rem);
|
43
|
+
@include box-shadow(0 0 0.25rem rgba(black,.75));
|
44
|
+
color : $list-text;
|
45
|
+
background : transparent;
|
46
|
+
li {
|
47
|
+
border-top : 1px solid lighten($list-border, 75%);
|
48
|
+
font-weight : bold;
|
49
|
+
background : $list-background;
|
50
|
+
&:first-child {
|
51
|
+
@include border-top-right-radius(0.6rem);
|
52
|
+
@include border-top-left-radius(0.6rem);
|
53
|
+
border-top: 0
|
54
|
+
}
|
55
|
+
&:last-child {
|
56
|
+
@include border-bottom-right-radius(0.6rem);
|
57
|
+
@include border-bottom-left-radius(0.6rem);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
input {
|
63
|
+
@include box-shadow(0 0 0.25rem rgba(black,.75));
|
64
|
+
@include border-radius(0.3rem);
|
65
|
+
background : $textfield-background;
|
66
|
+
}
|
67
|
+
|
68
|
+
#notifications {
|
69
|
+
background : $notifications-background;
|
70
|
+
color : $notifications-color
|
71
|
+
}
|
data/spec/app_spec.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe Tres::App do
|
4
|
+
before do
|
5
|
+
FileUtils.rm_rf TMP/'temp'
|
6
|
+
@app = Tres::App.new TMP/'temp'
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'opens an existing app with Tres::All.open' do
|
10
|
+
stub_listener!
|
11
|
+
an_app = Tres::App.open TMP/'temp'
|
12
|
+
an_app.should be_a Tres::App
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'creating a new app' do
|
16
|
+
before { stub_listener! }
|
17
|
+
|
18
|
+
it "creates a folder for the app on" do
|
19
|
+
File.directory?(TMP/'temp').should be_true
|
20
|
+
end
|
21
|
+
|
22
|
+
it "creates a assets folder with scripts and styles in it" do
|
23
|
+
File.directory?(TMP/'temp'/'assets').should be_true
|
24
|
+
File.directory?(TMP/'temp'/'assets'/'stylesheets').should be_true
|
25
|
+
File.directory?(TMP/'temp'/'assets'/'javascripts').should be_true
|
26
|
+
end
|
27
|
+
|
28
|
+
it "creates a build folder in the app's folder" do
|
29
|
+
File.directory?(TMP/'temp'/'build').should be_true
|
30
|
+
end
|
31
|
+
|
32
|
+
it "creates an asset packager" do
|
33
|
+
@app.asset_packager.should be_a Tres::AssetPackager
|
34
|
+
end
|
35
|
+
|
36
|
+
it "creates a template compiler" do
|
37
|
+
@app.template_compiler.should be_a Tres::TemplateCompiler
|
38
|
+
end
|
39
|
+
|
40
|
+
it "creates a listener for templates" do
|
41
|
+
@app.listeners.templates.should_not be_nil # yeah, sorta
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
+
|
3
|
+
describe Tres::AssetPackager do
|
4
|
+
before do
|
5
|
+
stub_listener!
|
6
|
+
@packager = Tres::AssetPackager.new :root => Anagen.root, :logger => MEMLOGGER
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:sprockets) { @packager.sprockets }
|
10
|
+
|
11
|
+
it "keeps a sprockets environment in .sprockets" do
|
12
|
+
sprockets.should be_a Sprockets::Environment
|
13
|
+
end
|
14
|
+
|
15
|
+
context "opening Anagen" do
|
16
|
+
it "has `anagen.js` in js/anagen.js" do
|
17
|
+
sprockets['javascripts/anagen.js'].should be_a Sprockets::BundledAsset
|
18
|
+
end
|
19
|
+
|
20
|
+
it "has `app.css` in css/app.css" do
|
21
|
+
sprockets['stylesheets/app.css'].should be_a Sprockets::BundledAsset
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context "JavaScripts require paths" do
|
26
|
+
it "should find anything under <APP ROOT>/assets/javascripts" do
|
27
|
+
sprockets['javascripts/all.js'].should be_a Sprockets::BundledAsset
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context "SASS require paths" do
|
32
|
+
it "adds Tres' own styles to the path" do
|
33
|
+
sprockets['stylesheets/with_imports.scss'].should be_a Sprockets::BundledAsset
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'compiling assets to static format' do
|
38
|
+
after { clean_build! }
|
39
|
+
|
40
|
+
it 'compiles stylesheets do the same path found in sprockets' do
|
41
|
+
@packager.compile_to_build 'stylesheets/app.css'
|
42
|
+
(Anagen.build/'stylesheets'/'app.css').contents.should == sprockets['stylesheets/app.css'].to_s
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'creating scripts' do
|
47
|
+
after { restore_anagen! }
|
48
|
+
|
49
|
+
it 'creates a new coffeescript if the extension is .coffee' do
|
50
|
+
@packager.new_script 'about.coffee'
|
51
|
+
File.exists?(Anagen.assets/'javascripts'/'about.coffee').should be_true
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'creates a new javascript if the extension is .js' do
|
55
|
+
@packager.new_script 'about.js'
|
56
|
+
File.exists?(Anagen.assets/'javascripts'/'about.js').should be_true
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'defaults to .coffee if no extension is provided' do
|
60
|
+
@packager.new_script 'about'
|
61
|
+
File.exists?(Anagen.assets/'javascripts'/'about.coffee').should be_true
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'creates the directories to a path if necessary' do
|
65
|
+
@packager.new_script 'about/index.js'
|
66
|
+
File.directory?(Anagen.assets/'javascripts'/'about').should be_true
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'raises ScriptExistsError if a script with the same path exists' do
|
70
|
+
@packager.new_script 'about/index.js'
|
71
|
+
lambda { @packager.new_script 'about/index.js' }.should raise_error(Tres::ScriptExistsError)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|