From d707e203cded3f4a798f3a8896f375b32ad6bd22 Mon Sep 17 00:00:00 2001 From: Sequoia Haynes Date: Wed, 30 Oct 2024 22:29:14 -0700 Subject: [PATCH] make the footer good --- css/index.css | 31 +++++++++++++++++++++++------ index.html | 17 +++++++++------- runTest.bat | 24 ++++++++++++++++++++++ test.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 114 insertions(+), 13 deletions(-) create mode 100644 runTest.bat create mode 100644 test.js diff --git a/css/index.css b/css/index.css index 420a995..c90ddf9 100644 --- a/css/index.css +++ b/css/index.css @@ -63,7 +63,6 @@ button { .source-btn { background-color: #333333; color: white; - padding: 10px 20px; font-size: 16px; cursor: pointer; border: none; @@ -168,21 +167,24 @@ button:hover { display:flex; flex-wrap:wrap; flex-flow:wrap-reverse; - align-content: space-evenly - + align-items: center; } -.footer a { +#footerButtons a { font-size:12px; padding: 10px 10px; cursor: pointer; border: none; border-radius: 5px; - margin: 10px auto; + /*bro i hate working with this footer like i swear this css has commander games page level stability + /* margin: 10px auto; */ text-decoration: none; display: inline-block; max-width: 200px; background-color:#d9d9d9 !important; - color:#000000 important; + color:#000000 !important; + height:15px; + padding: 10px 20px; + margin:10px; } .recommended { vertical-align: middle; @@ -196,3 +198,20 @@ button:hover { font-style: normal; color:#ffffff; } +#footerButtons { + display: flex; + align-items: center; + flex-direction: row; + justify-content:center; + width:100%; + height:15px; +} +#footerText { + display:flex; + flex-direction: column; + width:100%; + margin-bottom: 5px; +} +#footerText > p { + margin:0; +} \ No newline at end of file diff --git a/index.html b/index.html index e3884dc..744bdd6 100644 --- a/index.html +++ b/index.html @@ -90,13 +90,16 @@ diff --git a/runTest.bat b/runTest.bat new file mode 100644 index 0000000..ad5ef0c --- /dev/null +++ b/runTest.bat @@ -0,0 +1,24 @@ + +:: amazing script i totally didnt write with bing ai because i have no idea how the syntax of batch works +:: Attempt to run with Node.js +node test.js +if %errorlevel% EQU 0 ( + echo Node.js executed successfully. + exit /b +) +:: Attempt to run with Deno +deno run test.js +if %errorlevel% EQU 0 ( + echo Deno executed successfully. + exit /b +) +:: Attempt to run with Bun (assuming you have Bun installed) +bun run test.js +if %errorlevel% EQU 0 ( + echo Bun executed successfully. + exit /b +) +:: If none of the runtimes are available +echo Please install a valid Node.js runtime. +pause +exit /b \ No newline at end of file diff --git a/test.js b/test.js new file mode 100644 index 0000000..3ed7be7 --- /dev/null +++ b/test.js @@ -0,0 +1,55 @@ +const http = require("http"); +const fs = require("fs"); +const path = require("path"); +http.createServer(async function(request,response){ + var parth = path.dirname(__filename) + request.url; + fs.readFile(parth, "utf8", function(err,data){ + if(err){ + response.writeHead(404,{"Content-Type":"text/html"}); + var notFoundFIle; + fs.readFile(path.dirname(__filename)+"\\404.html", "utf8", function(error,dat){ + if(error){ + response.end("404.html wasnt found, something is wrong"); + return; + }else{ + notFoundFIle = dat; + response.end(notFoundFIle); + } + }); + }else{ + var filetype = path.extname(parth).substring(1,path.extname(parth).length); + var isImage = false; + if(filetype=="html"){ + response.writeHead(200,{"Content-Type":"text/html"}); + }else{ + if(filetype=="css"){ + response.writeHead(200,{"Content-Type":"text/css"}); + }else{ + if(filetype=="js"){ + response.writeHead(200,{"Content-Type":"text/js"}); + }else{ + if(filetype=="jpeg"){ + response.writeHead(200,{"Content-Type":"image/jpeg"}); + isImage = true; + }else{ + if(filetype=="svg"){ + response.writeHead(200,{"Content-Type":"image/svg+xml"}); + isImage = true; + }else{ + if(filetype=="png"){ + response.writeHead(200,{"Content-Type":"image/png"}); + isImage = true; + } + } + } + } + } + } + if(!isImage){ + response.end(data,"utf8"); + }else{ + fs.createReadStream(parth).pipe(response); + } + } + }); +}).listen(80); \ No newline at end of file