Skip to content

Commit 5193dba

Browse files
committed
section 05 added
1 parent 64dfe19 commit 5193dba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+14748
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
build
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"esnext": true
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello <span id="who">World</span>!</h1>
8+
<button id="changer">Change</button>
9+
10+
<script src="build/index.js"></script>
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var names = ["Sarah", "Nate", "Shawn", "Mike", "Eric", "Ryan",
2+
"Jason", "Seth", "Joseph", "Crissy", "Matt", "Ken",
3+
"Jeff", "Lori", "Brenna", "Kevin", "Daryl", "Alexander",
4+
"Michael", "Glenn", "Venita", "Maddison", "Kristy",
5+
"Mike", "Zoe", "David", "Christopher"];
6+
7+
function choice(items) {
8+
var index = Math.floor(Math.random() * items.length);
9+
return items[index];
10+
}
11+
12+
function $(selector) {
13+
return document.querySelector(selector);
14+
}
15+
16+
function changeWho() {
17+
$('#who').innerHTML = choice(names);
18+
}
19+
20+
changeWho();
21+
22+
$('#changer').onclick = changeWho;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello <span id="who">World</span>!</h1>
8+
<button id="changer">Change</button>
9+
10+
<script src="build/index.js"></script>
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function $(selector) {
2+
return document.querySelector(selector);
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var $ = require('./dquery');
2+
var choice = require('./random').choice;
3+
4+
var names = ["Sarah", "Nate", "Shawn", "Mike", "Eric", "Ryan",
5+
"Jason", "Seth", "Joseph", "Crissy", "Matt", "Ken",
6+
"Jeff", "Lori", "Brenna", "Kevin", "Daryl", "Alexander",
7+
"Michael", "Glenn", "Venita", "Maddison", "Kristy",
8+
"Mike", "Zoe", "David", "Christopher"];
9+
10+
function changeWho() {
11+
$('#who').innerHTML = choice(names);
12+
}
13+
14+
changeWho();
15+
16+
$('#changer').onclick = changeWho;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function choice(items) {
2+
var index = Math.floor(Math.random() * items.length);
3+
return items[index];
4+
}
5+
6+
module.exports = {choice: choice};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello <span id="who">World</span>!</h1>
8+
<button id="changer">Change</button>
9+
10+
<script src="build/index.js"></script>
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function $(selector) {
2+
return document.querySelector(selector);
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var $ = require('./dquery');
2+
var choice = require('./random').choice;
3+
4+
var names = ["Sarah", "Nate", "Shawn", "Mike", "Eric", "Ryan",
5+
"Jason", "Seth", "Joseph", "Crissy", "Matt", "Ken",
6+
"Jeff", "Lori", "Brenna", "Kevin", "Daryl", "Alexander",
7+
"Michael", "Glenn", "Venita", "Maddison", "Kristy",
8+
"Mike", "Zoe", "David", "Christopher"];
9+
10+
function changeWho() {
11+
$('#who').innerHTML = choice(names);
12+
}
13+
14+
changeWho();
15+
16+
$('#changer').onclick = changeWho;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function choice(items) {
2+
var index = Math.floor(Math.random() * items.length);
3+
return items[index];
4+
}
5+
6+
module.exports = {choice: choice};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
entry: './src/index.js',
3+
output: {
4+
path: './build',
5+
filename: 'index.js',
6+
},
7+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello <span id="who">World</span>!</h1>
8+
<button id="changer">Change</button>
9+
10+
<script src="build/index.js"></script>
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function $(selector) {
2+
return document.querySelector(selector);
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var $ = require('./dquery');
2+
var choice = require('./random').choice;
3+
4+
var names = ['Sarah', 'Nate', 'Shawn', 'Mike', 'Eric', 'Ryan',
5+
'Jason', 'Seth', 'Joseph', 'Crissy', 'Matt', 'Ken',
6+
'Jeff', 'Lori', 'Brenna', 'Kevin', 'Daryl', 'Alexander',
7+
'Michael', 'Glenn', 'Venita', 'Maddison', 'Kristy',
8+
'Mike', 'Zoe', 'David', 'Christopher'];
9+
10+
function changeWho() {
11+
$('#who').innerHTML = choice(names);
12+
}
13+
14+
changeWho();
15+
16+
$('#changer').onclick = changeWho;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function choice(items) {
2+
var index = Math.floor(Math.random() * items.length);
3+
return items[index];
4+
}
5+
6+
module.exports = {choice: choice};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
entry: './src/index.js',
3+
output: {
4+
path: './build',
5+
publicPath: '/build/',
6+
filename: 'index.js',
7+
},
8+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello <span id="who">World</span>!</h1>
8+
<button id="changer">Change</button>
9+
10+
<script src="build/index.js"></script>
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function $(selector) {
2+
return document.querySelector(selector);
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var $ = require('./dquery');
2+
var choice = require('./random').choice;
3+
4+
var names = ["Sarah", "Nate", "Shawn", "Mike", "Eric", "Ryan",
5+
"Jason", "Seth", "Joseph", "Crissy", "Matt", "Ken",
6+
"Jeff", "Lori", "Brenna", "Kevin", "Daryl", "Alexander",
7+
"Michael", "Glenn", "Venita", "Maddison", "Kristy",
8+
"Mike", "Zoe", "David", "Christopher"];
9+
10+
function changeWho() {
11+
$('#who').innerHTML = choice(names);
12+
}
13+
14+
changeWho();
15+
16+
$('#changer').onclick = changeWho;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function choice(items) {
2+
var index = Math.floor(Math.random() * items.length);
3+
return items[index];
4+
}
5+
6+
module.exports = {choice: choice};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
entry: './src/index.js',
3+
output: {
4+
path: './build',
5+
publicPath: '/build/',
6+
filename: 'index.js',
7+
},
8+
devtool: 'source-map',
9+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello <span id="who">World</span>!</h1>
8+
<button id="changer">Change</button>
9+
10+
<script src="build/index.js"></script>
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function $(selector) {
2+
return document.querySelector(selector);
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import $ from './dquery';
2+
import {choice} from './random';
3+
4+
var names = ["Sarah", "Nate", "Shawn", "Mike", "Eric", "Ryan",
5+
"Jason", "Seth", "Joseph", "Crissy", "Matt", "Ken",
6+
"Jeff", "Lori", "Brenna", "Kevin", "Daryl", "Alexander",
7+
"Michael", "Glenn", "Venita", "Maddison", "Kristy",
8+
"Mike", "Zoe", "David", "Christopher"];
9+
10+
function changeWho() {
11+
$('#who').innerHTML = choice(names);
12+
}
13+
14+
changeWho();
15+
16+
$('#changer').onclick = changeWho;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function choice(items) {
2+
var index = Math.floor(Math.random() * items.length);
3+
return items[index];
4+
}
5+
6+
export {choice};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
entry: './src/index.js',
3+
output: {
4+
path: './build',
5+
publicPath: '/build/',
6+
filename: 'index.js',
7+
},
8+
devtool: 'source-map',
9+
module: {
10+
loaders: [
11+
{test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
12+
]
13+
}
14+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello <span id="who">World</span>!</h1>
8+
<button id="changer">Change</button>
9+
10+
<script src="build/index.js"></script>
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function $(selector) {
2+
return document.querySelector(selector);
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import $ from './dquery';
2+
import {choice} from './random';
3+
import names from './names.json';
4+
import './style.css';
5+
6+
function changeWho() {
7+
$('#who').innerHTML = choice(names);
8+
}
9+
10+
changeWho();
11+
12+
$('#changer').onclick = changeWho;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
["Sarah", "Nate", "Shawn", "Mike", "Eric", "Ryan",
2+
"Jason", "Seth", "Joseph", "Crissy", "Matt", "Ken",
3+
"Jeff", "Lori", "Brenna", "Kevin", "Daryl", "Alexander",
4+
"Michael", "Glenn", "Venita", "Maddison", "Kristy",
5+
"Mike", "Zoe", "David", "Christopher"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function choice(items) {
2+
var index = Math.floor(Math.random() * items.length);
3+
return items[index];
4+
}
5+
6+
export {choice};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background: lightblue;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
entry: './src/index.js',
3+
output: {
4+
path: './build',
5+
publicPath: '/build/',
6+
filename: 'index.js',
7+
},
8+
devtool: 'source-map',
9+
module: {
10+
loaders: [
11+
{test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
12+
{test: /\.json$/, loader: 'json'},
13+
{test: /\.css/, loaders: ['style', 'css']}
14+
]
15+
}
16+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello <span id="who">World</span>!</h1>
8+
<button id="changer">Change</button>
9+
10+
<script src="build/index.js"></script>
11+
</body>
12+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function $(selector) {
2+
return document.querySelector(selector);
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import $ from './dquery';
2+
import {choice} from './random';
3+
import names from './names.json';
4+
import './style.scss';
5+
6+
function changeWho() {
7+
$('#who').innerHTML = choice(names);
8+
}
9+
10+
changeWho();
11+
12+
$('#changer').onclick = changeWho;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
["Sarah", "Nate", "Shawn", "Mike", "Eric", "Ryan",
2+
"Jason", "Seth", "Joseph", "Crissy", "Matt", "Ken",
3+
"Jeff", "Lori", "Brenna", "Kevin", "Daryl", "Alexander",
4+
"Michael", "Glenn", "Venita", "Maddison", "Kristy",
5+
"Mike", "Zoe", "David", "Christopher"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function choice(items) {
2+
var index = Math.floor(Math.random() * items.length);
3+
return items[index];
4+
}
5+
6+
export {choice};

0 commit comments

Comments
 (0)