Skip to content

Commit 3f37d23

Browse files
Balashov NikitaOlegLustenko
authored andcommitted
classwork-19
1 parent e896339 commit 3f37d23

File tree

6 files changed

+81
-0
lines changed

6 files changed

+81
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>Class work 19</title>
7+
<style>
8+
.box{
9+
background-color: blue;
10+
opacity: 0.8;
11+
width: 300px;
12+
height: 300px;
13+
position: absolute;
14+
transition: .01s ease;
15+
}
16+
</style>
17+
</head>
18+
19+
<body>
20+
<div class="test">
21+
<a href="#">Free JS Salary = 5000$</a>
22+
</div>
23+
24+
<script src="src/main.js"></script>
25+
26+
</body>
27+
28+
</html>
102 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// const box = document.querySelector('.box');
2+
// box.addEventListener('mousedown', (e) => {
3+
// const mousemove = (e) => {
4+
// const centerOfBoxX = box.offsetWidth / 2;
5+
// const centerOfBoxY = box.offsetHeight / 2;
6+
// box.style.left = e.pageX - centerOfBoxX + 'px';
7+
// box.style.top = e.pageY - centerOfBoxY + 'px';
8+
// }
9+
10+
// const mouseup = (e) => {
11+
// box.removeEventListener('mousemove', mousemove);
12+
// box.removeEventListener('mouseup', mouseup);
13+
// }
14+
15+
// box.addEventListener('mousemove', mousemove)
16+
// box.addEventListener('mouseup', mouseup)
17+
// box.ondragstart = (e) => false;
18+
// })
19+
20+
//=========================================================
21+
alert(10)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function add(a, b) {
2+
console.log(a + b)
3+
}
4+
5+
module.exports = {
6+
add
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const {add} = require('./math');
2+
3+
add(5, 5)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const http = require('http');
2+
const fs = require('fs');
3+
4+
http.createServer((request, response) => {
5+
const index = fs.readFileSync('../index.html');
6+
7+
if(request.url === '/src/main.js') {
8+
const main = fs.readFileSync('./main.js');
9+
10+
response.end(main)
11+
}
12+
console.log(request.url)
13+
if(request.url === '/src/cat.jpg') {
14+
const cat = fs.readFileSync('./cat.jpg');
15+
16+
response.end(cat)
17+
}
18+
19+
response.end(index)
20+
}).listen(3000, err => {
21+
console.log('server started http://localhost:3000')
22+
})

0 commit comments

Comments
 (0)