added 404

This commit is contained in:
grant-kun 2022-10-10 20:27:41 -05:00
parent 5bc1f63580
commit 75ced388a6
3 changed files with 196 additions and 15 deletions

176
html/404.html Normal file
View file

@ -0,0 +1,176 @@
<html>
<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oxygen+Mono&family=Source+Code+Pro&display=swap"
rel="stylesheet">
<style>
body {
background-color: darkslateblue;
font-family: 'Oxygen Mono', monospace;
display: flex;
align-self: center;
padding: 30px;
}
h5 {
font-size: 88;
font-family: 'Oxygen Mono', monospace;
}
.wrapper {
display: flex;
align-self: center;
}
.a {
margin-left: 30px;
}
a:link {
color: peachpuff;
}
/* visited link */
a:visited {
color: peachpuff;
}
/* mouse over link */
a:hover {
color: peachpuff;
}
/* selected link */
a:active {
color: peachpuff;
}
#sowwy {
align-self: none;
display: block;
position: fixed;
top: 60%;
left: 5%;
margin: 0px;
}
.coollines {
border-style: solid;
border-spacing: 20px;
border-width: 2px;
padding: 5px;
}
.bl1 {
border-style: dotted none none none;
border-color: aquamarine;
border-spacing: 20px;
border-width: 2px;
padding: 5px;
width: 100%;
position: fixed;
top: 18%;
left: 0%;
}
.bl2 {
border-style: dotted none none none;
border-color: aquamarine;
border-spacing: 20px;
border-width: 2px;
padding: 5px;
width: 100%;
position: fixed;
top: 34%;
left: 0%;
}
.bl3 {
border-style: none dotted none none;
border-color: aquamarine;
border-spacing: 20px;
border-width: 2px;
padding: 5px;
height: 100%;
position: fixed;
top: 0%;
left: 22%;
}
.bl4 {
border-style: none dotted none none;
border-color: aquamarine;
border-spacing: 20px;
border-width: 2px;
padding: 5px;
height: 100%;
position: fixed;
top: 0%;
left: 88.5%;
}
</style>
</head>
<body onload="load()">
<h5>
404<sub style="font-size:30px">418 <sub style="font-size:10px"></br>i am infact a teapot</sub></sub>
</h5></br>
<!--
either i dont know this page, or i cant give it to you! <sub><i>no hard feelings
i hope!</i></sub>-->
<div class="bl1"></div>
<div class="bl2"></div>
<div class="bl3"></div>
<div class="bl4"></div>
<div class="wrapper">
<span class="a">
<div class="coollines ">
either i dont know this page, or i cant give it to you! <sub><i>no hard feelings
i hope!</i></sub>
<span class="a"></br>
<sub><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">what could it be?
400,401,403,404,405,408,429 (or 500-511 for server fault)</a></sub>
</br><sub><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status">what is it not? 402
&
200-299 (duh)</a></sub>
</span>
</div>
</div>
</span>
</div>
<script>
function load() {
document.getElementsByClassName('bl1')[0].style.top = (document.getElementsByClassName('coollines')[0].getBoundingClientRect().top - 15) + 'px'
document.getElementsByClassName('bl2')[0].style.top = (document.getElementsByClassName('coollines')[0].getBoundingClientRect().bottom + 15) + 'px'
document.getElementsByClassName('bl3')[0].style.left = (document.getElementsByClassName('coollines')[0].getBoundingClientRect().left - 20) + 'px'
document.getElementsByClassName('bl4')[0].style.left = (document.getElementsByClassName('coollines')[0].getBoundingClientRect().right) + 'px'
setInterval(() => {
document.getElementsByClassName('bl1')[0].style.top = (document.getElementsByClassName('coollines')[0].getBoundingClientRect().top - 15) + 'px'
document.getElementsByClassName('bl2')[0].style.top = (document.getElementsByClassName('coollines')[0].getBoundingClientRect().bottom + 15) + 'px'
document.getElementsByClassName('bl3')[0].style.left = (document.getElementsByClassName('coollines')[0].getBoundingClientRect().left - 20) + 'px'
document.getElementsByClassName('bl4')[0].style.left = (document.getElementsByClassName('coollines')[0].getBoundingClientRect().right) + 'px'
}, 30)
setTimeout(async () => {
document.getElementById('sowwy').innerHTML += 'here! ill ask if them i can tell you the code:)</br>'
setInterval(() => {
document.getElementById('sowwy').innerHTML += 'they said no</br>'
}, 2000)
}, 2000)
}
</script>
</body>
<div id="sowwy">
</div>
</html>

View file

@ -92,21 +92,9 @@ app.get('/mail', (req:any, res:any) => {
res.sendFile(__dirname+'/html/mail.html')
})
//http
var httpServer = http.createServer(app);
var credentials = {key: privateKey, cert: certificate};
var httpsServer = https.createServer(credentials, app);
app.listen(8080,()=>{
log(`kanna is local http://${ip.address()}:8080`)
})
httpServer.listen(80, () => {
log(`kanna is on http://${ip.address()} click on me click on me! :3`)
})
httpsServer.listen(443, () => {
log(`kanna is secure now too!! https://${ip.address()}`)
})
//end
app.get('/', (req:any, res:any) => {
console.log('test')
res.sendFile(__dirname+"/html/index.html")
})
app.get('/kanna.txt', (req:any, res:any) => {
@ -157,7 +145,23 @@ app.post('/login/submit', async (req:{body:{json:boolean,enc:boolean,data:string
}
}
})
app.use((req:any, res:any, next:any) => {
res.status(418).sendFile(__dirname+'/html/404.html')
})
//http
var httpServer = http.createServer(app);
var credentials = {key: privateKey, cert: certificate};
var httpsServer = https.createServer(credentials, app);
app.listen(8008,()=>{
log(`kanna is local http://${ip.address()}:8080`)
})
httpServer.listen(80, () => {
log(`kanna is on http://${ip.address()} click on me click on me! :3`)
})
httpsServer.listen(443, () => {
log(`kanna is secure now too!! https://${ip.address()}`)
})
//end
/*let l = (encrypt(JSON.stringify({
'emails':[{
'address':'grantsquires@disroot.org',

View file

@ -24,6 +24,7 @@ visit the [main git](https://git.disroot.org/grantsquires/kanna-site) or the [gi
- [ ] login
- [ ] performance related
- [ ] store all listeners in array and kill
- [ ] go through all html files, clean up code
## currently