[Right job]Webエンジニア_基礎講座①
動画1 chat_appの仕様を確認しよう
- 本カリキュラムは動画のようなLINEの見た目作成します
- チャットをやり取りする機能は次回のカリキュラムで実装します
プログラミング学習を進める上で重要なこと
①7割理解を目指す
7割理解とは、「なんとなくイメージができる」、「できそうな気がする」くらいの理解です。まずは、7割理解を目指してどんどん先に進めましょう。
②細かいところまで気にしない
プログラミングは、細かいところまで気にすると膨大な情報があって習得に時間がかかります。未経験からいきなり細かいところを気になりだすとほぼ挫折しますので、まずは「動くものを作る」ということを目標に細かいことは気にせず進めていきましょう。
③わからないところは、まず調べてみる
プログラミングは、どんなに上級者であっても検索をします。検索した必要な情報は自分のメモにまとめておき、必要なところで取り出します。つまり、プログラミング上級者だとしてもいちいち全てを覚えているわけではなく、情報収集力に優れている場合がほとんどです。上級者であるほど、調べてきた情報を使いこなせる力があります。
なので、わからないことはどんどん調べてみましょう。
もちろん、本カリキュラムはできる限り調べなくても進められるように構成されています。
調べてもわからないことは何でも質問してください!
Webエンジニアに向いているかどうかの基準
- エラー問題の場所を分解して特定し、解決することができる(分析思考力)
- アルゴリズムを組み立てられる(アレンジ力、論理的思考力)
- Webエンジニアになってからも継続して学習を自ら続けられるか(学習欲)
環境構築
「ドットインストール」というプログラミング教材を使って、環境構築を行いましょう。
Google ChromeとVS Codeエディタの2つを導入します。
◎Windowsの方
https://dotinstall.com/lessons/basic_pcsetup_win_v2
◎Macの方
https://dotinstall.com/lessons/basic_pcsetup_mac_v2
動画3 文字をWeb上に表示しよう
○index.html
<!DOCTYPE HTML>
<html>
<head>
<!-- ここから -->
<link rel="stylesheet" href="">
<meta charset="UTF-8" />
<title>chatbot</title>
<script type="text/javascript" src="">
</script>
</head>
<body>
<h1>こんにちは</h1>
</body>
</html>
動画4 HTMLのコードの中身を見てみよう!
- headとは
- bodyとは
- タグとは
- pタグとul/liタグ
- とほほサイトの紹介
動画5 HTMLとCSSの違いを理解しよう
- HTMLとCSSの違い
- style.cssの作成
- cssを書いてみる
動画6 chat_appの画面の大枠を作成しよう
- 見本と見比べながら、大枠を作成
- classとは
- wrapperの作成
- heghtとwidthの設定
- background-colorの作成
- margin: 0 auto;の設定
○index.html
<!DOCTYPE HTML>
<html>
<head>
<!-- ここから -->
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8" />
<title>chat_bot</title>
<script type="text/javascript" src="">
</script>
</head>
<body>
<div class="wrapper">
</div>
</ul>
</body>
</html>
○style.css
.wrapper {
width: 30%;
height: 100vh;
background-color: gray;
margin: 0 auto;
}
動画7 titleを作成しよう
- ディベロッパーツールとは
- reset.cssとは
- titleの作成
- text-alignとは
- paddingとは
○reset.css
/*!
* ress.css • v3.0.1
* MIT License
* github.com/filipelinhares/ress
*/
/* # =================================================================
# Global selectors
# ================================================================= */
html {
box-sizing: border-box;
-webkit-text-size-adjust: 100%; /* Prevent adjustments of font size after orientation changes in iOS */
word-break: normal;
-moz-tab-size: 4;
tab-size: 4;
}
*,
::before,
::after {
background-repeat: no-repeat; /* Set `background-repeat: no-repeat` to all elements and pseudo elements */
box-sizing: inherit;
}
::before,
::after {
text-decoration: inherit; /* Inherit text-decoration and vertical align to ::before and ::after pseudo elements */
vertical-align: inherit;
}
* {
padding: 0; /* Reset `padding` and `margin` of all elements */
margin: 0;
}
/* # =================================================================
# General elements
# ================================================================= */
hr {
overflow: visible; /* Show the overflow in Edge and IE */
height: 0; /* Add the correct box sizing in Firefox */
}
details,
main {
display: block; /* Render the `main` element consistently in IE. */
}
summary {
display: list-item; /* Add the correct display in all browsers */
}
small {
font-size: 80%; /* Set font-size to 80% in `small` elements */
}
[hidden] {
display: none; /* Add the correct display in IE */
}
abbr[title] {
border-bottom: none; /* Remove the bottom border in Chrome 57 */
/* Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari */
text-decoration: underline;
text-decoration: underline dotted;
}
a {
background-color: transparent; /* Remove the gray background on active links in IE 10 */
}
a:active,
a:hover {
outline-width: 0; /* Remove the outline when hovering in all browsers */
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace; /* Specify the font family of code elements */
}
pre {
font-size: 1em; /* Correct the odd `em` font sizing in all browsers */
}
b,
strong {
font-weight: bolder; /* Add the correct font weight in Chrome, Edge, and Safari */
}
/* https://gist.github.com/unruthless/413930 */
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* # =================================================================
# Forms
# ================================================================= */
input {
border-radius: 0;
}
/* Replace pointer cursor in disabled elements */
[disabled] {
cursor: default;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto; /* Correct the cursor style of increment and decrement buttons in Chrome */
}
[type="search"] {
-webkit-appearance: textfield; /* Correct the odd appearance in Chrome and Safari */
outline-offset: -2px; /* Correct the outline style in Safari */
}
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none; /* Remove the inner padding in Chrome and Safari on macOS */
}
textarea {
overflow: auto; /* Internet Explorer 11+ */
resize: vertical; /* Specify textarea resizability */
}
button,
input,
optgroup,
select,
textarea {
font: inherit; /* Specify font inheritance of form elements */
}
optgroup {
font-weight: bold; /* Restore the font weight unset by the previous rule */
}
button {
overflow: visible; /* Address `overflow` set to `hidden` in IE 8/9/10/11 */
}
button,
select {
text-transform: none; /* Firefox 40+, Internet Explorer 11- */
}
/* Apply cursor pointer to button elements */
button,
[type="button"],
[type="reset"],
[type="submit"],
[role="button"] {
cursor: pointer;
color: inherit;
}
/* Remove inner padding and border in Firefox 4+ */
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/* Replace focus style removed in the border reset above */
button:-moz-focusring,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
outline: 1px dotted ButtonText;
}
button,
html [type="button"], /* Prevent a WebKit bug where (2) destroys native `audio` and `video`controls in Android 4 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* Correct the inability to style clickable types in iOS */
}
/* Remove the default button styling in all browsers */
button,
input,
select,
textarea {
background-color: transparent;
border-style: none;
}
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
outline-width: 0;
}
/* Style select like a standard input */
select {
-moz-appearance: none; /* Firefox 36+ */
-webkit-appearance: none; /* Chrome 41+ */
}
select::-ms-expand {
display: none; /* Internet Explorer 11+ */
}
select::-ms-value {
color: currentColor; /* Internet Explorer 11+ */
}
legend {
border: 0; /* Correct `color` not being inherited in IE 8/9/10/11 */
color: inherit; /* Correct the color inheritance from `fieldset` elements in IE */
display: table; /* Correct the text wrapping in Edge and IE */
max-width: 100%; /* Correct the text wrapping in Edge and IE */
white-space: normal; /* Correct the text wrapping in Edge and IE */
max-width: 100%; /* Correct the text wrapping in Edge 18- and IE */
}
::-webkit-file-upload-button {
/* Correct the inability to style clickable types in iOS and Safari */
-webkit-appearance: button;
color: inherit;
font: inherit; /* Change font properties to `inherit` in Chrome and Safari */
}
/* # =================================================================
# Specify media element style
# ================================================================= */
img {
border-style: none; /* Remove border when inside `a` element in IE 8/9/10 */
}
/* Add the correct vertical alignment in Chrome, Firefox, and Opera */
progress {
vertical-align: baseline;
}
/* # =================================================================
# Accessibility
# ================================================================= */
/* Hide content from screens but not screenreaders */
@media screen {
[hidden~="screen"] {
display: inherit;
}
[hidden~="screen"]:not(:active):not(:focus):not(:target) {
position: absolute !important;
clip: rect(0 0 0 0) !important;
}
}
/* Specify the progress cursor of updating elements */
[aria-busy="true"] {
cursor: progress;
}
/* Specify the pointer cursor of trigger elements */
[aria-controls] {
cursor: pointer;
}
/* Specify the unstyled cursor of disabled, not-editable, or otherwise inoperable elements */
[aria-disabled="true"] {
cursor: default;
}
○style.css
.wrapper {
width: 30%;
height: 100vh;
margin: 0 auto;
}
.title {
height: 60px;
background-color: #273246;
color: white;
text-align: center;
padding: 10px;
}
動画8 チャット画面を作成しよう
- contentsの作成
- formの作成
○index.html
<!-- 省略 -->
<body>
<div class="wrapper">
<div class="title">
<h2>お悩み相談グループ</h2>
</div>
<div class="contents">
</div>
<div class="form">
<form>
<input type="text" ></input>
<input type="submit" value="送信">
</form>
</div>
</div>
</body>
</html>
○style.css
.wrapper {
width: 30%;
height: 100vh;
margin: 0 auto;
background-color: gray;
}
.title {
height: 60px;
background-color: #273246;
color: #fff;
text-align: center;
padding: 10px;
}
.contents {
min-height: calc(100vh - 120px);
padding: 10px;
background-color: #7494c0;
}
.form {
height: 60px;
padding: 10px;
}
動画9 チャット画面を作成しよう2
- bot投稿用の画面の作成
- 投稿者の画面の作成
- formの中身を整える
完成コード
○index.html
<!DOCTYPE HTML>
<html>
<head>
<!-- ここから -->
<link rel="stylesheet" href="reset.css">
<link rel="stylesheet" href="style.css">
<meta charset="UTF-8" />
<title>chat_app</title>
<script type="text/javascript" src="script.js">
</script>
<!-- ここまでにhead要素を書きます -->
</head>
<body>
<div class="wrapper">
<div class="title">
<h2>お悩み相談グループ</h2>
</div>
<div class="contents">
<div class="robot_text">
hello!
</div>
<div class="user_text">
こんにちは!
</div>
<div class="robot_text">
プログラミングをやろう!
</div>
<div class="user_text">
わかった!
</div>
</div>
<div class="form">
<form id="form">
<input type="text" id="user_question"></input>
<input type="submit" id="submit" value="送信">
</form>
</div>
</div>
</body>
</html>
○style.css
.wrapper {
width: 30%;
height: 100vh;
margin: 0 auto;
}
.title {
height: 60px;
background-color: #273246;
color: white;
text-align: center;
padding: 10px;
}
.contents {
min-height: calc(100vh - 120px);
padding: 10px;
background-color: #7494c0;
}
.form {
height: 60px;
padding: 10px;
border: 1px solid;
border-color: black;
background-color: gray;
}
.robot_text {
font-size: 20px;
}
.user_text {
font-size: 20px;
text-align: right;
}
.form #user_question {
width: 80%;
background-color: #fff;
}
.form #submit {
width: 15%;
float: right;
background-color: #fff;
}