Initial commit of framework

This commit is contained in:
2020-11-01 12:50:03 -06:00
commit ad0abe5b84
47 changed files with 5416 additions and 0 deletions

7
app/views/errors/400.pug Normal file
View File

@@ -0,0 +1,7 @@
extends error
block head
title Bad Request | #{_app ? _app.name : 'Flitter'}
block message
p.flitter-name 400: Bad Request

7
app/views/errors/401.pug Normal file
View File

@@ -0,0 +1,7 @@
extends error
block head
title Access Denied | #{_app ? _app.name : 'Flitter'}
block message
p.flitter-name 401: Access Denied

7
app/views/errors/403.pug Normal file
View File

@@ -0,0 +1,7 @@
extends error
block head
title Forbidden | #{_app ? _app.name : 'Flitter'}
block message
p.flitter-name 403: Forbidden

7
app/views/errors/404.pug Normal file
View File

@@ -0,0 +1,7 @@
extends error
block head
title Not Found | #{_app ? _app.name : 'Flitter'}
block message
p.flitter-name 404: Not Found

9
app/views/errors/418.pug Normal file
View File

@@ -0,0 +1,9 @@
extends error
block head
title I'm a Teapot | #{_app ? _app.name : 'Flitter'}
block message
p.flitter-name
a(href='https://en.wikipedia.org/wiki/HTTP_418') 418: I'm a Teapot
p.flitter-name Thank you for using Flitter. How'd you get here, anyway?

7
app/views/errors/500.pug Normal file
View File

@@ -0,0 +1,7 @@
extends error
block head
title Internal Server Error | #{_app ? _app.name : 'Flitter'}
block message
p.flitter-name 500: Internal Server Error

View File

@@ -0,0 +1,47 @@
html
head
title Uh-Oh! | #{_app ? _app.name : 'Flitter'}
style(type="text/css").
@import url('https://fonts.googleapis.com/css?family=Rajdhani');
@import url('https://fonts.googleapis.com/css?family=Oxygen+Mono');
html,
body {
background-color: #c7dbdf;
font-family: "Rajdhani",sans-serif;
padding-left: 2%;
padding-top: 2%;
}
p {
font-family: "Oxygen Mono",sans-serif;
font-size: 14pt;
}
body
h1 Error: #{error ? error.message : (message ? message : 'An unknown error has occurred.')}
h3 Status: #{error ? error.status : (status ? status : 500)}
h4#errmsg
if error
p !{error.stack.replace(/\n/g, '<br>')}
script.
const errors = [
'Insert your Windows installation disc and restart your computer.',
'I am a teapot.',
'Printing not supported on this printer.',
'Keyboard not found. Press F1 to continue.',
'Bailing out. You\'re on your own. Good luck.',
'A team of highly trained monkeys is on its way.',
'Well.... something happened.',
'Beats the hell out of me, but something went wrong.',
'Yeaaaaah... if you could, like, not, that\'d be great.',
'I\'m fine. Everything is fine.',
'Blocked by Windows Parental Controls.',
'This is not the bug you\'re looking for.',
'Houston, we have a problem.',
'I don\'t think we\'re in Kansas anymore...',
'Please enable ActiveX to continue. ;)',
'Your PC ran into a wall.',
'Are you on drugs?',
'Error: Success',
]
document.getElementById('errmsg').innerHTML = errors[Math.floor(Math.random()*errors.length)]

View File

@@ -0,0 +1,33 @@
html
head
block head
style(type="text/css").
@import url('https://fonts.googleapis.com/css?family=Rajdhani');
html,
body {
height: 100%;
overflow-y: hidden;
background-color: #c7dbdf;
}
.flitter-container {
height: 60%;
display: flex;
align-items: center;
justify-content: center;
}
.flitter-image {
height: 150px;
}
.flitter-name {
font-family: "Rajdhani";
font-size: 50pt;
margin-left: 35px;
color: #00323d;
}
body
.flitter-container
img.flitter-image(src="/assets/flitter.png")
block message

46
app/views/welcome.pug Normal file
View File

@@ -0,0 +1,46 @@
html
head
title #{T('welcome')} | #{_app.name}
style(type="text/css").
@import url('https://fonts.googleapis.com/css?family=Rajdhani');
html,
body {
height: 100%;
overflow-y: hidden;
background-color: #c7dbdf;
}
.flitter-container {
height: 60%;
display: flex;
align-items: center;
justify-content: center;
}
.flitter-image {
height: 150px;
}
.flitter-name {
font-family: "Rajdhani";
font-size: 50pt;
margin-left: 35px;
color: #00323d;
text-decoration: none;
}
.flitter-text {
font-family: "Rajdhani";
font-size: 24pt;
color: #00323d;
}
body
.flitter-container
img.flitter-image(src="/assets/flitter.png")
a.flitter-name(href="https://flitter.garrettmills.dev/" target="_blank") #{T('powered_by_flitter')}
if user
.flitter-container
p.flitter-text #{T('welcome')}, #{user.uid}! <a href="/auth/logout">#{T('log_out')}</a>
else
.flitter-container
p.flitter-text #{T('new_to_flitter')} <a href="https://flitter.garrettmills.dev/" target="_blank">#{T('start_here')}</a>