Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
REALITY コマンド作成チュートリアル
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
にしうり らく
April 27, 2025
Programming
370
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
REALITY コマンド作成チュートリアル
ハムチレクチャー - HTML 初⼼者向け解説資料
にしうり らく
April 27, 2025
More Decks by にしうり らく
See All by にしうり らく
第一回夏のハムハム絵画コンクール
nishiuriraku
0
14
ハムチDiscordサーバー はむはむけいけんち結果発表スライド
nishiuriraku
0
97
HAMUCHI Award 2025 スライド
nishiuriraku
0
35
クレーム対応
nishiuriraku
0
700
ハムハム年表
nishiuriraku
0
690
Other Decks in Programming
See All in Programming
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
300
JIS keyboard support in Omarchy
lef237
0
110
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
290
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
590
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
41k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Leo the Paperboy
mayatellez
10
2.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Transcript
ハムチレクチャー - HTML 初心者向け解説資料 REALITY コマンド作成チュートリアル
0. うぇぶぺーじとは HTML (えいちてぃーえむえる) CSS (しーえすえす) JavaScript (じゃばすくりぷと) の 3
つであーだこーだするやつ
1-1. HTML ウェブページの土台、骨組みを作る言語だぴょん 家で言ったら柱とか壁みたいなもん。 <html lang="ja"> <head> <!-- へっど! -->
</head> <body> <!-- ぼでぃー! --> </body> </html> <html> : 「ここからここまでがウェブページだよ!」って宣言する親玉 <head> : ページの設定とか、裏方さん。表には出ないけど超重要 <body> : ユーザーが実際に見る画面の中身!主役級!
1-2. CSS ! CSS (Cascading Style Sheets) はウェブページの見た目を担当するぴょん HTML が骨組みなら、CSS
は服やメイクのようなもの。文字の色、大きさ、背 景、配置などを指定できる h1 { /* セレクタ: どの要素にスタイルを適用するか */ color: blue; /* プロパティ: 何を */ } /* classセレクタ: 特定のクラスを持つ要素 */ .important-text { font-weight: bold; } <head> の中に書くか <style> にかくか、別の .css ファイルを作るのが普通
1-2. JavaScript ウェブページに「動き」を与える魔法の呪文、それが JavaScript だぴょん! HTML ( 骨) と CSS
( 見た目) だけじゃできない、あんなことやこんなことを実現! 例えば… ボタンを押したら「こんにちは!」って挨拶させたり 画像がシュッと出てきたり、クルクル回ったり ユーザーが何か入力したら、それに合わせて表示を変えたり <script> // JavaScriptのこーーーーど function greetMe() { alert('やあ!JavaScriptの世界へようこそ! '); } greetMe(); // この呪文を唱えると... ポップアップが出る! </script>
2. セクション 1: Hello Hamuchi <section> <h2 class="...">No.1 Hello Hamuchi</h2>
<button id="hamu-button-01" class="...">出す</button> <script> 問題! </script> </section> 説明: ボタンをクリックでコンソール(F12 で出すでばっぐつーる)にメッセージ表示 document.getElementById('hamu-button-01') : ID で要素をとる addEventListener('click', ...) : ボタンがクリックされるのを待ち構える
3-2. Hello Hamuchi 問題 <script> function onClickHamuchi01() { // ここの処理が問題!
} // ボタンを取ってきて const hamuButton01 = document.getElementById('hamu-button-01'); // ボタンがクリックされたら onClickHamuchi01 を発動するように設定! hamuButton01.addEventListener('click', onClickHamuchi01); </script> ミッション: 上のコードのコメント部分 ( // ここに... ) に、コンソールにメッセージを出す JavaScript のコードを書こう! 正しく書ければ、ボタンを押すと開発者ツールにメッセージが出るはず!
3-1. セクション 2: 簡単な計算 <section> <h2 class="...">No.2 簡単な計算</h2> <button id="hamu-button-02"
class="...">計算開始</button> <script> 問題! </script> </section> 説明: コンピューター得意の計算をやらせてみよう! 足し算 (+), 引き算 (-), 掛け算 (*), 割り算 (/) を使ってみるよ。 ボタンを押したら、 「8686 × 8686 」の答えをコンソールに出してみよう! 暗算禁 止!
3-2. 簡単な計算 問題 <script> function onClickHamuchi02() { // ここの処理が問題! }
// ボタンを探してきて... const hamuButton02 = document.getElementById('hamu-button-02'); // クリックされたら計算を発動! hamuButton02.addEventListener('click', onClickHamuchi02); </script> ミッション: 上のコードのコメント部分 ( // ここに... ) に、計算してコンソールに表示する コードを書こう! 掛け算は * を使う
4-1. セクション 3: HTML を操作する <section> <h2 class="...">No.3 HTMLを操作する</h2> <img
id="image" src="/600.png" alt="ハムチ" class="..." /> <button id="hamu-button-03" class="...">消える</button> <script> 問題! </script> </section> ボタンクリックで画像の表示/ 非表示を切り替え isVisible 変数で状態管理 ボタンテキストも状態に応じて変化 CSS アニメーションでスケールイン/ アウト
4-2. HTML を操作する 問題 <script> let isVisible = true; //
今、画像が見えてる? function onClickHamuchi03() { const image = document.getElementById('image'); // 画像を探す const button = document.getElementById('hamu-button-03'); // ボタンを探す if (isVisible) { image.className = 'w-[300px] animate-scale-out-center'; // アニメーション button.innerHTML = // 問題1!; isVisible = // 問題2!; } else { image.className = 'w-[300px] animate-scale-in-center'; // アニメーション button.innerHTML = // 問題3!; isVisible = // 問題4!; } }; const hamuButton03 = document.getElementById('hamu-button-03'); hamuButton03.addEventListener('click', onClickHamuchi03); </script>
5-1. セクション 4: コマンドを実装する <section> <h2 class="...">No.4 コマンドを実装する</h2> <div id="janken-result">結果:<span
id="janken-result-text"></span></div> <input id="input-command" placeholder="..." /> <button id="hamu-button-04" class="...">実行する</button> <script> 問題! </script> </section> ミッション: テキスト入力とボタンでコマンド実行 /janken コマンドでランダムなじゃんけん結果を表示 未知のコマンドはエラー表示
5-2. コマンドを実装する 問題 <script> const onClickHamuchi04 = () => {
const input = document.getElementById('input-command'); const button = document.getElementById('hamu-button-04'); const command = input.value; const result = document.getElementById('janken-result-text'); const random = Math.floor(Math.random() * 3); const janken = ['問題1!', '問題2!', '問題3!']; if (条件!問題4) { result.innerHTML = // 難問 ; result.style.color = 'initial'; } else { result.innerHTML = 'そんなコマンドないよ! (`/janken` って入れてみて)'; result.style.color = 'red'; } }; // ボタンを探してきて... const hamuButton04 = document.getElementById('hamu-button-04'); // クリックされたら、コマンド実行の魔法を発動! hamuButton04.addEventListener('click', onClickHamuchi04); </script>
まとめ このスライドで、ウェブページの基本がなんとなくわかったかな? HTML で骨組みを作り、CSS で飾り付け、JavaScript で動きをつける! この 3 つ がキホン!
各セクションの問題をクリアすれば、君も立派なウェブ魔法使い見習いだ! どんどん試して、壊して、学んでいこう! Let's Enjoy Hacking!