-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfireapp-workshop.html
568 lines (438 loc) · 13.7 KB
/
fireapp-workshop.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<style>
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #737373;
margin: 10px 13px 10px 13px;
}
a {
color: #0069d6;
}
a:hover {
color: #0050a3;
text-decoration: none;
}
a img {
border: none;
}
p {
margin-bottom: 9px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #404040;
line-height: 36px;
}
h1 {
margin-bottom: 18px;
font-size: 30px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 18px;
}
h4 {
font-size: 16px;
}
h5 {
font-size: 14px;
}
h6 {
font-size: 13px;
}
hr {
margin: 0 0 19px;
border: 0;
border-bottom: 1px solid #ccc;
}
blockquote {
padding: 13px 13px 21px 15px;
margin-bottom: 18px;
font-family:georgia,serif;
font-style: italic;
}
blockquote:before {
content:"\201C";
font-size:40px;
margin-left:-10px;
font-family:georgia,serif;
color:#eee;
}
blockquote p {
font-size: 14px;
font-weight: 300;
line-height: 18px;
margin-bottom: 0;
font-style: italic;
}
code, pre {
font-family: Monaco, Andale Mono, Courier New, monospace;
}
code {
background-color: #fee9cc;
color: rgba(0, 0, 0, 0.75);
padding: 1px 3px;
font-size: 12px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre {
display: block;
padding: 14px;
margin: 0 0 18px;
line-height: 16px;
font-size: 11px;
border: 1px solid #d9d9d9;
white-space: pre-wrap;
word-wrap: break-word;
}
pre code {
background-color: #fff;
color:#737373;
font-size: 11px;
padding: 0;
}
@media screen and (min-width: 768px) {
body {
width: 748px;
margin:10px auto;
}
}
</style>
<title>Fire.app Workshop</title>
</head>
<body>
<h1>Fire.app Workshop</h1>
<h3><code>p.5</code> Fire.app?</h3>
<p>Fire.app 使用說明:</p>
<p><a href="https://github.com/handlino/FireApp/wiki/Fire.app-%E4%BD%BF%E7%94%A8%E8%AA%AA%E6%98%8E">https://github.com/handlino/FireApp/wiki/Fire.app-使用說明</a></p>
<h3><code>p.6</code> Fire.app 選單介紹</h3>
<p>Extendsion 使用範例:</p>
<p><a href="https://github.com/handlino/compass-handlino">https://github.com/handlino/compass-handlino</a></p>
<h3><code>p.11</code> Fire.app 建立新專案</h3>
<ul>
<li>blueprint
<ul>
<li><a href="http://www.blueprintcss.org/">http://www.blueprintcss.org/</a></li>
<li><a href="http://compass-style.org/help/tutorials/blueprint/">http://compass-style.org/help/tutorials/blueprint/</a></li>
</ul>
</li>
<li>compass
<ul>
<li><a href="http://compass-style.org/">http://compass-style.org/</a></li>
</ul>
</li>
<li>960
<ul>
<li><a href="http://960.gs/">http://960.gs/</a></li>
<li><a href="https://github.com/nextmat/compass-960-plugin">https://github.com/nextmat/compass-960-plugin</a></li>
</ul>
</li>
<li>html5-boilerplate
<ul>
<li><a href="http://html5boilerplate.com/">http://html5boilerplate.com/</a></li>
<li><a href="https://github.com/heygrady/html5-boilerplate">https://github.com/heygrady/html5-boilerplate</a></li>
</ul>
</li>
<li>compass-h5bp
<ul>
<li><a href="http://html5boilerplate.com/">http://html5boilerplate.com/</a></li>
<li><a href="https://github.com/sporkd/compass-h5bp">https://github.com/sporkd/compass-h5bp</a></li>
</ul>
</li>
<li>bootstrap
<ul>
<li><a href="http://twitter.github.com/bootstrap/">http://twitter.github.com/bootstrap/</a></li>
<li><a href="https://github.com/thomas-mcdonald/bootstrap-sass">https://github.com/thomas-mcdonald/bootstrap-sass</a></li>
</ul>
</li>
<li>susy
<ul>
<li><a href="http://susy.oddbird.net/">http://susy.oddbird.net/</a></li>
</ul>
</li>
<li>foundation
<ul>
<li><a href="http://foundation.zurb.com/">http://foundation.zurb.com/</a></li>
<li><a href="https://github.com/zurb/foundation">https://github.com/zurb/foundation</a></li>
</ul>
</li>
<li>Fireapp Example
<ul>
<li><a href="https://github.com/handlino/fire-app-sample-project">https://github.com/handlino/fire-app-sample-project</a></li>
</ul>
</li>
</ul>
<h3><code>p.19</code> 確認頁面狀態</h3>
<p>在剛建立的專案根目錄建立檔案 <code>index.html</code></p>
<h4>index.html</h4>
<pre><code><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Fire.app Demo</title>
</head>
<body>
<h1>Hello world!</h1>
</body>
</html>
</code></pre>
<h3><code>p.36</code> Try ERB</h3>
<p>在專案資料夾中建立新檔案 screenshots.html.erb</p>
<h4>screenshots.html.erb</h4>
<pre><code><%= 2+2 %>
</code></pre>
<p><a href="http://127.0.0.1:24681/screenshots.html">http://127.0.0.1:24681/screenshots.html</a></p>
<h3><code>p.37</code> Template helper</h3>
<p>Template helper 文件:</p>
<ul>
<li><a href="https://github.com/handlino/FireApp/wiki/Template-Helpers-%28zh-tw%29">https://github.com/handlino/FireApp/wiki/Template-Helpers-%28zh-tw%29</a></li>
</ul>
<h3><code>p.46</code> 變更假資料產生方式</h3>
<p>先在 <code></body></code> 前加上產生 LiveReload 的 helper ,重新整理一次使其生效</p>
<h4>screenshots.html.erb</h4>
<pre><code><%= livereload_js %>
</code></pre>
<p>變更 header 中的 h2 內容</p>
<h4>screenshots.html.erb</h4>
<pre><code><h2><%= lorem_sentence %></h2>
</code></pre>
<p>把五則「操作畫面」的敘述刪掉四則只留下一則</p>
<h4>screenshots.html.erb</h4>
<pre><code><h2>操作畫面</h2>
<p><img src="http://placehold.it/640x360" /></p>
<p>操作畫面說明操作畫面說明操作畫面說明操作畫面說明操作畫面...</p>
</code></pre>
<h3><code>p.47</code> 變更假資料產生方式</h3>
<p>將「操作畫面」的敘述用產生假資料helper 替換如下</p>
<h4>screenshots.html.erb</h4>
<pre><code><h2><%= zh_lorem_words(4+rand(4)) %></h2>
<p><img src="<%= lorem_image("640x360") %>" /></p>
<p><%= zh_lorem_paragraph %></p>
</code></pre>
<h3><code>p.48</code> 變更假資料產生方式</h3>
<p>利用 times 包圍使該段落複製五次</p>
<h4>screenshots.html.erb</h4>
<pre><code><% 5.times do %>
<h2><%= zh_lorem_words(4+rand(4)) %></h2>
<p><img src="<%= lorem_image("640x360") %>" /></p>
<p><%= zh_lorem_paragraph %></p>
<% end %>
</code></pre>
<p>用教材中的內容替換掉頁面中原有的 <code><div class="links"></code> 和 <code><div class="footer"></code> 的部分</p>
<h4>screenshots.html.erb <code>div.links</code></h4>
<pre><code> <div class="links">
<h2>相關資訊連結</h2>
<ul>
<% 8.times do %>
<li><a href="#"><%= zh_lorem_words (5+rand(4)) %></a></li>
<% end %>
</ul>
</div>
</code></pre>
<h4>screenshots.html.erb <code>div.footer</code></h4>
<pre><code><div class="footer">
<%= lorem_sentence %>
</div>
</code></pre>
<h3><code>p.57</code> 使用 layout</h3>
<p>把 <code><div class="main"></code> 中的內容全數刪除,替換成 <code><%= yield %></code></p>
<h4>_layout.html.erb</h4>
<pre><code><div class="main">
<%= yield %>
</div>
</code></pre>
<h3><code>p.58</code> 使用 layout</h3>
<h4>screenshots.html.erb</h4>
<pre><code><% 5.times do %>
<h2><%= zh_lorem_words(4+rand(4)) %></h2>
<p><img src="<%= lorem_image("640x360") %>" /></p>
<p><%= zh_lorem_paragraph %></p>
<% end %>
</code></pre>
<h3><code>p.64</code> Partial</h3>
<p>首先將 header-wrapper 部分抽出為 partial</p>
<h4>_header.html.erb</h4>
<pre><code><div class="header-wrapper">
<div class="header">
<h1 class="logo"><a href="index.html">Fire.app</a></h1>
<h2><%= lorem_sentence %></h2>
</div>
</div>
</code></pre>
<h4>_layout.html.erb</h4>
<pre><code><%= render :partial => "header" %>
</code></pre>
<h3><code>p.65</code> Partial</h3>
<p>在 <code>_layout.html.erb</code> 中將 <code>head</code> 、 <code>main-menu</code> 和 <code>footer-wrapper</code> 部分都修改成載入已經準備好的 partial 檔案</p>
<h4>_layout.html.erb</h4>
<pre><code><!DOCTYPE html>
<html>
<head>
<%= render :partial => "head" %>
</head>
<body>
<%= render :partial => "header" %>
<%= render :partial => "main_menu" %>
<div class="main-block">
<div class="main">
<%= yield %>
</div>
<div class="side">
<div class="ad">
側欄宣傳文字
</div>
<div class="links">
<h2>相關資訊連結</h2>
<ul>
<% 8.times do %>
<li><a href="#"><%= zh_lorem_words (5+rand(4)) %></a></li>
<% end %>
</ul>
</div>
</div>
</div>
<%= render :partial => "footer" %>
<%= livereload_js %>
</body>
</html>
</code></pre>
<h3><code>p.67</code> 指定非預設的 layout 檔案</h3>
<h4>_sp_layout.html.erb</h4>
<pre><code><!DOCTYPE html>
<html>
<head>
<%= render :partial => "head" %>
</head>
<body>
<%= render :partial => "header" %>
<%= render :partial => "main_menu" %>
<div class="main-block">
<%= yield %>
</div>
<%= render :partial => "footer" %>
<%= livereload_js %>
</body>
</html>
</code></pre>
<h3><code>p.68</code> 指定非預設的 layout 檔案</h3>
<p>指定欲使用的 layout 檔案。</p>
<h4>index.html.layout</h4>
<pre><code>_sp_layout.html.erb
</code></pre>
<h3><code>p.72</code> content_for</h3>
<p>修改 <code>_layout.html.erb</code> 中 <code><div class="ad"></code> 部分的內容</p>
<h4>_layout.html.erb</h4>
<pre><code><div class="ad">
<% if content_for? :sp_ad %>
<%= yield :sp_ad %>
<% else %>
側欄宣傳文字
<% end %>
</div>
</code></pre>
<h3><code>p.73</code> content_for</h3>
<p>在 documents.html.erb 中加上</p>
<h4>documents.html.erb</h4>
<pre><code><% content_for :sp_ad do %>
需要教育訓練?<br />
請來信:<br />
<a href="#"><%= lorem_email %></a>
<% end %>
</code></pre>
<h3><code>p.76</code> Sass</h3>
<ul>
<li><a href="http://sass-lang.com/">http://sass-lang.com/</a></li>
<li><a href="http://www.codeschool.com/paths/html-css#sass">http://www.codeschool.com/paths/html-css#sass</a></li>
</ul>
<h3><code>p.83</code> Sass 基礎 - 顏色調整 function</h3>
<ul>
<li><a href="http://sassme.arc90.com/">http://sassme.arc90.com/</a></li>
</ul>
<h3><code>p.84</code> 更換 SCSS</h3>
<p>修改檔案 _head.html.erb ,將原本載入 css 的兩行程式碼換成</p>
<h4>_head.html.erb</h4>
<pre><code><link rel="stylesheet" href="/stylesheets/screen.css" type="text/css" />
</code></pre>
<h3><code>p.86</code> 插播介紹 - normalize.css</h3>
<ul>
<li><a href="http://necolas.github.com/normalize.css/">http://necolas.github.com/normalize.css/</a></li>
</ul>
<h3><code>p.87</code> 插播介紹 - normalize.css</h3>
<p>開啟 screen.scss ,在第一行加入</p>
<h4>screen.scss</h4>
<pre><code>@import "normalize";
</code></pre>
<h3><code>p.90</code> Compass</h3>
<ul>
<li><a href="http://compass-style.org/">http://compass-style.org/</a></li>
</ul>
<p>在 <code>screen.scss</code> import normalize 的下一行加上:</p>
<h4>screen.scss</h4>
<pre><code>@import "compass";
</code></pre>
<h3><code>p.92</code> 使用 logo 圖片取代文字</h3>
<p>Compass Text Replacement</p>
<ul>
<li><a href="http://compass-style.org/reference/compass/utilities/text/replacement/">http://compass-style.org/reference/compass/utilities/text/replacement/</a></li>
</ul>
<h3><code>p.95</code> Background Gradients</h3>
<p>Compass Background Gradients</p>
<ul>
<li><a href="http://compass-style.org/reference/compass/css3/images/">http://compass-style.org/reference/compass/css3/images/</a></li>
<li><a href="http://compass-style.org/examples/compass/css3/gradient/">http://compass-style.org/examples/compass/css3/gradient/</a></li>
</ul>
<h3><code>p.98</code> Sprites</h3>
<ul>
<li><a href="http://compass-style.org/reference/compass/helpers/sprites/">http://compass-style.org/reference/compass/helpers/sprites/</a></li>
<li><a href="http://compass-style.org/help/tutorials/spriting/">http://compass-style.org/help/tutorials/spriting/</a></li>
</ul>
<h3><code>p.105</code> 網站修改</h3>
<p>開啟 <code>_header.html.erb</code> ,將 <code>h1</code> 連結的內容改成 Water.app</p>
<pre><code><div class="header-wrapper">
<div class="header">
<h1 class="logo"><a href="index.html">Water.app</a></h1>
<h2><%= lorem_sentence %></h2>
</div>
</div>
</code></pre>
<h3><code>p.106</code> 網站修改</h3>
<p>開啟 <code>screen.scss</code>,將 logo 原本指定的圖片換成 <code>waterapp-logo.png</code></p>
<pre><code>h1.logo {
margin: 0;
a {
display: block;
@include replace-text-with-dimensions("waterapp-logo.png");
}
}
</code></pre>
<h3><code>p.108</code> 網站修改</h3>
<p>將 <code>screen.scss</code> 設定的主色調變數 <code>$main-color</code> 直接 invert 成它的對比色</p>
<pre><code>$main-color: invert(#ff7711);
</code></pre>
</body>
</html>