diff --git a/index.js b/index.js index 7547ad4..5a7f955 100644 --- a/index.js +++ b/index.js @@ -10,11 +10,11 @@ app.use(express.static('public')); io.on('connection', (socket) => { console.log('a user connected'); - socket.on('draw', (line) => { + socket.on('picture', (line) => { console.log(line); - socket.broadcast.emit("draw",line); + socket.broadcast.emit("dingdong",line); }); - + socket.on('disconnect', () => { console.log('user disconnected'); }); diff --git a/package.json b/package.json index 058184c..d54d120 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "lets draw together", "dependencies": { "express": "^4.18.2", - "socket.io": "^4.7.4" + "socket.io": "^4.7.4", + "socketio": "^1.0.0" } } diff --git a/public/index.html b/public/index.html index 5c48a31..5c55512 100644 --- a/public/index.html +++ b/public/index.html @@ -1,81 +1,85 @@ - - - untitled - + drawing - - - Width: - Color: +

drawing editor

+
+ Stroke width:
+ Color: + Brush: -