-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
471 lines (435 loc) · 29.4 KB
/
index.html
File metadata and controls
471 lines (435 loc) · 29.4 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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <title>CodeKids|英語で学ぶ子供向けプログラミング教室</title>-->
<title>子供向け英語プログラミング教室|オンライン Scratch・Python【CodeKids】</title>
<!-- ✅ SEO -->
<meta name="description" content="CodeKidsは4〜16歳向けの英語プログラミング教室。Scratch・Python・Web制作を個別レッスンで学びます。" />
<link rel="canonical" href="https://ichlaura.github.io/CodeKids/" />
<!-- ✅ verificacion de google -->
<meta name="google-site-verification" content="ocG2jrKrWRM7iY_iSBJRhK4PQvGVQCmGG9lKbsfqVS0" />
<!-- ✅ Language hint -->
<meta http-equiv="content-language" content="ja" />
<!-- ✅ Open Graph (SNS / Google) -->
<meta property="og:title" content="CodeKids|英語で学ぶ子供向けプログラミング教室" />
<meta property="og:description" content="英語 × プログラミングを楽しく学ぶ子供向けオンラインスクール" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://ichlaura.github.io/CodeKids/" />
<!-- ✅ Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<script src="https://cdn.tailwindcss.com"></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "EducationalOrganization",
"name": "CodeKids",
"url": "https://ichlaura.github.io/CodeKids/",
"description": "英語で学ぶ子供向けプログラミング教室(4〜16歳)",
"areaServed": {
"@type": "Country",
"name": "Japan"
},
"inLanguage": "ja",
"teaches": ["Scratch", "Python", "Web Programming"],
"audience": {
"@type": "PeopleAudience",
"suggestedMinAge": 4,
"suggestedMaxAge": 16
}
}
</script>
<style>
body {
font-family: 'Inter', sans-serif;
scroll-behavior: smooth;
}
body::-webkit-scrollbar {
width: 8px;
}
body::-webkit-scrollbar-thumb {
background-color: #6366f1;
border-radius: 10px;
}
</style>
</head>
<body class="bg-gray-50 text-gray-800">
<header class="sticky top-0 z-50 bg-white shadow-lg">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex justify-between items-center py-4">
<a href="#" class="text-3xl font-extrabold text-indigo-600 tracking-wider">
<CodeKids>
</a>
<nav class="hidden md:flex space-x-8 font-medium">
<a href="#courses" class="hover:text-indigo-600 transition duration-300">コース</a>
<a href="#tutors" class="hover:text-indigo-600 transition duration-300">講師紹介</a>
<a href="#schedule" class="hover:text-indigo-600 transition duration-300">スケジュールと料金</a>
<a href="#contact" class="px-4 py-2 text-white bg-green-500 rounded-full hover:bg-green-600 transition duration-300 shadow-md">
今すぐお問い合わせ
</a>
</nav>
<button id="mobile-menu-button" class="md:hidden text-gray-600 focus:outline-none">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
</div>
<div id="mobile-menu" class="hidden md:hidden">
<div class="px-2 pt-2 pb-3 space-y-1 flex flex-col items-center">
<a href="#courses" class="block px-3 py-2 w-full text-center hover:bg-indigo-50">コース</a>
<a href="#tutors" class="block px-3 py-2 w-full text-center hover:bg-indigo-50">講師紹介</a>
<a href="#schedule" class="block px-3 py-2 w-full text-center hover:bg-indigo-50">スケジュールと料金</a>
<a href="#contact" class="block mt-2 px-3 py-2 w-3/4 text-center bg-green-500 text-white rounded-full">
今すぐお問い合わせ
</a>
</div>
</div>
</header>
<main>
<section class="relative pt-16 pb-24 lg:pt-24 lg:pb-32 bg-indigo-50 overflow-hidden">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
<div class="lg:grid lg:grid-cols-12 lg:gap-12 items-center">
<div class="lg:col-span-6 text-center lg:text-left">
<span class="text-sm font-semibold uppercase tracking-wider text-indigo-600 bg-indigo-200 py-1 px-3 rounded-full shadow-inner">対象年齢 4-16歳</span>
<h1 class="mt-4 text-5xl sm:text-6xl font-extrabold tracking-tight text-gray-900 leading-tight">
<span class="text-indigo-600">子供向け英語プログラミング教室|楽しく学ぶオンラインレッスン</span>
</h1>
<p class="mt-6 text-xl text-gray-600">
クラスでは日本語をほぼ話さず、プログラミングの基礎を一緒に楽しく学ぶことで英語とプログラミングを同時にしっかりと学習することができます。
</p>
<div class="mt-10 flex flex-col sm:flex-row gap-4 justify-center lg:justify-start">
<a href="#courses" class="px-8 py-4 text-lg font-bold text-white bg-indigo-600 rounded-xl hover:bg-indigo-700 transition duration-300 shadow-xl shadow-indigo-300/50 transform hover:scale-[1.02]">
コース情報
</a>
<a href="#contact" class="px-8 py-4 text-lg font-bold text-indigo-600 bg-white border-2 border-indigo-600 rounded-xl hover:bg-indigo-50 transition duration-300 shadow-xl transform hover:scale-[1.02]">
無料体験予約
</a>
</div>
</div>
<div class="lg:col-span-6 mt-12 lg:mt-0 relative">
<div class="relative w-full h-80 bg-gray-900 rounded-3xl shadow-2xl overflow-hidden">
<iframe src="https://www.youtube-nocookie.com/embed/kCc8FmEb1nY?start=496&autoplay=0&mute=1&loop=1&playlist=kJQMO5MuWRs"
title="CodeKidsの紹介ビデオ" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen
class="absolute top-0 left-0 w-full h-full"
></iframe>
</div>
</div>
</div>
</div>
</section>
<section class="py-20 bg-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
<h2 class="text-4xl font-extrabold text-gray-900 mb-12">CodeKidsを選ぶ理由</h2>
<div class="grid md:grid-cols-3 gap-8">
<div class="p-8 bg-yellow-50 rounded-2xl shadow-lg hover:shadow-xl transition duration-300 border-t-4 border-yellow-500">
<span class="text-4xl">📚</span>
<h3 class="text-xl font-bold mt-4 mb-2 text-gray-900">プロジェクトベース学習</h3>
<p class="text-gray-600">実際にゲームやアプリを構築し、学んだ概念を即座に応用することで楽しくスキルが定着します。</p>
</div>
<div class="p-8 bg-green-50 rounded-2xl shadow-lg hover:shadow-xl transition duration-300 border-t-4 border-green-500">
<span class="text-4xl">🌎</span>
<h3 class="text-xl font-bold mt-4 mb-2 text-gray-900">外国人英語講師</h3>
<p class="text-gray-600">日本語をほぼ離せない講師の元でプログラミングを学ぶことでおのずと英語、コミュニーケーション能力が培われます。</p>
</div>
<div class="p-8 bg-indigo-50 rounded-2xl shadow-lg hover:shadow-xl transition duration-300 border-t-4 border-indigo-500">
<span class="text-4xl">🧠</span>
<h3 class="text-xl font-bold mt-4 mb-2 text-gray-900">プライベートレッスン</h3>
<p class="text-gray-600">グループではなく個人でレッスンをすることで、お子様の学ぶ速度に合わせて学習ができます。</p>
</div>
</div>
</div>
</section>
<section id="courses" class="py-20 bg-gray-100">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 class="text-center text-4xl font-extrabold text-gray-900 mb-16">コース概要</h2>
<div class="grid lg:grid-cols-3 md:grid-cols-2 gap-10">
<div class="bg-white rounded-3xl shadow-xl overflow-hidden transform hover:scale-[1.02] transition duration-500 border-t-8 border-yellow-500">
<div class="p-8">
<h3 class="text-2xl font-bold text-yellow-600 text-center">ブロックプログラミング</h3>
<h4 class="text-2xl font-bold text-yellow-600 text-center">(対象年齢 5-9歳)</h4>
<p class="mt-2 text-gray-600">最初のステップに最適。SCRATCHをというツールを使って、簡単なPC操作(ドラッグ&ドロップ)で対話型ストーリーやゲームを制作します。</p>
<ul class="mt-4 text-sm text-gray-500 space-y-2">
<li class="flex items-center"><svg class="w-4 h-4 mr-2 text-yellow-500" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 14.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path></svg>タイピング不要</li>
<li class="flex items-center"><svg class="w-4 h-4 mr-2 text-yellow-500" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 14.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path></svg>基本的な論理に集中</li>
</ul>
</div>
</div>
<div class="bg-white rounded-3xl shadow-xl overflow-hidden transform hover:scale-[1.02] transition duration-500 border-t-8 border-indigo-600">
<div class="p-8">
<h3 class="text-2xl font-bold text-indigo-600 text-center">Python基礎</h3>
<h4 class="text-2xl font-bold text-indigo-600 text-center">(対象年齢 10-16歳)</h4>
<p class="mt-2 text-gray-600">世界で最も人気のある言語。ゲームの作成、データ分析ツール、シンプルな機械学習モデルを構築します。</p>
<ul class="mt-4 text-sm text-gray-500 space-y-2">
<li class="flex items-center"><svg class="w-4 h-4 mr-2 text-indigo-600" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 14.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path></svg>実践的なテキストコーディング</li>
<li class="flex items-center"><svg class="w-4 h-4 mr-2 text-indigo-600" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 14.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path></svg>中級レベルの概念</li>
</ul>
</div>
</div>
<div class="bg-white rounded-3xl shadow-xl overflow-hidden transform hover:scale-[1.02] transition duration-500 border-t-8 border-green-500">
<div class="p-8">
<h3 class="text-2xl font-bold text-green-600 text-center">Webページ作成</h3>
<h4 class="text-2xl font-bold text-green-600 text-center">(対象年齢 10-16歳)</h4>
<p class="mt-2 text-gray-600">JavaScript,HTML、CSSなどの言語を使用しウェブサイトを作成、サーバー上に実装します。</p>
<ul class="mt-4 text-sm text-gray-500 space-y-2">
<li class="flex items-center"><svg class="w-4 h-4 mr-2 text-green-500" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 14.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path></svg>フルスタックの基礎</li>
<li class="flex items-center"><svg class="w-4 h-4 mr-2 text-green-500" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 14.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"></path></svg>ポートフォリオにできるプロジェクト</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="tutors" class="py-20 bg-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
<h2 class="text-4xl font-extrabold text-gray-900 mb-12">講師紹介</h2>
<div class="flex justify-center">
<div class="p-6 bg-gray-50 rounded-2xl shadow-lg border-b-4 border-indigo-400 max-w-sm w-full">
<img class="w-24 h-24 mx-auto rounded-full object-cover mb-4 shadow-lg border-2 border-indigo-400" src="miamor.jpg" alt="アレックス P. 先生のプロフィール画像" onerror="this.onerror=null;this.src='https://placehold.co/96x96/9ca3af/ffffff?text=A'">
<h3 class="text-xl font-bold text-gray-900">パオラ先生</h3>
<p class="text-indigo-600 font-medium">Python, JavaScriptなど専門</p>
<p class="mt-3 text-sm text-gray-600">コロンビアで物理・教育学の学位を取得後、約3年ほどプログラミングの教師として勤務。アメリカには2年ほど在住経験あり</p>
</div>
</div>
</div>
</section>
<section id="schedule" class="py-20 bg-indigo-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 class="text-center text-4xl font-extrabold text-gray-900 mb-16">スケジュール料金設定</h2>
<div class="flex flex-col lg:flex-row gap-10">
<div class="lg:w-1/2 p-8 bg-white rounded-2xl shadow-xl">
<h3 class="text-2xl font-bold text-indigo-700 mb-4">柔軟な授業時間</h3>
<ul class="space-y-4 text-gray-600">
<li class="flex items-start">
<span class="text-indigo-600 font-extrabold text-xl mr-3">></span>
<div>
<p class="font-bold text-2xl">ブロックプログラミング (対象年齢 5-9歳)</p>
<p class="text-2l">4:00 PM - 7:00 PM(月-金)30分</p>
</div>
</li>
<li class="flex items-start">
<span class="text-indigo-600 font-extrabold text-xl mr-3">></span>
<div>
<p class="font-bold text-2xl">Python基礎→応用・Webページ作成(対象年齢 10-16歳)</p>
<p class="text-2l">4:00 PM - 7:00 PM (月-金)1時間</p>
</div>
</li>
</ul>
</div>
<div class="lg:w-1/2 p-8 bg-white rounded-2xl shadow-xl border-t-8 border-green-500">
<h3 class="text-2xl font-bold text-green-700 mb-4">シンプルな料金プラン</h3>
<div class="space-y-4">
<div class="border-b pb-3">
<p class="text-xl font-bold text-gray-800">30分(ブロックプログラミング )</p>
<p class="text-3xl font-extrabold text-green-600">¥10,000 <span class="text-lg font-normal text-gray-500">/ 月 (4レッスン)</span></p>
</div>
<div class="border-b pb-3 bg-green-50 p-4 rounded-lg shadow-inner">
<p class="text-xl font-bold text-gray-800">1時間(Python基礎→応用・Webページ作成)</p>
<p class="text-3xl font-extrabold text-green-600">¥20,000 <span class="text-lg font-normal text-gray-500">/ 月 (4レッスン)</span></p>
</div>
</div>
</div>
</div>
<div class="text-center mt-12">
<a href="#contact" class="inline-block px-8 py-4 text-xl font-bold text-white bg-indigo-600 rounded-xl hover:bg-indigo-700 transition duration-300 shadow-xl shadow-indigo-300/50"> 無料体験レッスンから始めましょう! </a>
</div>
</div>
</section>
<section id="contact" class="py-20 bg-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 class="text-center text-4xl font-extrabold text-gray-900 mb-12">まずはお問い合わせください</h2>
<div class="max-w-3xl mx-auto bg-gray-50 p-8 rounded-3xl shadow-2xl border-t-4 border-yellow-500">
<form id="registrationForm" action="https://formspree.io/f/xkgqkyjg" method="POST" class="space-y-6">
<div>
<label for="parent_name" class="block text-sm font-medium text-gray-700">保護者様のお名前</label>
<input type="text" id="parent_name" name="parent_name" required class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-yellow-500 focus:border-yellow-500">
</div>
<div>
<label for="child_age" class="block text-sm font-medium text-gray-700">お子様の年齢</label>
<select id="child_age" name="child_age" required class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-yellow-500 focus:border-yellow-500">
<option value="">コースを選択</option>
<option value="7-9">ブロックプログラミング</option>
<option value="10-13">Python基礎→応用・Webページ作成</option>
</select>
</div>
<div>
<label for="email" class="block text-sm font-medium text-gray-700">メールアドレス</label>
<input type="email" id="email" name="email" required class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-yellow-500 focus:border-yellow-500">
</div>
<div>
<label for="message" class="block text-sm font-medium text-gray-700">ご質問・メッセージ</label>
<textarea id="message" name="message" rows="4" class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:ring-yellow-500 focus:border-yellow-500"></textarea>
</div>
<div class="text-center">
<button id="submitButton" type="submit" class="w-full sm:w-auto px-10 py-4 text-xl font-bold text-white bg-yellow-500 rounded-xl hover:bg-yellow-600 transition duration-300 shadow-lg shadow-yellow-300/50">
送信する
</button>
<p id="statusMessage" class="mt-4 text-center text-sm font-medium"></p>
</div>
</form>
</div>
</div>
</section>
</main>
<section class="py-20 bg-gray-50">
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 class="text-center text-4xl font-extrabold text-gray-900 mb-12">
よくあるご質問(FAQ)
</h2>
<div class="space-y-10">
<div>
<h3 class="text-xl font-bold text-gray-900">
子供は何歳からプログラミングを始められますか?
</h3>
<p class="mt-3 text-gray-700 leading-relaxed">
一般的には4〜5歳からプログラミング学習を始めることが可能です。
CodeKidsではScratchを使った視覚的なプログラミングから始めるため、
文字入力が苦手なお子様でも安心して学習できます。
</p>
</div>
<div>
<h3 class="text-xl font-bold text-gray-900">
英語でプログラミングを学ぶメリットは何ですか?
</h3>
<p class="mt-3 text-gray-700 leading-relaxed">
プログラミングと英語を同時に学ぶことで、論理的思考力だけでなく、
英語で考える力や国際的なコミュニケーション能力も自然に身につきます。
将来のIT・グローバル社会に非常に有利です。
</p>
</div>
<div>
<h3 class="text-xl font-bold text-gray-900">
プログラミングが初めてでも大丈夫ですか?
</h3>
<p class="mt-3 text-gray-700 leading-relaxed">
はい、まったく問題ありません。
ほとんどのお子様が初心者からスタートしています。
一人ひとりのレベルに合わせて、基礎から丁寧に指導します。
</p>
</div>
<div>
<h3 class="text-xl font-bold text-gray-900">
オンライン授業でもしっかり学べますか?
</h3>
<p class="mt-3 text-gray-700 leading-relaxed">
CodeKidsではマンツーマン形式のオンラインレッスンを採用しており、
対面授業と同じレベルの学習効果が期待できます。
ご自宅から安心して受講いただけます。
</p>
</div>
<div>
<h3 class="text-xl font-bold text-gray-900">
ScratchやPythonは将来役に立ちますか?
</h3>
<p class="mt-3 text-gray-700 leading-relaxed">
Scratchは論理的思考の基礎を身につけるのに最適で、
Pythonは世界中で使われている実用的なプログラミング言語です。
将来の学習や進学、仕事にもつながる重要なスキルです。
</p>
</div>
</div>
</div>
</section>
<footer class="bg-gray-800 text-white py-12">
<div class="max-w-7xl mx-auto px-4 grid md:grid-cols-4 gap-8">
<div>
<a href="#" class="text-2xl font-extrabold text-indigo-400"><CodeKids></a>
<p class="mt-4 text-sm text-gray-400">
次世代のイノベーターを、1行のコードから育成します。
</p>
<h3 class="mt-6 text-lg font-bold text-white">
子供向け英語プログラミング教室とは?
</h3>
<p class="mt-2 text-sm text-gray-300 leading-relaxed">
子供向けの英語プログラミング教室では、論理的思考力だけでなく、
英語で考える力も同時に身につけることができます。
ScratchやPythonを使った学習は、4〜5歳からでも無理なく始められます。
</p>
</div>
</div>
</footer>
<script>
document.addEventListener('DOMContentLoaded', () => {
const menuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
const navLinks = document.querySelectorAll('nav a');
const registrationForm = document.getElementById('registrationForm');
const statusMessage = document.getElementById('statusMessage');
const submitButton = document.getElementById('submitButton');
// 1. モバイルメニューのトグル (前回からの維持)
menuButton.addEventListener('click', () => {
mobileMenu.classList.toggle('hidden');
});
// 2. リンククリック後にモバイルメニューを非表示にする (前回からの維持)
mobileMenu.querySelectorAll('a').forEach(link => {
link.addEventListener('click', () => {
mobileMenu.classList.add('hidden');
});
});
// 3. スムーススクロールを実装 (前回からの維持)
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
const href = this.getAttribute('href');
if (href.length > 1) {
e.preventDefault();
const targetElement = document.querySelector(href);
if (targetElement) {
window.scrollTo({
top: targetElement.offsetTop - document.querySelector('header').offsetHeight,
behavior: 'smooth'
});
}
}
});
});
// 4. *** 新しいフォーム送信ロジック ***
if (registrationForm) {
registrationForm.addEventListener('submit', async (e) => {
// ページの再読み込みを防ぐ
e.preventDefault();
statusMessage.textContent = '送信中です...';
statusMessage.className = 'mt-4 text-center text-sm font-medium text-indigo-600';
submitButton.disabled = true; // 二重送信防止
// フォームデータをJSONオブジェクトに変換
const formData = new FormData(registrationForm);
const data = Object.fromEntries(formData.entries());
// *** ここがサーバーとの通信ポイントです ***
// 実際には、このURLをメール送信処理を行うサーバーエンドポイントに置き換える必要があります
const API_ENDPOINT = "https://formspree.io/f/xkgqkyjg";
try {
// サーバーへデータを送信
const response = await fetch(API_ENDPOINT, {
method: 'POST',
headers: {
'Accept': 'application/json',
},
body: new FormData(registrationForm)
});
if (response.ok) {
// 成功した場合の処理 (ステータスコード 200-299)
statusMessage.textContent = 'メッセージを送信いたしました。担当者が返信いたしますのでしばしお待ちください。';
statusMessage.className = 'mt-4 text-center text-sm font-bold text-green-600';
registrationForm.reset(); // フォームをクリア
} else {
// サーバー側でエラーが発生した場合の処理
const errorData = await response.json();
statusMessage.textContent = `送信エラー: ${errorData.message || 'サーバーで問題が発生しました。'}`;
statusMessage.className = 'mt-4 text-center text-sm font-bold text-red-600';
}
} catch (error) {
// ネットワークエラーなどが発生した場合の処理
console.error('Fetch Error:', error);
statusMessage.textContent = 'ネットワークエラーにより送信できませんでした。再度お試しください。';
statusMessage.className = 'mt-4 text-center text-sm font-bold text-red-600';
} finally {
submitButton.disabled = false;
}
});
}
});
</script>
</body>
</html>