commit ce149890d27332369fd78a0075a1c3c7f542e353 Author: TudbuT Date: Thu Sep 19 20:59:04 2024 +0200 Initial commit diff --git a/404.html b/404.html new file mode 100644 index 0000000..db32037 --- /dev/null +++ b/404.html @@ -0,0 +1 @@ +

404

diff --git a/features.html b/features.html new file mode 100644 index 0000000..11f1e70 --- /dev/null +++ b/features.html @@ -0,0 +1,3 @@ +

BaseBand's features

+ +Lorem ipsum diff --git a/index.html b/index.html new file mode 100644 index 0000000..d7b3a47 --- /dev/null +++ b/index.html @@ -0,0 +1,8 @@ +

BaseBand

+A strong client modification for Minecraft. +
+
+BaseBand aims to be an easy-to-use yet very extensively configurable client for anarchy servers. +
+
+Features diff --git a/lorem-ipsum b/lorem-ipsum new file mode 100644 index 0000000..b1ef620 --- /dev/null +++ b/lorem-ipsum @@ -0,0 +1,9 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam egestas ex nisi, ac rhoncus orci suscipit eu. Cras id dolor egestas, molestie sem ut, imperdiet libero. Cras mollis orci a sapien gravida sodales. Nulla facilisi. Phasellus ultrices, odio vitae suscipit semper, quam justo sodales lectus, eget lacinia nisl leo ac turpis. Suspendisse rhoncus tincidunt rutrum. Etiam hendrerit urna a neque ullamcorper varius. Mauris id molestie orci. Quisque ac ipsum risus. Nulla facilisi. Curabitur sit amet neque sit amet leo semper tincidunt eget ac quam. Pellentesque consequat massa eget nibh rhoncus, vel elementum purus fringilla. + +Etiam et porta quam. Fusce laoreet viverra semper. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a bibendum ex, pharetra vestibulum sem. Aenean ex sem, feugiat quis maximus placerat, pharetra id est. Donec semper mi eget varius sagittis. Pellentesque sit amet felis placerat, congue tortor mollis, vulputate felis. Etiam tempor diam vitae nibh egestas egestas. Quisque hendrerit massa ut ante aliquet mollis. Suspendisse mattis massa interdum, vestibulum magna a, dapibus purus. Suspendisse ac ipsum in eros auctor consequat. Aliquam ac lectus sed orci blandit pellentesque eget at quam. Phasellus quis porttitor nisl, a ultrices sem. + +Morbi lacinia imperdiet neque vitae semper. Morbi sit amet vulputate nisi. Quisque sollicitudin eu dolor et ultrices. Quisque nibh ligula, maximus ac sem vitae, aliquet posuere elit. Quisque quis sapien enim. Praesent et vestibulum nunc. Etiam dictum diam sit amet lorem condimentum, in sollicitudin nisi auctor. In tincidunt dictum convallis. Quisque ut nulla id odio placerat varius. Aenean pretium tincidunt hendrerit. Suspendisse cursus consequat hendrerit. Pellentesque rhoncus imperdiet congue. Etiam dictum nunc arcu, nec ultricies orci vulputate nec. Curabitur euismod augue metus, a iaculis arcu ornare vel. + +In nisl ipsum, condimentum eget nisl et, aliquet aliquet ligula. Ut eget urna vitae felis volutpat maximus id non turpis. Duis lacinia at nisi et consectetur. Donec consectetur eu quam eu varius. Donec maximus molestie nisi eget sollicitudin. Etiam dapibus mi sed tortor suscipit ornare. Ut lectus nisi, iaculis eget tellus non, gravida egestas nibh. Quisque scelerisque ullamcorper libero a mollis. Quisque sed dapibus sem. + +Nunc enim sem, efficitur at quam vitae, ultricies auctor neque. Ut quis libero non augue venenatis consequat. Donec quis velit metus. Nullam eget leo eu massa bibendum consectetur. Aliquam volutpat non leo quis venenatis. Fusce iaculis massa quis magna hendrerit, at feugiat ex ultricies. Phasellus ligula sapien, finibus et tempus quis, finibus vitae elit. Nunc sit amet purus non ligula vulputate commodo. diff --git a/server.spl b/server.spl new file mode 100644 index 0000000..e84bafd --- /dev/null +++ b/server.spl @@ -0,0 +1,57 @@ +"#http/server.spl" import + +func destub { html | with html title ; + stub.html + :replace<"+title" title> + :replace<"+body" html> + :replace<"Lorem ipsum" lorem-ipsum> +} + +def lorem-ipsum "lorem-ipsum" read-file:replace<"\n" "
"> =lorem-ipsum + +def stub.html "stub.html" read-file =stub.html +def style.css "style.css" read-file =style.css +def 404.html "404.html" read-file destub<"404"> =404.html + +def index.html "index.html" read-file destub<"Home"> =index.html +def features.html "features.html" read-file destub<"Features"> =features.html + +func main { mega | with args ; + def server net:http:Server:new<"localhost" 13130> =server + + "server is listening on 13130" println; + + while { 1 } { + server:accept { | with client ; + catch { + client:read; + + client handle-client; + } { with err ; + "A request has errored out with " err:message concat println; + "at: " println; + &println err:trace:foreach; + } + } fork pop + } + + 0 +} + +func handle-client { | with client ; + client:path "/" eq if { + index.html client:write-ok:write-html-body:finish; + 2 stop + } + client:path "/features" eq if { + features.html client:write-ok:write-html-body:finish; + 2 stop + } + + client:path "/style.css" eq if { + style.css client:write-ok:write-content-type<"text/css">:write-str-body:finish; + 2 stop + } + + 404.html client:write-head<404 "Not found">:write-html-body:finish; +} diff --git a/stub.html b/stub.html new file mode 100644 index 0000000..82e630c --- /dev/null +++ b/stub.html @@ -0,0 +1,12 @@ + + + + + + + BaseBand - +title + + + +body + + diff --git a/style.css b/style.css new file mode 100644 index 0000000..1c08b17 --- /dev/null +++ b/style.css @@ -0,0 +1,71 @@ +html { + margin: 0; + background-color: #502060; + color: #00cccc; + font-family: Monocraft monospace; +} +body { + margin: auto; + display: block; + width: min(700px, 90vw); + margin-top: min(10em, 30vh); + margin-bottom: min(10em, 30vh); +} +a { + color: #00ffff; +} + +a.btn { + background-color: #603060; + display: inline-block; + width: 10em; + max-width: calc(100vw - 30px); + min-width: fit-content; + padding: 10px; + margin: 0; + text-decoration: none; + text-align: center; + transition: 0.2s; +} +a.btn:hover { + background-color: #605070; +} + +form { + background-color: #425; + padding: 10px; + margin: 20px auto 20px auto; + width: fit-content; +} +label { + text-align: right; + display: block; +} +input { + height: 2em; + margin-bottom: 0.5em; + border: 0; + background-color: #000; + color: #f0f; +} +button { + background-color: #a0a; + color: #000; + border: 0; + width: 100%; + height: 2em; + cursor: pointer; + transition: 0.2s; +} +button:hover { + background-color: #909; +} + +div.error { + background-color: #913; + color: #fff; + display: block; + width: calc(100% - 60px); + padding: 15px; + margin: 15px; +}