-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Chat Application using JavaScript(#62)
* make it better * make it better * make it better * make it better * removing node_modules * make it better
- Loading branch information
1 parent
064dff2
commit 71a3c1f
Showing
13 changed files
with
1,597 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#simple chat application using socket.io | ||
|
||
<p align="center"> | ||
<img src="/JavaScript/HactoChat/public/imgs/one.png" width="350" title="hover text"> | ||
<img src="/JavaScript/HactoChat/public/imgs/two.png" width="350" title="hover text"> | ||
<img src="/JavaScript/HactoChat/public/imgs/three.png" width="350" title="hover text"> | ||
<img src="/JavaScript/HactoChat/public/imgs/four.png" width="350" title="hover text"> | ||
<img src="/JavaScript/HactoChat/public/imgs/five.png" width="350" title="hover text"> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const express = require("express"); | ||
const app = express(); | ||
const http = require("http").createServer(app); | ||
|
||
app.use(express.static(__dirname + "/public")); | ||
|
||
app.get("/", (req, res) => { | ||
res.sendFile(__dirname + "/index.html"); | ||
}); | ||
|
||
http.listen(5000, () => { | ||
console.log("server is running at http://localhost:5000"); | ||
}); | ||
|
||
const io = require("socket.io")(http); | ||
|
||
io.on("connection", (socket) => { | ||
console.log("User Connected !!"); | ||
|
||
socket.on("message", (msg) => { | ||
socket.broadcast.emit("message", msg); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="shortcut icon" | ||
href="https://getillustrations.com/packs/download-free-3d-app-icons-for-iphone/elements/_1x/app%20icons,%20communication,%20social%20media%20_%20conversation,%20chat,%20messages,%20message,%20talk_md.png" | ||
type="image/x-icon"> | ||
<link rel="stylesheet" href="/style.css"> | ||
<title>HactoChat App</title> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="app"> | ||
<div class="logo flex justify-center"> | ||
<img src="https://getillustrations.com/packs/download-free-3d-app-icons-for-iphone/elements/_1x/app%20icons,%20communication,%20social%20media%20_%20conversation,%20chat,%20messages,%20message,%20talk_md.png" | ||
alt=""> | ||
<i>Hacto Chat</i> | ||
</div> | ||
|
||
<div class="chat_box"> | ||
<!-- <span class="left"> | ||
<h3>Sariful</h3> | ||
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Aspernatur, optio!</p> | ||
</span> | ||
<span class="right"> | ||
<h3>Golam</h3> | ||
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Aspernatur, optio!</p> | ||
</span> --> | ||
</div> | ||
<div> | ||
<input id="message" type="text" placeholder="Write your message.."> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
<script src="/socket.io/socket.io.js"></script> | ||
<script src="/script.js"></script> | ||
|
||
</html> |
Oops, something went wrong.