Skip to content

Commit 06ef96c

Browse files
author
root
committed
added cool css and changed html
1 parent 510273e commit 06ef96c

File tree

3 files changed

+96
-19
lines changed

3 files changed

+96
-19
lines changed

index.html

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
1-
<h5>Type something</h5>
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<link rel="stylesheet" href="style.css">
5+
</head>
26

3-
<h1>Username</h1>
4-
<input type="text" id="username" name="username"><br><br>
7+
<body>
8+
<div class="content">
9+
<h5>Username</h5>
10+
<input type="text" id="username" name="username">
11+
<br><br>
12+
<h2>Type something</h2>
13+
<div class="chatBox">
14+
<ul style="list-style-type:none;" id="msgList">
15+
</ul>
16+
<div>
17+
<input type="text" id="message" name="message">
18+
<input type="submit" value="Send" onclick="submit()">
19+
</div>
20+
</div>
521

6-
<h1>Message</h1>
7-
<input type="text" id="message" name="message"><br><br>
822

9-
<input type="submit" value="Send" onclick="submit()">
1023

11-
<ul style="list-style-type:none;" id="msgList">
12-
13-
</ul>
1424

15-
<script src="./script.js">
25+
<!-- <h1>Message</h1> -->
26+
<!-- <input type="text" id="message" name="message"><br><br> -->
1627

17-
</script>
28+
29+
30+
<script src="./script.js">
31+
32+
</script>
33+
</div>
34+
</body>
35+
</html>

server.rb

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
server = TCPServer.new(4141)
77
puts "Listening on port 4141"
88

9-
messages = FifoCache.new(10)
10-
# messages = Queue.new
9+
messages = FifoCache.new(10)
1110

1211
loop {
13-
#get our inital connection
14-
#client = server.accept
12+
#get our inital connection puts it on a thread
1513
Thread.start(server.accept) do |client|
16-
#client = server.accept
1714
puts Thread.current
1815
#grab verbage and path requested
1916
method, path = client.gets.split
@@ -38,6 +35,19 @@
3835
client.puts(headersjs)
3936
client.puts(respjs)
4037

38+
elsif (path == '/style.css')
39+
#load file
40+
respcss = File.read('./style.css')
41+
#grab header
42+
headerscss = ["HTTP/1.1 201 OK",
43+
"Server: Ruby",
44+
"Content-Type: text/css; charset=utf-8",
45+
"Sending: css",
46+
"Content-Length: #{respcss.length}\r\n\r\n"].join("\r\n")
47+
#serve content
48+
client.puts(headerscss)
49+
client.puts(respcss)
50+
4151
#return message data structure as json
4252
elsif (path == '/messages')
4353
resp = []
@@ -90,9 +100,6 @@
90100

91101
data = client.read(reqHeaders["Content-Length"].to_i)
92102

93-
#puts data
94-
#puts client.gets
95-
96103
respHeaders = ["HTTP/1.1 200 OK"]
97104

98105
#print the headers

style.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
body {
2+
background: black;
3+
display: grid;
4+
justify-items: center;
5+
}
6+
7+
h5 {
8+
margin-bottom: 10px;
9+
}
10+
11+
.chatBox {
12+
color: white;
13+
background-color: #8c8c8c52;
14+
padding: 10px;
15+
margin-left: 25%;
16+
margin-right: 25%;
17+
}
18+
19+
.content {
20+
color: white;
21+
font: 1.3rem Inconsolata, monospace;
22+
background-color: black;
23+
background-image: radial-gradient(
24+
rgba(0, 150, 0, 0.75), black 120%
25+
);
26+
text-shadow: 0 0 5px #C8C8C8;
27+
height: 82vh;
28+
width: 61vw;
29+
display: grid;
30+
align-items: center;
31+
justify-items: center;
32+
align-content: center;
33+
border-radius: 40px;
34+
box-shadow: 0 0 50px 50px #221717;
35+
&::after {
36+
content: "";
37+
position: absolute;
38+
top: 0;
39+
left: 0;
40+
width: 100vw;
41+
height: 100vh;
42+
background: repeating-linear-gradient(
43+
0deg,
44+
rgba(black, 0.15),
45+
rgba(black, 0.15) 1px,
46+
transparent 1px,
47+
transparent 2px
48+
);
49+
}
50+
}
51+
52+

0 commit comments

Comments
 (0)