-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1640 lines (1495 loc) · 69.7 KB
/
index.html
File metadata and controls
1640 lines (1495 loc) · 69.7 KB
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
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>安裝 Claude Code 終端機版 — 手把手圖文教學(Mac)</title>
<meta name="description" content="從零開始,在 Mac 上安裝 Claude Code 終端機版的完整圖文教學。包含 Homebrew、Node.js 安裝、首次設定、寫出你的第一個網站,以及部署上線的完整流程。">
<meta name="keywords" content="Claude Code, 安裝教學, Terminal, 終端機, Mac, AI 寫程式, Anthropic, Claude, Homebrew, Node.js, Zeabur, 部署">
<meta name="author" content="Zeabur">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://claude-code-tutorial.com/">
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:title" content="安裝 Claude Code 終端機版 — 手把手圖文教學">
<meta property="og:description" content="從零開始,在 Mac 上安裝 Claude Code 終端機版。包含完整圖文步驟,即使從沒用過終端機也能輕鬆上手。">
<meta property="og:url" content="https://claude-code-tutorial.com/">
<meta property="og:site_name" content="Claude Code 安裝教學">
<meta property="og:locale" content="zh_TW">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="安裝 Claude Code 終端機版 — 手把手圖文教學">
<meta name="twitter:description" content="從零開始,在 Mac 上安裝 Claude Code 終端機版。包含完整圖文步驟,即使從沒用過終端機也能輕鬆上手。">
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FHHPJ29CZH"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-FHHPJ29CZH');
</script>
<!-- Structured Data -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "在 Mac 上安裝 Claude Code 終端機版",
"description": "從零開始,在 Mac 上安裝 Claude Code 終端機版的完整圖文教學,包含環境設定、首次啟動到部署上線。",
"inLanguage": "zh-TW",
"totalTime": "PT30M",
"step": [
{"@type": "HowToSection", "name": "安裝 Claude Code", "itemListElement": [
{"@type": "HowToStep", "name": "打開終端機", "text": "在 Mac 上按 Command + 空白鍵,搜尋 Terminal 並打開。"},
{"@type": "HowToStep", "name": "安裝 Claude Code", "text": "在終端機輸入 npm install -g @anthropic-ai/claude-code 進行安裝。"},
{"@type": "HowToStep", "name": "設定 PATH", "text": "將 npm 全域安裝路徑加入環境變數。"}
]},
{"@type": "HowToSection", "name": "安裝開發工具", "itemListElement": [
{"@type": "HowToStep", "name": "安裝 Homebrew", "text": "使用官方安裝指令安裝 macOS 套件管理器 Homebrew。"},
{"@type": "HowToStep", "name": "安裝 Node.js", "text": "透過 Homebrew 安裝 Node.js 開發環境。"}
]},
{"@type": "HowToSection", "name": "建立專案並啟動", "itemListElement": [
{"@type": "HowToStep", "name": "建立專案資料夾", "text": "使用 mkdir 指令建立專案資料夾。"},
{"@type": "HowToStep", "name": "啟動 Claude Code", "text": "進入資料夾後輸入 claude 啟動 Claude Code。"}
]},
{"@type": "HowToSection", "name": "首次設定與開始寫程式", "itemListElement": [
{"@type": "HowToStep", "name": "完成首次設定", "text": "選擇主題、登入帳號並完成初始設定。"},
{"@type": "HowToStep", "name": "開始寫程式", "text": "用自然語言告訴 Claude 你想做什麼,它會幫你寫出程式碼。"}
]},
{"@type": "HowToSection", "name": "部署上線", "itemListElement": [
{"@type": "HowToStep", "name": "部署到 Zeabur", "text": "透過 Claude Code 登入 Zeabur 並部署你的網站。"}
]}
]
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+TC:wght@400;500;600;700;900&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
--bg: #0a0a0b;
--surface: #141416;
--surface-2: #1c1c20;
--surface-3: #242429;
--border: #2a2a30;
--border-light: #3a3a42;
--text: #e8e8ed;
--text-dim: #8e8e96;
--text-muted: #5c5c64;
--accent: #d4845a;
--accent-light: #e8a87c;
--accent-glow: rgba(212, 132, 90, 0.15);
--green: #5cb886;
--green-dim: rgba(92, 184, 134, 0.12);
--blue: #5b8dd9;
--purple: #9b7bd4;
--red: #d45b5b;
--yellow: #d4c45b;
}
html { scroll-behavior: smooth; }
body {
font-family: 'Noto Sans TC', 'Inter', -apple-system, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.7;
-webkit-font-smoothing: antialiased;
}
/* ── Hero ── */
.hero {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 2rem;
position: relative;
overflow: hidden;
}
.hero::before {
content: '';
position: absolute;
top: -40%;
left: 50%;
transform: translateX(-50%);
width: 800px;
height: 800px;
background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
pointer-events: none;
}
.hero-badge {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.4rem 1rem;
border-radius: 100px;
border: 1px solid var(--border);
background: var(--surface);
font-size: 0.82rem;
color: var(--text-dim);
margin-bottom: 2rem;
letter-spacing: 0.02em;
}
.hero-badge .dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--green);
animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
0%, 100% { opacity: 1; }
50% { opacity: 0.4; }
}
.hero h1 {
font-size: clamp(2.4rem, 6vw, 4.2rem);
font-weight: 900;
line-height: 1.15;
letter-spacing: -0.03em;
margin-bottom: 1.2rem;
max-width: 700px;
}
.hero h1 .highlight {
background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.hero p {
font-size: 1.1rem;
color: var(--text-dim);
max-width: 520px;
margin-bottom: 1.5rem;
}
.hero-prereq {
max-width: 420px;
margin-bottom: 2.5rem;
text-align: left;
}
.hero-prereq-title {
font-size: 0.78rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-muted);
margin-bottom: 0.6rem;
}
.hero-prereq-item {
display: flex;
align-items: center;
gap: 0.6rem;
padding: 0.55rem 1rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
margin-bottom: 0.5rem;
font-size: 0.9rem;
color: var(--text-dim);
}
.hero-prereq-item .icon {
font-size: 1.1rem;
flex-shrink: 0;
}
.hero-cta {
display: inline-flex;
align-items: center;
gap: 0.6rem;
padding: 0.85rem 2rem;
border-radius: 12px;
background: var(--accent);
color: #fff;
font-weight: 600;
font-size: 1rem;
text-decoration: none;
transition: all 0.2s;
border: none;
cursor: pointer;
}
.hero-cta:hover {
background: var(--accent-light);
transform: translateY(-1px);
box-shadow: 0 8px 30px rgba(212, 132, 90, 0.25);
}
.hero-cta svg { width: 18px; height: 18px; }
/* ── Sticky Nav ── */
.nav {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 999;
padding: 0 2rem;
background: rgba(10, 10, 11, 0.85);
backdrop-filter: blur(20px);
border-bottom: 1px solid var(--border);
transform: translateY(-100%);
transition: transform 0.3s;
}
.nav.visible { transform: translateY(0); }
.nav-inner {
max-width: 900px;
margin: 0 auto;
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
}
.nav-title {
font-weight: 700;
font-size: 0.9rem;
color: var(--text);
}
/* ── Chapter Tabs ── */
.chapter-tabs {
max-width: 780px;
margin: 0 auto;
padding: 2rem 2rem 0;
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 0.6rem;
}
.chapter-tab {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.4rem;
padding: 1rem 0.5rem;
border-radius: 14px;
border: 1px solid var(--border);
background: var(--surface);
cursor: pointer;
transition: all 0.25s;
text-align: center;
user-select: none;
}
.chapter-tab:hover {
border-color: var(--border-light);
background: var(--surface-2);
}
.chapter-tab.active {
border-color: var(--accent);
background: var(--accent-glow);
}
.chapter-tab-num {
width: 28px;
height: 28px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-family: 'JetBrains Mono', monospace;
font-weight: 700;
font-size: 0.78rem;
background: var(--surface-3);
color: var(--text-muted);
transition: all 0.25s;
}
.chapter-tab.active .chapter-tab-num {
background: var(--accent);
color: #fff;
}
.chapter-tab-label {
font-size: 0.78rem;
font-weight: 600;
color: var(--text-dim);
line-height: 1.3;
}
.chapter-tab.active .chapter-tab-label {
color: var(--text);
}
/* ── Chapter Content ── */
.chapter {
display: none;
}
.chapter.active {
display: block;
}
.chapter-inner {
max-width: 780px;
margin: 0 auto;
padding: 2.5rem 2rem 2rem;
}
.chapter-header {
margin-bottom: 2rem;
}
.chapter-header h2 {
font-size: 1.6rem;
font-weight: 800;
letter-spacing: -0.02em;
margin-bottom: 0.3rem;
}
.chapter-header p {
color: var(--text-dim);
font-size: 0.92rem;
}
/* ── Chapter Nav Buttons ── */
.chapter-nav {
max-width: 780px;
margin: 0 auto;
padding: 1rem 2rem 4rem;
display: flex;
justify-content: space-between;
gap: 1rem;
}
.chapter-nav-btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.8rem 1.5rem;
border-radius: 12px;
border: 1px solid var(--border);
background: var(--surface);
color: var(--text-dim);
font-size: 0.9rem;
font-weight: 600;
font-family: inherit;
cursor: pointer;
transition: all 0.2s;
}
.chapter-nav-btn:hover {
border-color: var(--border-light);
color: var(--text);
background: var(--surface-2);
}
.chapter-nav-btn.primary {
background: var(--accent);
border-color: var(--accent);
color: #fff;
}
.chapter-nav-btn.primary:hover {
background: var(--accent-light);
border-color: var(--accent-light);
}
.chapter-nav-btn.hidden {
visibility: hidden;
}
.chapter-nav-btn svg {
width: 16px;
height: 16px;
}
/* ── Step Card ── */
.step {
position: relative;
margin-bottom: 1.5rem;
border-radius: 16px;
border: 1px solid var(--border);
background: var(--surface);
overflow: hidden;
transition: border-color 0.3s, box-shadow 0.3s;
}
.step:hover {
border-color: var(--border-light);
}
.step-header {
display: flex;
align-items: center;
gap: 1rem;
padding: 1.2rem 1.5rem;
cursor: pointer;
user-select: none;
}
.step-number {
width: 36px;
height: 36px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-family: 'JetBrains Mono', monospace;
font-weight: 700;
font-size: 0.85rem;
background: var(--surface-3);
color: var(--text-dim);
flex-shrink: 0;
transition: all 0.3s;
}
.step-title {
font-weight: 600;
font-size: 1rem;
flex: 1;
}
.step-toggle {
width: 28px;
height: 28px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
background: var(--surface-2);
color: var(--text-muted);
transition: all 0.2s;
flex-shrink: 0;
}
.step-toggle svg {
width: 14px;
height: 14px;
transition: transform 0.3s;
}
.step.open .step-toggle svg {
transform: rotate(180deg);
}
.step-body {
max-height: 0;
overflow: hidden;
transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.step.open .step-body {
max-height: 3000px;
}
.step-content {
padding: 0 1.5rem 1.5rem;
}
.step-content p {
color: var(--text-dim);
font-size: 0.92rem;
margin-bottom: 1rem;
line-height: 1.8;
}
.step-content strong {
color: var(--text);
font-weight: 600;
}
/* ── Code Block ── */
.code-block {
position: relative;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 10px;
margin: 0.8rem 0 1rem;
overflow: hidden;
}
.code-block-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.6rem 1rem;
background: var(--surface-2);
border-bottom: 1px solid var(--border);
}
.code-block-label {
font-family: 'JetBrains Mono', monospace;
font-size: 0.72rem;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.06em;
}
.copy-btn {
display: inline-flex;
align-items: center;
gap: 0.4rem;
padding: 0.3rem 0.7rem;
border: 1px solid var(--border);
border-radius: 6px;
background: transparent;
color: var(--text-dim);
font-size: 0.75rem;
font-family: 'Inter', sans-serif;
cursor: pointer;
transition: all 0.15s;
}
.copy-btn:hover {
background: var(--surface-3);
color: var(--text);
border-color: var(--border-light);
}
.copy-btn.copied {
color: var(--green);
border-color: var(--green);
}
.copy-btn svg { width: 13px; height: 13px; }
.code-block pre {
padding: 1rem 1.2rem;
overflow-x: auto;
font-family: 'JetBrains Mono', monospace;
font-size: 0.85rem;
line-height: 1.6;
color: var(--accent-light);
}
.code-block.output-only {
border-color: var(--surface-3);
opacity: 0.85;
}
.code-block.output-only pre {
color: var(--text-dim);
}
.code-block.output-only .code-block-header {
background: var(--surface);
}
.code-block-no-copy-hint {
font-size: 0.75rem;
color: var(--text-muted);
margin-top: -0.6rem;
margin-bottom: 0.8rem;
padding-left: 0.2rem;
}
/* ── Callout ── */
.callout {
display: flex;
gap: 0.8rem;
padding: 1rem 1.2rem;
border-radius: 10px;
margin: 0.8rem 0;
font-size: 0.88rem;
line-height: 1.7;
}
.callout-icon {
font-size: 1.1rem;
flex-shrink: 0;
margin-top: 0.1rem;
}
.step-img {
width: 100%;
border-radius: 10px;
border: 1px solid var(--border);
margin: 0.8rem 0 1rem;
display: block;
}
.callout.tip {
background: rgba(92, 184, 134, 0.08);
border: 1px solid rgba(92, 184, 134, 0.15);
color: #8ed4b0;
}
.callout.warn {
background: rgba(212, 196, 91, 0.08);
border: 1px solid rgba(212, 196, 91, 0.15);
color: #e0d68a;
}
.callout.info {
background: rgba(91, 141, 217, 0.08);
border: 1px solid rgba(91, 141, 217, 0.15);
color: #8db8e8;
}
/* ── Footer ── */
.footer {
max-width: 780px;
margin: 0 auto;
padding: 0 2rem 3rem;
text-align: center;
display: none;
}
.footer.visible { display: block; }
.footer-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 20px;
padding: 3rem 2rem;
}
.footer-card h3 {
font-size: 1.4rem;
font-weight: 800;
margin-bottom: 0.6rem;
}
.footer-card p {
color: var(--text-dim);
font-size: 0.95rem;
max-width: 400px;
margin: 0 auto 1.5rem;
}
.footer-links {
display: flex;
gap: 0.8rem;
justify-content: center;
flex-wrap: wrap;
}
.footer-links a {
display: inline-flex;
align-items: center;
gap: 0.4rem;
padding: 0.6rem 1.2rem;
border-radius: 10px;
border: 1px solid var(--border);
background: var(--surface-2);
color: var(--text-dim);
font-size: 0.85rem;
text-decoration: none;
transition: all 0.2s;
}
.footer-links a:hover {
border-color: var(--border-light);
color: var(--text);
background: var(--surface-3);
}
.copyright {
margin-top: 2.5rem;
font-size: 0.78rem;
color: var(--text-muted);
}
/* ── Responsive ── */
@media (max-width: 640px) {
.step-header { padding: 1rem; }
.step-content { padding: 0 1rem 1rem; }
.code-block pre { font-size: 0.78rem; padding: 0.8rem; }
.hero h1 { font-size: 2rem; }
.chapter-tabs { grid-template-columns: repeat(3, 1fr); }
.chapter-tab:last-child { grid-column: 2; }
.chapter-tab { padding: 0.8rem 0.4rem; }
.chapter-tab-label { font-size: 0.72rem; }
}
/* ── Animations ── */
.fade-in {
opacity: 0;
transform: translateY(16px);
animation: fadeUp 0.4s ease forwards;
}
@keyframes fadeUp {
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body>
<nav class="nav" id="nav">
<div class="nav-inner">
<span class="nav-title">Claude Code 安裝教學</span>
<a href="/tips/cd.html" style="text-decoration:none;font-size:0.82rem;color:var(--text-dim);transition:color 0.15s;" onmouseover="this.style.color='var(--accent-light)'" onmouseout="this.style.color='var(--text-dim)'">常用操作 Tips →</a>
</div>
</nav>
<main>
<!-- ── Hero ── -->
<section class="hero" id="hero">
<div class="hero-badge">
<span class="dot"></span>
Mac 終端機版本
</div>
<h1>安裝 <span class="highlight">Claude Code</span><br>手把手圖文教學</h1>
<p>從零開始,在你的 Mac 上安裝終端機版 Claude Code,然後用 AI 寫出你的第一個網站。</p>
<div class="hero-prereq">
<div class="hero-prereq-title">開始之前,你需要準備</div>
<div class="hero-prereq-item">
<span class="icon">💻</span>
<span>一台 Mac 電腦(MacBook、Mac Mini、iMac 皆可)</span>
</div>
<div class="hero-prereq-item">
<span class="icon">🔑</span>
<span>一個 <a href="https://claude.ai" target="_blank" style="color: var(--accent-light); text-decoration: underline;">Claude</a> 訂閱帳號(Pro 方案,$20 美金 / 月)</span>
</div>
</div>
<button class="hero-cta" onclick="startTutorial()">
開始安裝
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
</button>
</section>
<!-- ── Tutorial Area ── -->
<div id="tutorialArea" style="display:none;">
<!-- Chapter Tabs -->
<div class="chapter-tabs" id="chapterTabs">
<div class="chapter-tab active" onclick="goToChapter(0)">
<div class="chapter-tab-num">1</div>
<div class="chapter-tab-label">安裝<br>Claude Code</div>
</div>
<div class="chapter-tab" onclick="goToChapter(1)">
<div class="chapter-tab-num">2</div>
<div class="chapter-tab-label">安裝<br>開發工具</div>
</div>
<div class="chapter-tab" onclick="goToChapter(2)">
<div class="chapter-tab-num">3</div>
<div class="chapter-tab-label">建立專案<br>並啟動</div>
</div>
<div class="chapter-tab" onclick="goToChapter(3)">
<div class="chapter-tab-num">4</div>
<div class="chapter-tab-label">首次設定<br>開始寫程式</div>
</div>
<div class="chapter-tab" onclick="goToChapter(4)">
<div class="chapter-tab-num">5</div>
<div class="chapter-tab-label">部署上線<br>讓全世界看到</div>
</div>
</div>
<!-- ══════════════ Chapter 1: 安裝 Claude Code ══════════════ -->
<div class="chapter active" data-chapter="0">
<div class="chapter-inner">
<div class="chapter-header fade-in">
<h2>⚙ 安裝 Claude Code</h2>
<p>打開終端機,安裝 Claude Code 主程式。這個章節只有 3 個步驟。</p>
</div>
<!-- Step 1 -->
<div class="step fade-in open" data-step="1">
<div class="step-header" onclick="toggleStep(this)">
<div class="step-number">1</div>
<div class="step-title">打開終端機(Terminal)</div>
<div class="step-toggle"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg></div>
</div>
<div class="step-body">
<div class="step-content">
<p>每一台 Mac 都有內建的<strong>「終端機」</strong>應用程式,你只需要把它找出來。有兩個方式:</p>
<p><strong>方法 A:</strong>打開 <strong>Finder</strong> → 左邊欄點選「應用程式」→ 找到「工具程式」資料夾 → 雙擊打開<strong>「終端機」</strong>。</p>
<p><strong>方法 B:</strong>用四隻手指在觸控板上「往內收」的手勢,打開<strong>「啟動台(Launchpad)」</strong>,然後在上面的搜尋框輸入 <strong>Terminal</strong> 或<strong>終端機</strong>,點擊打開。不會開啟動台的話可以<a href="https://www.youtube.com/shorts/tdBibivoqdQ" target="_blank" style="color: var(--accent-light); text-decoration: underline;">看這個影片教學</a>。</p>
<img class="step-img" loading="lazy" src="screenshots/launchpad-terminal.png" alt="在 Launchpad 搜尋 Terminal">
<div class="callout tip">
<span class="callout-icon">💡</span>
<span>打開以後你會看到一個黑色(或白色)的視窗,裡面有一行閃爍的游標,這就是終端機。別擔心,我們接下來只需要「貼上指令」然後「按 Enter」就好。</span>
</div>
</div>
</div>
</div>
<!-- Step 2 -->
<div class="step fade-in" data-step="2">
<div class="step-header" onclick="toggleStep(this)">
<div class="step-number">2</div>
<div class="step-title">安裝 Claude Code</div>
<div class="step-toggle"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg></div>
</div>
<div class="step-body">
<div class="step-content">
<p>在終端機裡面<strong>貼上</strong>下面這行指令,然後按 <strong>Enter</strong>。這行指令的意思是「從 Claude 的官網下載安裝程式,然後自動執行安裝」,你不需要理解它,<strong>只要複製貼上就好</strong>。</p>
<div class="code-block">
<div class="code-block-header">
<span class="code-block-label">Terminal</span>
<button class="copy-btn" onclick="copyCode(this)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>
複製
</button>
</div>
<pre><code>curl -fsSL https://claude.ai/install.sh | bash</code></pre>
</div>
<p>把這段指令貼進終端機,然後按 <strong>Enter</strong>。</p>
<img class="step-img" loading="lazy" src="screenshots/paste-install-command.gif" alt="在終端機貼上安裝指令">
<p>等它跑完,看到 <strong>"Installation Complete"</strong> 就代表安裝成功了。</p>
<img class="step-img" loading="lazy" src="screenshots/install-complete.png" alt="Claude Code 安裝完成畫面">
</div>
</div>
</div>
<!-- Step 3 -->
<div class="step fade-in" data-step="3">
<div class="step-header" onclick="toggleStep(this)">
<div class="step-number">3</div>
<div class="step-title">設定環境變數 PATH</div>
<div class="step-toggle"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg></div>
</div>
<div class="step-body">
<div class="step-content">
<p>這一步是確保你<strong>以後每次打開終端機</strong>都能直接使用 <code>claude</code> 指令。這行指令的意思是「把 Claude 的程式位置加到系統的搜尋路徑裡」,聽起來很複雜,但你只要<strong>複製貼上按 Enter</strong> 就好:</p>
<div class="code-block">
<div class="code-block-header">
<span class="code-block-label">Terminal</span>
<button class="copy-btn" onclick="copyCode(this)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>
複製
</button>
</div>
<pre><code>echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc</code></pre>
</div>
<p>把這段指令貼進終端機,然後按 <strong>Enter</strong>。</p>
<div class="callout info">
<span class="callout-icon">ℹ️</span>
<span>這行指令不會有任何輸出,是正常的。只要沒有出現紅色錯誤訊息就代表成功了。</span>
</div>
</div>
</div>
</div>
</div>
<div class="chapter-nav">
<button class="chapter-nav-btn hidden">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>
上一章
</button>
<button class="chapter-nav-btn primary" onclick="goToChapter(1)">
下一章:安裝開發工具
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
</button>
</div>
</div>
<!-- ══════════════ Chapter 2: 安裝開發工具 ══════════════ -->
<div class="chapter" data-chapter="1">
<div class="chapter-inner">
<div class="chapter-header fade-in">
<h2>🔧 安裝開發工具</h2>
<p>安裝 Homebrew、Xcode 命令列工具、Node.js 和 Zeabur Skills。這是最花時間的章節,大約 15 ~ 25 分鐘。</p>
</div>
<!-- Step 4 -->
<div class="step fade-in open" data-step="4">
<div class="step-header" onclick="toggleStep(this)">
<div class="step-number">4</div>
<div class="step-title">安裝 Homebrew</div>
<div class="step-toggle"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg></div>
</div>
<div class="step-body">
<div class="step-content">
<p>Homebrew 是 Mac 上最常用的「軟體商店」,只不過它是在終端機裡面用的。有了它才能方便地安裝 Node.js 等開發工具。這行指令的意思是「下載並安裝 Homebrew」,一樣<strong>複製貼上按 Enter</strong> 就好:</p>
<div class="code-block">
<div class="code-block-header">
<span class="code-block-label">Terminal</span>
<button class="copy-btn" onclick="copyCode(this)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>
複製
</button>
</div>
<pre><code>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</code></pre>
</div>
<p>把這段指令貼進終端機,然後按 <strong>Enter</strong>。</p>
<img class="step-img" loading="lazy" src="screenshots/homebrew-password-prompt.png" alt="Homebrew 安裝等待輸入密碼">
<div class="callout warn">
<span class="callout-icon">🔐</span>
<span>畫面會卡在 <strong>Password:</strong> 加上一個鑰匙符號。這時候請<strong>輸入你的電腦開機密碼</strong>,然後按 Enter。<br><br><strong>注意:輸入密碼的時候畫面上不會顯示任何字元</strong>(不會出現 *** 之類的),這是正常的安全機制!不要理它,照常輸入完密碼按 Enter 就好。</span>
</div>
</div>
</div>
</div>
<!-- Step 5 -->
<div class="step fade-in" data-step="5">
<div class="step-header" onclick="toggleStep(this)">
<div class="step-number">5</div>
<div class="step-title">安裝 Xcode 命令列工具(不一定會出現)</div>
<div class="step-toggle"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg></div>
</div>
<div class="step-body">
<div class="step-content">
<div class="callout info">
<span class="callout-icon">💡</span>
<span>如果你的電腦之前已經安裝過 Xcode 命令列工具,這個步驟<strong>不會出現</strong>,可以直接跳到下一步。</span>
</div>
<p>在安裝 Homebrew 的過程中,終端機<strong>可能</strong>會顯示:</p>
<div class="code-block output-only">
<div class="code-block-header">
<span class="code-block-label">Terminal 顯示的訊息(不需要複製)</span>
</div>
<pre><code>xcode-select: note: install requested for command line developer tools</code></pre>
</div>
<p class="code-block-no-copy-hint">☝ 這是終端機自動顯示的訊息,不需要複製貼上。</p>
<p>這時候你會發現電腦<strong>彈出了一個系統視窗</strong>,標題是「xcode-select 命令需要命令列開發者工具」。</p>
<div class="callout info">
<span class="callout-icon">⚠️</span>
<span>如果你確定還沒安裝過 Xcode 命令列工具,但安裝 Homebrew 時<strong>沒有彈出安裝對話框</strong>,可以在終端機手動執行以下指令來強制觸發安裝視窗:</span>
</div>
<div class="code-block">
<div class="code-block-header">
<span class="code-block-label">手動安裝 Xcode 命令列工具</span>
<button class="copy-btn" onclick="copyCode(this)">複製</button>
</div>
<pre><code>xcode-select --install</code></pre>
</div>
<img class="step-img" loading="lazy" src="screenshots/homebrew-xcode-select-trigger.png" alt="終端機觸發 xcode-select 安裝">
<p>請點擊<strong>「安裝」</strong>按鈕:</p>
<img class="step-img" loading="lazy" src="screenshots/xcode-select-install.png" alt="xcode-select 安裝視窗">
<p>然後點<strong>「同意」</strong>授權條款:</p>
<img class="step-img" loading="lazy" src="screenshots/xcode-select-agree.png" alt="xcode-select 同意授權條款">
<div class="callout info">
<span class="callout-icon">⏲</span>
<span>安裝 Xcode 命令列工具可能需要 <strong>5 ~ 10 分鐘</strong>,取決於你的網路速度。去泡杯咖啡吧!</span>
</div>
</div>
</div>
</div>
<!-- Step 6 -->
<div class="step fade-in" data-step="6">
<div class="step-header" onclick="toggleStep(this)">
<div class="step-number">6</div>
<div class="step-title">繼續安裝 Homebrew</div>
<div class="step-toggle"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg></div>
</div>
<div class="step-body">
<div class="step-content">
<p>Xcode 命令列工具安裝完成後,回到終端機視窗,按一下 <strong>Enter</strong> 讓 Homebrew 繼續安裝。</p>
<p>等它跑完,看到提示符號再次出現就代表安裝完成了。</p>
</div>
</div>
</div>
<!-- Step 7 -->
<div class="step fade-in" data-step="7">
<div class="step-header" onclick="toggleStep(this)">
<div class="step-number">7</div>
<div class="step-title">設定 Homebrew 的 PATH</div>
<div class="step-toggle"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg></div>
</div>
<div class="step-body">
<div class="step-content">
<p>Homebrew 安裝完成後,需要讓終端機知道 Homebrew 裝在哪裡,這樣才能使用 <code>brew</code> 指令。請<strong>複製貼上</strong>以下指令並按 <strong>Enter</strong>:</p>
<div class="code-block">