Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
98512c9
code sandbox
Yokomi422 Oct 25, 2025
d66919b
演習問題にsandpackの解答を追加
Yokomi422 Nov 15, 2025
7e8a5fa
プロジェクトを解答例に含めた
Yokomi422 Nov 22, 2025
24c10dc
prettier
Yokomi422 Nov 22, 2025
a21741e
raw loader dep
Yokomi422 Nov 22, 2025
1f48692
check
Yokomi422 Nov 22, 2025
25ed472
不要なcomponentを削除
Yokomi422 Nov 22, 2025
25a0a33
不要なファイルを削除
Yokomi422 Nov 22, 2025
180a1df
演習問題以外のファイルを削除
Yokomi422 Dec 6, 2025
2d52afd
Answerの中に移動
Yokomi422 Dec 6, 2025
3878e6b
css 演習問題3の解答を修正
Yokomi422 Dec 6, 2025
4b04494
importを1つに
Yokomi422 Dec 6, 2025
8469084
weired comparisonはview soruceのままに
Yokomi422 Dec 6, 2025
afaa34c
fix prettier
Yokomi422 Dec 6, 2025
27a8ecf
whileのsandpackはなし
Yokomi422 Dec 6, 2025
756c1e1
cssをactiveにした
Yokomi422 Dec 14, 2025
97064c8
view sourceを追加
Yokomi422 Dec 14, 2025
12432c5
format
Yokomi422 Dec 14, 2025
8a10b37
Merge branch 'main' into code-sandpack
Yokomi422 Dec 14, 2025
bf57164
chore: trigger CI
Yokomi422 Dec 14, 2025
cd708f8
Merge remote-tracking branch 'origin/main' into code-sandpack
Yokomi422 Dec 20, 2025
5d581e2
fix
Yokomi422 Dec 20, 2025
5da31d5
変数の章のviewsourceを追加
Yokomi422 Dec 20, 2025
1bdb2c0
関数のviewsource追加
Yokomi422 Dec 20, 2025
a70b65f
ループの章のview source 追加
Yokomi422 Dec 20, 2025
8d96eb9
domの章にviewsource 復活
Yokomi422 Dec 20, 2025
2d4b004
おみくじをAnswerで囲った
Yokomi422 Dec 20, 2025
6f1f7ff
cssのview source復活
Yokomi422 Dec 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions docs/1-trial-session/02-html/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import createFileVideo from "./create-file.mp4";
import openInBrowserVideo from "./open-in-browser.mp4";
import showFileExtensionsVideo from "./show-file-extensions.mp4";
import reloadBrowserVideo from "./reload-browser.mp4";
import excursionHtml from "!!raw-loader!./_samples/excursion/index.html";
import formHtml from "!!raw-loader!./_samples/form/index.html";

Web開発に必ず用いられる言語があります。<Term>**HTML**</Term>とCSS、そしてJavaScriptです。これらは互いに異なる役割をもっています。まずは最も基本となる<Term>HTML</Term>から学んでいきましょう。

Expand Down Expand Up @@ -155,7 +157,15 @@ VS Code上で作成したファイルは`index.html`でした。しかしなが
</html>
```

<ViewSource url={import.meta.url} path="_samples/excursion" />
<Sandpack
template="static"
files={{
"/index.html": excursionHtml,
}}
options={{
activeFile: "/index.html",
}}
/>

</Answer>

Expand Down Expand Up @@ -202,6 +212,14 @@ VS Code上で作成したファイルは`index.html`でした。しかしなが
</html>
```

<ViewSource url={import.meta.url} path="_samples/form" />
<Sandpack
template="static"
files={{
"/index.html": formHtml,
}}
options={{
activeFile: "/index.html",
}}
/>

</Answer>
13 changes: 2 additions & 11 deletions docs/1-trial-session/03-css/_samples/foo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@
<html lang="ja">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="./style.css" />
<title>Title</title>
</head>
<body>
<div
style="
border: 1px solid #aaa;
border-radius: 10px;
margin: 30px;
padding: 30px;
box-shadow: 0px 0px 2px 1px #aaa;
"
>
Foo
</div>
<div id="foo">Foo</div>
</body>
</html>
7 changes: 7 additions & 0 deletions docs/1-trial-session/03-css/_samples/foo/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#foo {
border: 1px solid #aaa;
border-radius: 10px;
margin: 30px;
padding: 30px;
box-shadow: 0px 0px 2px 1px #aaa;
}
11 changes: 0 additions & 11 deletions docs/1-trial-session/03-css/_samples/red-hello-world/index.html

This file was deleted.

This file was deleted.

32 changes: 25 additions & 7 deletions docs/1-trial-session/03-css/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: CSS
---

import yellowHelloCssHtml from "!!raw-loader!./_samples/yellow-hello-css/index.html";
import yellowHelloCssCss from "!!raw-loader!./_samples/yellow-hello-css/style.css";
import fooHtml from "!!raw-loader!./_samples/foo/index.html";
import fooCss from "!!raw-loader!./_samples/foo/style.css";

この節では、Web開発で用いられるもう一つの言語である、CSSについて学びます。CSSはWebサイトの「見た目」をつかさどる言語です。多くの<Term>HTML要素</Term>は、<Term>CSS</Term>を用いることで、その見た目を細かくカスタマイズすることができます。

![Web開発で用いられる言語](../02-html/web-development-languages.drawio.svg)
Expand All @@ -15,8 +20,6 @@ title: CSS
<div style="color: red; font-size: 24px;">Hello World!</div>
```

<ViewSource url={import.meta.url} path="_samples/first-css" />

![Hello World!](./red-hello-world.png)

{/* prettier-ignore */}
Expand Down Expand Up @@ -60,8 +63,6 @@ title: CSS
}
```

<ViewSource url={import.meta.url} path="_samples/red-hello-world" />

### `link`要素

```html title="index.html"
Expand Down Expand Up @@ -125,10 +126,18 @@ HTMLファイルとCSSファイルを分けて作成する場合、`style`属性
</html>
```

<Sandpack
template="static"
files={{
"/index.html": yellowHelloCssHtml,
"/style.css": yellowHelloCssCss,
}}
options={{
activeFile: "/style.css",
}}
/>
</Answer>

<ViewSource url={import.meta.url} path="_samples/yellow-hello-css" />

## 演習問題2

次のような条件を満たす要素を選択するセレクタは何でしょうか。
Expand Down Expand Up @@ -183,6 +192,15 @@ HTMLファイルとCSSファイルを分けて作成する場合、`style`属性
}
```

<ViewSource url={import.meta.url} path="_samples/foo" />
<Sandpack
template="static"
files={{
"/index.html": fooHtml,
"/style.css": fooCss,
}}
options={{
activeFile: "/style.css",
}}
/>

</Answer>
14 changes: 13 additions & 1 deletion docs/1-trial-session/06-variables/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: 変数
---

import counterHtml from "!!raw-loader!./_samples/counter/index.html";
import counterJs from "!!raw-loader!./_samples/counter/script.js";

## <Term>変数</Term>とは

{/* prettier-ignore */}
Expand Down Expand Up @@ -107,6 +110,15 @@ counter = counter + 1;
document.write(counter);
```

<ViewSource url={import.meta.url} path="_samples/counter" />
<Sandpack
template="static"
files={{
"/index.html": counterHtml,
"/script.js": counterJs,
}}
options={{
activeFile: "/script.js",
}}
/>

</Answer>
18 changes: 15 additions & 3 deletions docs/1-trial-session/07-boolean/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: 論理値と論理演算子
---

import quizShowHtml from "!!raw-loader!./_samples/quiz-show/index.html";
import quizShowJs from "!!raw-loader!./_samples/quiz-show/script.js";

## <Term>論理値</Term>

{/* prettier-ignore */}
Expand Down Expand Up @@ -92,11 +95,11 @@ document.write(takaoHeight < everestHeight < fujiHeight);
document.write(takaoHeight = everestHeight);
```

<ViewSource url={import.meta.url} path="_samples/weird-comparison" />

- JavaScript で、数値と論理値に比較<Term>演算子</Term>を適用すると、`true`は`1`として、`false`は`0`として比較されます。
- `=`は代入演算子です。代入<Term>演算子</Term>の<Term>式</Term>が<Term>評価</Term>されると、右辺の<Term>値</Term>になります。

<ViewSource url={import.meta.url} path="_samples/weird-comparison" />

:::

## 演習問題
Expand Down Expand Up @@ -131,6 +134,15 @@ const isTanakaWinner = tanakaScore >= 100 && tanakaScore - satoScore >= 20;
document.write(isTanakaWinner); // true
```

<ViewSource url={import.meta.url} path="_samples/quiz-show" />
<Sandpack
template="static"
files={{
"/index.html": quizShowHtml,
"/script.js": quizShowJs,
}}
options={{
activeFile: "/script.js",
}}
/>

</Answer>
14 changes: 13 additions & 1 deletion docs/1-trial-session/08-if-statement/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: 条件分岐
---

import theRightToVoteHtml from "!!raw-loader!./_samples/the-right-to-vote/index.html";
import theRightToVoteJs from "!!raw-loader!./_samples/the-right-to-vote/script.js";

## if文

**if文**は、<Term>JavaScript</Term>の<Term>**制御構造**</Term>で、特定の条件下のみで実行されるプログラムを記述することができます。
Expand Down Expand Up @@ -100,7 +103,16 @@ if (age < 18) {
}
```

<ViewSource url={import.meta.url} path="_samples/the-right-to-vote" />
<Sandpack
template="static"
files={{
"/index.html": theRightToVoteHtml,
"/script.js": theRightToVoteJs,
}}
options={{
activeFile: "/script.js",
}}
/>

4行目の式は`age >= 18 && age < 25`ではないかと思うかもしれませんが、上のように`age < 25`としても同じ結果になります。これは、if~else if~else構文では、一つ目の条件が満たされた場合、二つ目の条件は実行されないためです。

Expand Down
43 changes: 38 additions & 5 deletions docs/1-trial-session/09-functions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: 関数
---

import returnValueVideo from "./return-value.mp4";
import multiplyHtml from "!!raw-loader!./_samples/multiply/index.html";
import multiplyJs from "!!raw-loader!./_samples/multiply/script.js";
import maxHtml from "!!raw-loader!./_samples/max/index.html";
import maxJs from "!!raw-loader!./_samples/max/script.js";
import mobilePhoneBillHtml from "!!raw-loader!./_samples/mobile-phone-bill/index.html";
import mobilePhoneBillJs from "!!raw-loader!./_samples/mobile-phone-bill/script.js";

## 処理の共通化

Expand Down Expand Up @@ -97,7 +103,16 @@ function multiply(a, b) {
document.write(multiply(3, 4));
```

<ViewSource url={import.meta.url} path="_samples/multiply" />
<Sandpack
template="static"
files={{
"/index.html": multiplyHtml,
"/script.js": multiplyJs,
}}
options={{
activeFile: "/script.js",
}}
/>

</Answer>

Expand Down Expand Up @@ -187,7 +202,18 @@ function max(a, b) {
}
```

<ViewSource url={import.meta.url} path="_samples/max" />
<ViewSource url={import.meta.url} path="_samples/max-no-else" />

<Sandpack
template="static"
files={{
"/index.html": maxHtml,
"/script.js": maxJs,
}}
options={{
activeFile: "/script.js",
}}
/>

:::note

Expand All @@ -202,8 +228,6 @@ function max(a, b) {
}
```

<ViewSource url={import.meta.url} path="_samples/max-no-else" />

:::

</Answer>
Expand Down Expand Up @@ -238,6 +262,15 @@ function calculateCost(monthlyDataUsage) {
document.write(calculateCost(3.5));
```

<ViewSource url={import.meta.url} path="_samples/mobile-phone-bill" />
<Sandpack
template="static"
files={{
"/index.html": mobilePhoneBillHtml,
"/script.js": mobilePhoneBillJs,
}}
options={{
activeFile: "/script.js",
}}
/>

</Answer>
Loading