File tree Expand file tree Collapse file tree 6 files changed +81
-0
lines changed
js-core/classworks/classwork-19 Expand file tree Collapse file tree 6 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 1+ function add ( a , b ) {
2+ console . log ( a + b )
3+ }
4+
5+ module . exports = {
6+ add
7+ }
Original file line number Diff line number Diff line change 1+ const { add} = require ( './math' ) ;
2+
3+ add ( 5 , 5 )
Original file line number Diff line number Diff line change 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+ } )
You can’t perform that action at this time.
0 commit comments