diff --git a/captcha.sh b/captcha.sh index 7885858..f929e72 100755 --- a/captcha.sh +++ b/captcha.sh @@ -90,4 +90,4 @@ convert -size 180x60 xc:none -pointsize 40 \ -strokewidth 2 -draw "line 0,$W2_LINE_START_Y 140,$W2_LINE_STOP_Y" \ -strokewidth 2 -draw "line 0,$W3_LINE_START_Y 140,$W3_LINE_STOP_Y" \ -wave "$WAVE3_AMPLITUDE"x"$WAVE3_LENGTH" \) \ - -flatten -crop 140x60 +repage -quality 90 -depth 8 png:- + -flatten -crop 140x60 +repage -quality 100 -depth 8 png:- diff --git a/index.js b/index.js index 411aa58..796c5e3 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,8 @@ +import { dbInit } from './libs/database.js' import dotenv from 'dotenv' import express from 'express' - +import njk from 'nunjucks' import ROUTES from './routes/routes.js' -import { dbInit } from './libs/database.js' dotenv.config() @@ -16,6 +16,16 @@ APP.use('/static', express.static('static')) APP.use('/', ROUTES) +njk.configure( + 'views', + { + autoescape: true, + lstripBlocks: true, + trimBlocks: true, + express: APP, + } +) + APP.listen( PORT, () => console.log('Server started at http://localhost:' + PORT) diff --git a/libs/database.js b/libs/database.js index 8df2312..8f23bfb 100644 --- a/libs/database.js +++ b/libs/database.js @@ -3,7 +3,7 @@ import SQLDatabase from 'better-sqlite3' export let glauth = undefined export function dbInit() { - glauth = new SQLDatabase(process.env.GLAUTH_DB, {}) + glauth = new SQLDatabase(process.env.GLAUTH_DB ?? 'auth.db', {}) console.log(`Loaded in GLAuth - users.db`) } \ No newline at end of file diff --git a/package.json b/package.json index 1e1cb4a..e1d04fb 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "better-sqlite3": "^7.4.6", "dotenv": "^12.0.3", - "express": "^4.17.2" + "express": "^4.17.2", + "nunjucks": "^3.2.3" } } diff --git a/routes/routes.js b/routes/routes.js index 7f7da21..30364e7 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -3,7 +3,7 @@ import AUTH from './auth.js' const ROUTES = Router() -ROUTES.get('/', (_, res) => res.send("Welcome!")) +ROUTES.get('/', (_, res) => res.render("pages/landing.njk")) ROUTES.use('/auth', AUTH) export default ROUTES \ No newline at end of file diff --git a/static/Manrope/Manrope-Bold.ttf b/static/Manrope/Manrope-Bold.ttf new file mode 100644 index 0000000..23e6a4e Binary files /dev/null and b/static/Manrope/Manrope-Bold.ttf differ diff --git a/static/Manrope/Manrope-ExtraBold.ttf b/static/Manrope/Manrope-ExtraBold.ttf new file mode 100644 index 0000000..b650e68 Binary files /dev/null and b/static/Manrope/Manrope-ExtraBold.ttf differ diff --git a/static/Manrope/Manrope-ExtraLight.ttf b/static/Manrope/Manrope-ExtraLight.ttf new file mode 100644 index 0000000..60df426 Binary files /dev/null and b/static/Manrope/Manrope-ExtraLight.ttf differ diff --git a/static/Manrope/Manrope-Light.ttf b/static/Manrope/Manrope-Light.ttf new file mode 100644 index 0000000..fdf64b7 Binary files /dev/null and b/static/Manrope/Manrope-Light.ttf differ diff --git a/static/Manrope/Manrope-Medium.ttf b/static/Manrope/Manrope-Medium.ttf new file mode 100644 index 0000000..f3a1dc9 Binary files /dev/null and b/static/Manrope/Manrope-Medium.ttf differ diff --git a/static/Manrope/Manrope-Regular.ttf b/static/Manrope/Manrope-Regular.ttf new file mode 100644 index 0000000..7fdc456 Binary files /dev/null and b/static/Manrope/Manrope-Regular.ttf differ diff --git a/static/Manrope/Manrope-SemiBold.ttf b/static/Manrope/Manrope-SemiBold.ttf new file mode 100644 index 0000000..cd46e55 Binary files /dev/null and b/static/Manrope/Manrope-SemiBold.ttf differ diff --git a/static/css/colors.css b/static/css/colors.css new file mode 100644 index 0000000..b934a6a --- /dev/null +++ b/static/css/colors.css @@ -0,0 +1,109 @@ +:root { + /* COLORS */ + --red: #EF5255; + --red1: #BF3638; + --red2: #D5484A; + --red3: #EF5255; + --red4: #FA7A7C; + --red5: #FA999A; + + --orange: #EB801B; + --orange1: #AF6118; + --orange2: #DA7516; + --orange3: #EB801B; + --orange4: #F99434; + --orange5: #F9AE67; + + --yellow: #F4C025; + --yellow1: #BD920F; + --yellow2: #DFAC11; + --yellow3: #F4C025; + --yellow4: #FFD147; + --yellow5: #FFE38F; + + --pear: #AED651; + --pear1: #7D9A37; + --pear2: #96BB3E; + --pear3: #AED651; + --pear4: #C2E571; + --pear5: #DBF1A7; + + --green: #72D661; + --green1: #53A545; + --green2: #61C350; + --green3: #72D661; + --green4: #93E684; + --green5: #BCF0B2; + + --sea: #3DDF89; + --sea1: #2AA764; + --sea2: #2ACB75; + --sea3: #3DDF89; + --sea4: #5DEEA1; + --sea5: #A9F4CC; + + --cyan: #4CDCDF; + --cyan1: #2CA3A5; + --cyan2: #2DCACD; + --cyan3: #4CDCDF; + --cyan4: #6BE8EB; + --cyan5: #B7EFF0; + + --blue: #4C9CEF; + --blue1: #1C67B5; + --blue2: #2A83DF; + --blue3: #4C9CEF; + --blue4: #74B6FB; + --blue5: #A3CEFA; + + --indigo: #4C6DEF; + --indigo1: #2143CA; + --indigo2: #3457E5; + --indigo3: #4C6DEF; + --indigo4: #748FFB; + --indigo5: #B1C0FC; + + --purple: #967CF4; + --purple1: #613FD9; + --purple2: #7C5DE9; + --purple3: #967CF4; + --purple4: #BCAAFD; + --purple5: #CFC2FE; + + --magenta: #E175DB; + --magenta1: #B63AB0; + --magenta2: #D152CB; + --magenta3: #E175DB; + --magenta4: #EC9AEF; + --magenta5: #EFB1F1; + + --pink: #EE588F; + --pink1: #D0356D; + --pink2: #E2407C; + --pink3: #EE588F; + --pink4: #FA80AC; + --pink5: #FBA7C6; + + --grey1: #00001F; + --grey2: #10102F; + --grey3: #20203F; + --grey4: #30304F; + --grey5: #40405F; + --grey6: #50506F; + --grey7: #60607F; + --grey8: #70708F; + --grey9: #80809F; + --grey10: #9090AF; + --grey11: #A0A0BF; + --grey12: #B0B0CF; + --grey13: #C0C0DF; + --grey14: #D0D0EF; + --grey15: #E0E0FF; + + /* ALIASES */ + --primary: var(--sea); + --accent: var(--cyan); + --accent2: var(--blue); + --surface: var(--grey2); + --text: var(--grey15); +} \ No newline at end of file diff --git a/static/css/fonts.css b/static/css/fonts.css new file mode 100644 index 0000000..f773204 --- /dev/null +++ b/static/css/fonts.css @@ -0,0 +1,34 @@ +@font-face { + font-family: 'Manrope XLight'; + src: url('/static/Manrope/Manrope-ExtraLight.ttf'); +} + +@font-face { + font-family: 'Manrope Light'; + src: url('/static/Manrope/Manrope-Light.ttf'); +} + +@font-face { + font-family: 'Manrope Regular'; + src: url('/static/Manrope/Manrope-Regular.ttf'); +} + +@font-face { + font-family: 'Manrope Medium'; + src: url('/static/Manrope/Manrope-Medium.ttf'); +} + +@font-face { + font-family: 'Manrope SemiBold'; + src: url('/static/Manrope/Manrope-SemiBold.ttf'); +} + +@font-face { + font-family: 'Manrope Bold'; + src: url('/static/Manrope/Manrope-Bold.ttf'); +} + +@font-face { + font-family: 'Manrope XBold'; + src: url('/static/Manrope/Manrope-ExtraBold.ttf'); +} \ No newline at end of file diff --git a/static/css/scaling.css b/static/css/scaling.css new file mode 100644 index 0000000..07e45cb --- /dev/null +++ b/static/css/scaling.css @@ -0,0 +1,66 @@ +@media screen and (min-width: 1px) { + :root { + font-size: 12px; + } + +} +@media screen and (min-width: 300px) { + :root { + font-size: 13pt; + } +} +@media screen and (min-width: 400px) { + :root { + font-size: 14pt; + } +} +@media screen and (min-width: 500px) { + :root { + font-size: 15pt; + } +} +@media screen and (min-width: 600px) { + :root { + font-size: 16pt; + } +} +@media screen and (min-width: 700px) { + :root { + font-size: 17pt; + } +} +@media screen and (min-width: 802px) { + :root { + font-size: 12pt; + } +} +@media screen and (min-width: 1000px) { + :root { + font-size: 13pt; + } +} +@media screen and (min-width: 1200px) { + :root { + font-size: 14pt; + } +} +@media screen and (min-width: 1500px) { + :root { + font-size: 15pt; + } +} +@media screen and (min-width: 1800px) { + :root { + font-size: 16pt; + } +} +@media screen and (min-width: 2500px) { + :root { + font-size: 17pt; + } +} +@media screen and (min-width: 3000px) { + :root { + font-size: 19pt; + } +} diff --git a/static/css/theme.css b/static/css/theme.css new file mode 100644 index 0000000..c97e303 --- /dev/null +++ b/static/css/theme.css @@ -0,0 +1,199 @@ +* { + margin: 0; + padding: 0; + border: 0 none transparent; + + box-sizing: border-box; + scroll-behavior: smooth; + + font-family: 'Manrope Regular', sans-serif; + font-size: .85rem; + line-height: 1.5; + + color: var(--text); +} + +html { + display: grid; + place-items: center; + width: 100%; + background-color: var(--surface); +} + +body { + margin: 5vh 0 10vh 0; + width: min(90vw, 75ch); +} + +header { + color: var(--primary); + font-size: 3rem; + text-align: center; +} + +h1, h2, h3, h4, h5, h6 { + color: var(--accent); + font-weight: normal; + + margin: 1.25em 0 .25em 0; +} + +h1 { + color: var(--primary); + font-size: 2rem; +} + +h2 { + font-size: 1.65rem; +} + +h3 { + font-size: 1.35rem; +} + +h4 { + font-size: 1rem; +} + +h5 { + font-size: .85rem; +} + +h6 { + font-size: .75rem; +} + +p { + margin: .5em 0 .25em 0; + text-align: justify; + overflow-wrap: break-word; +} + +a { + color: var(--accent2); +} + +b, strong { + font-family: 'Manrope SemiBold', sans-serif; + font-weight: bold; +} + +.centered { + text-align: center; +} + +blockquote { + margin: 1rem; + padding: .5rem 1rem; + + border-left: .2rem solid var(--primary); + border-radius: 0 .5rem .5rem 0; + background-color: var(--grey3); + box-shadow: 0 1rem 2rem var(--grey1); +} + +ul, ol { + margin: 1rem 0 1rem 2rem; +} + +ul ul, ul ol, ol ol, ol ul { + margin: .25rem 0 .25rem 1rem; +} + +table { + margin: 1rem 0; + width: 100%; + + display: block; + overflow-x: auto; + white-space: nowrap; + + border-collapse: collapse; + box-shadow: 0 1rem 2rem var(--grey1); +} + +table tbody { + display: table; + width: 100%; +} + +tr { + background-color: var(--grey3); +} + +tr:nth-child(even) { + background-color: var(--grey2); +} + +th { + font-family: 'Manrope SemiBold'; +} + +th, td { + text-align: left; + vertical-align: middle; + + padding: .25rem 1rem; + border: 1px solid var(--grey4); +} + +code { + background-color: var(--grey3); + font-family: monospace; + padding: .1rem .2rem; + margin: 0 .1rem; + border-radius: .2rem; +} + +pre > code { + margin: 1rem 0; + padding: 1rem; + border-radius: .5rem; + box-shadow: 0 1rem 2rem var(--grey1); + + display: block; + overflow-x: auto; + white-space: nowrap; +} + +code * { + font-family: monospace; +} + +img { + margin: 1rem 5%; + border-radius: .5rem; + box-shadow: 0 1rem 2rem var(--grey1); +} + +img.logo { + margin: 1rem auto; + width: 30%; + box-shadow: none; +} + +.buttons { + display: flex; + flex-wrap: wrap; + /* justify-content: center; */ + margin-top: auto; +} + +.buttons > a { + color: var(--primary); + background-color: transparent; + border: .1rem solid var(--primary); + border-radius: .5rem; + margin: .5rem; + padding: .5rem 1.5rem; + display: block; + font-size: .75rem; + text-decoration: none transparent; + text-align: center; + transition: color .3s, background-color .3s; +} + +.buttons > a:hover, .buttons > a:focus { + color: var(--surface); + background-color: var(--primary); +} \ No newline at end of file diff --git a/static/favicons/android-chrome-192x192.png b/static/favicons/android-chrome-192x192.png new file mode 100644 index 0000000..ba7cee9 Binary files /dev/null and b/static/favicons/android-chrome-192x192.png differ diff --git a/static/favicons/android-chrome-512x512.png b/static/favicons/android-chrome-512x512.png new file mode 100644 index 0000000..a4bd27a Binary files /dev/null and b/static/favicons/android-chrome-512x512.png differ diff --git a/static/favicons/apple-touch-icon.png b/static/favicons/apple-touch-icon.png new file mode 100644 index 0000000..d1e86ea Binary files /dev/null and b/static/favicons/apple-touch-icon.png differ diff --git a/static/favicons/browserconfig.xml b/static/favicons/browserconfig.xml new file mode 100644 index 0000000..2773129 --- /dev/null +++ b/static/favicons/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #181833 + + + diff --git a/static/favicons/favicon-16x16.png b/static/favicons/favicon-16x16.png new file mode 100644 index 0000000..b9deaa9 Binary files /dev/null and b/static/favicons/favicon-16x16.png differ diff --git a/static/favicons/favicon-32x32.png b/static/favicons/favicon-32x32.png new file mode 100644 index 0000000..3e9952a Binary files /dev/null and b/static/favicons/favicon-32x32.png differ diff --git a/static/favicons/favicon.ico b/static/favicons/favicon.ico new file mode 100644 index 0000000..2aec0a8 Binary files /dev/null and b/static/favicons/favicon.ico differ diff --git a/static/favicons/mstile-144x144.png b/static/favicons/mstile-144x144.png new file mode 100644 index 0000000..0b8f7e0 Binary files /dev/null and b/static/favicons/mstile-144x144.png differ diff --git a/static/favicons/mstile-150x150.png b/static/favicons/mstile-150x150.png new file mode 100644 index 0000000..1af5031 Binary files /dev/null and b/static/favicons/mstile-150x150.png differ diff --git a/static/favicons/mstile-310x150.png b/static/favicons/mstile-310x150.png new file mode 100644 index 0000000..5f9ff0c Binary files /dev/null and b/static/favicons/mstile-310x150.png differ diff --git a/static/favicons/mstile-310x310.png b/static/favicons/mstile-310x310.png new file mode 100644 index 0000000..9149b81 Binary files /dev/null and b/static/favicons/mstile-310x310.png differ diff --git a/static/favicons/mstile-70x70.png b/static/favicons/mstile-70x70.png new file mode 100644 index 0000000..fda410b Binary files /dev/null and b/static/favicons/mstile-70x70.png differ diff --git a/static/favicons/safari-pinned-tab.svg b/static/favicons/safari-pinned-tab.svg new file mode 100644 index 0000000..5c713e1 --- /dev/null +++ b/static/favicons/safari-pinned-tab.svg @@ -0,0 +1,53 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + + + diff --git a/static/favicons/site.webmanifest b/static/favicons/site.webmanifest new file mode 100644 index 0000000..c51bcd7 --- /dev/null +++ b/static/favicons/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/favicons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/favicons/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#3ddf89", + "background_color": "#3ddf89", + "display": "standalone" +} diff --git a/static/images/design-colors-showcase.svg b/static/images/design-colors-showcase.svg new file mode 100644 index 0000000..deb8832 --- /dev/null +++ b/static/images/design-colors-showcase.svg @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/design-res-promo.svg b/static/images/design-res-promo.svg new file mode 100644 index 0000000..8e26ed9 --- /dev/null +++ b/static/images/design-res-promo.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/design-text-aligning.svg b/static/images/design-text-aligning.svg new file mode 100644 index 0000000..a7f609e --- /dev/null +++ b/static/images/design-text-aligning.svg @@ -0,0 +1,465 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/logo.svg b/static/images/logo.svg new file mode 100644 index 0000000..a6ab8d9 --- /dev/null +++ b/static/images/logo.svg @@ -0,0 +1,72 @@ + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/static/index.html b/static/index.html index 62e3fba..7e36df9 100644 --- a/static/index.html +++ b/static/index.html @@ -1,17 +1,45 @@ - + + + + + + + + + + + + + + + + + + + + + + qwik + + + + +
+
+
+
+ +
+ +
+ +
+ +
+ + + - -
-
-
-
- -
-
- -
- -
\ No newline at end of file diff --git a/views/pages/landing.njk b/views/pages/landing.njk new file mode 100644 index 0000000..a33599b --- /dev/null +++ b/views/pages/landing.njk @@ -0,0 +1,25 @@ +{% extends "templates/base.njk" %} + +{% block head %} + qwik account manager +{% endblock %} + +{% block body %} + {# #} +
Welcome! :D
+

This is qwik's account manager!

+

+ This is the place to manage your one account that rules them all. ;p We at qwik have decided to use a central LDAP system for signing in to all services. + This means you only need one username and password! Remember to keep that password very secure and safe. +

+ +

Managment

+

+ To manage your account you first need one! You can create one by clicking "Register!" below. +

+

+
+ Log in! + Register! +
+{% endblock %} \ No newline at end of file diff --git a/views/templates/base.njk b/views/templates/base.njk new file mode 100644 index 0000000..6b36b75 --- /dev/null +++ b/views/templates/base.njk @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + {% block head %} + qwik + {% endblock %} + + + {% block body %} +

Hello World!

+ {% endblock %} + + \ No newline at end of file