Edited the default style
This commit is contained in:
parent
3cacd5634d
commit
9934fba5f6
2 changed files with 148 additions and 4 deletions
122
default.css
Normal file
122
default.css
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
This file could be used under both CC-BY-SA 4.0 or at your chosing GNU GPLv3 or any later version
|
||||
*/
|
||||
|
||||
html {}
|
||||
|
||||
* {
|
||||
background-color: #311a46;
|
||||
font-size: 20px;
|
||||
list-style-type: none;
|
||||
|
||||
}
|
||||
|
||||
body{
|
||||
color: #95bcf2;
|
||||
font-family:Open Sans;
|
||||
font-weight: bold;
|
||||
|
||||
margin-top: 5%;
|
||||
margin-bottom: 5%;
|
||||
margin-right: 20%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Open-Sans-Extrabold" Open Sans;
|
||||
/*src: url(/font);*/
|
||||
}
|
||||
|
||||
pre {
|
||||
/*background: #a89984;*/
|
||||
border: 10px solid #928374;
|
||||
border-radius: 10px;
|
||||
padding: 1em;
|
||||
margin: 1em;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 30px;
|
||||
color: #CC35F0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 25px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 22px;
|
||||
color: #3798DD;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: #9B744E;
|
||||
/*border: 5px solid #928374;*/
|
||||
border-radius: 5px;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
ul li {
|
||||
list-style: inside circle;
|
||||
display:list-item;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border: 2px solid #7c6f64;
|
||||
}
|
||||
|
||||
th,td {
|
||||
border: 2px solid #7c6f64;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #C648EA;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #DB82F4;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 50%;
|
||||
height: auto;
|
||||
}
|
||||
input[type=text] {
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
box-sizing: border-box;
|
||||
border: 0px solid black;
|
||||
background-color: #b058c6;
|
||||
color: #311a46;
|
||||
font-weight: bold;
|
||||
}
|
||||
button {
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
box-sizing: border-box;
|
||||
border: 0px solid black;
|
||||
background-color: #b058c6;
|
||||
color: #311a46;
|
||||
font-weight: bold;
|
||||
}
|
||||
summary {
|
||||
color: #b058c6;
|
||||
font-weight: bold;
|
||||
}
|
||||
summary:hover, summary:hover > h1 {
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover, input:hover, button:focus, input:focus {
|
||||
background-color: #3798DD;
|
||||
color: white;
|
||||
}
|
||||
|
||||
hr {
|
||||
border-top: 1px solid #b058c6;
|
||||
}
|
||||
|
30
server.py
30
server.py
|
@ -66,7 +66,7 @@ else:
|
|||
"INFO" : "You would be better off setting address to the full URL of the FreeCompetitors instance.",
|
||||
"address" : "/",
|
||||
"port" : 8080,
|
||||
"css" : "https://zortazert.codeberg.page/style/safety.css"
|
||||
"css" : "/css"
|
||||
}""")
|
||||
newConfig.close
|
||||
print(bcolors.WARNING + "Please edit the configuration file \"config.json\"." + bcolors.RESET)
|
||||
|
@ -78,10 +78,14 @@ class handler(BaseHTTPRequestHandler):
|
|||
|
||||
def start_page(self):
|
||||
self.send_response(200)
|
||||
if "/json/" not in self.path:
|
||||
self.send_header('Content-type', 'text/html')
|
||||
else:
|
||||
if "/json/" in self.path:
|
||||
self.send_header('Content-type', 'application/json')
|
||||
elif self.path == "/css":
|
||||
self.send_header('Content-type', 'text/css')
|
||||
elif self.path == "/ttf":
|
||||
self.send_header('Content-type', 'font/ttf')
|
||||
else:
|
||||
self.send_header('Content-type', 'text/html')
|
||||
self.end_headers()
|
||||
|
||||
def send(self, text):
|
||||
|
@ -121,6 +125,24 @@ class handler(BaseHTTPRequestHandler):
|
|||
page = render.source_code_link(page)
|
||||
self.send(page)
|
||||
|
||||
elif self.path == "/css":
|
||||
|
||||
# The css file
|
||||
|
||||
cssfile = open("default.css")
|
||||
cssfile = cssfile.read()
|
||||
self.send(cssfile)
|
||||
|
||||
elif self.path == "/font":
|
||||
|
||||
# The font file
|
||||
|
||||
fontfile = open("OpenSans-ExtraBold.ttf", "rb")
|
||||
fontfile = fontfile.read()
|
||||
self.send(fontfile)
|
||||
|
||||
|
||||
|
||||
elif "/search?item=" in self.path:
|
||||
|
||||
# Clearing the url
|
||||
|
|
Loading…
Reference in a new issue