From dd3044bf459ea88d22ea345487a78bbc2ac7adf8 Mon Sep 17 00:00:00 2001 From: sweatshirt0 Date: Mon, 6 Feb 2023 00:31:27 -0500 Subject: [PATCH] contact page creation and minor css change. --- pages/about.html | 1 + pages/contact.html | 22 ++++++++++++++++++++++ pages/home.html | 1 + server.js | 18 +++++++++++++++++- styles/styles.css | 2 +- 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 pages/contact.html diff --git a/pages/about.html b/pages/about.html index ac6d860..3d49455 100644 --- a/pages/about.html +++ b/pages/about.html @@ -10,6 +10,7 @@

About /376chan

diff --git a/pages/contact.html b/pages/contact.html new file mode 100644 index 0000000..ac38ad8 --- /dev/null +++ b/pages/contact.html @@ -0,0 +1,22 @@ + + + + + Contact Me. + + + +
+ +
+

IRC

+

Libcasa: sweatshirt, samsepi0l

+ Libera: sweatshirt

+
+
+ + diff --git a/pages/home.html b/pages/home.html index 59cf327..37545c4 100644 --- a/pages/home.html +++ b/pages/home.html @@ -11,6 +11,7 @@

/376chan

diff --git a/server.js b/server.js index 8c2a430..01e14d2 100644 --- a/server.js +++ b/server.js @@ -53,6 +53,7 @@ const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader("Content-Type", "text/json"); var body = ""; + var i = 1; req.on("data", function(data) { body = body + data; @@ -61,7 +62,7 @@ const server = http.createServer((req, res) => { req.on("end", function() { var post = qs.parse(body); if (post.username === json[0].username && post.password === json[0].password) { - res.writeHead(301, { Location: "/sweatshirt" }); + res.writeHead(301, { Location: "/" + post.username }); } else { res.writeHead(301, { Location: "/wrongInfo" }); } @@ -100,6 +101,21 @@ const server = http.createServer((req, res) => { }); } + if (req.url === "/contact") { + res.statusCode = 200; + res.setHeader("Content-Type", "text/html"); + fs.readFile("./pages/contact.html", function(error, data) { + if (error) { + res.writeHead(404); + res.write("Error: File not found."); + } else { + res.write(data); + } + + res.end(); + }); + } + }); const port = process.env.port || 8080; diff --git a/styles/styles.css b/styles/styles.css index 152e351..916a347 100644 --- a/styles/styles.css +++ b/styles/styles.css @@ -88,7 +88,7 @@ body { position: relative; float: left; top: -215px; - left: 450px; + left: 435px; border: 1px solid black; border-radius: 5px; background-color: #fff;