From ed88296cc286223bd9ee43710231739a00bdea9e Mon Sep 17 00:00:00 2001 From: Daniel Muckerman Date: Sun, 14 Jun 2020 18:05:04 -0400 Subject: [PATCH] Initial commit --- .gitignore | 19 +++++++ app.py | 31 +++++++++++ requirements.txt | 3 ++ static/style.css | 131 +++++++++++++++++++++++++++++++++++++++++++++ templates/card.j2 | 9 ++++ templates/index.j2 | 54 +++++++++++++++++++ 6 files changed, 247 insertions(+) create mode 100644 .gitignore create mode 100644 app.py create mode 100644 requirements.txt create mode 100644 static/style.css create mode 100644 templates/card.j2 create mode 100644 templates/index.j2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16e6767 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +dashboard-env/ + +.envrc +.DS_Store +.vscode/ \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 0000000..99520a1 --- /dev/null +++ b/app.py @@ -0,0 +1,31 @@ +from flask import Flask, g, request, session, redirect, url_for, render_template +from flask_bootstrap import Bootstrap +import os + +app = Flask(__name__) +Bootstrap(app) +app.secret_key = 'asdf' +app.debug = True + + +@app.route('/') +def index(): + search = {'active': True, 'search_url': 'https://searx.info/?q='} + account_url = 'https://account.technicalincompetence.club' + apps = [ + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + {'name': 'Gitea', 'description': 'It\'s git', 'link': 'https://git.tia.moe'}, + ] + + return render_template('index.j2', apps = apps, search = search, account_url = account_url) + + +if __name__ == '__main__': + app.run() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3ca98e8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +Flask==1.1.2 +Flask-Bootstrap4==4.0.2 +PyYAML==5.3.1 \ No newline at end of file diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..dea2621 --- /dev/null +++ b/static/style.css @@ -0,0 +1,131 @@ +@media (max-width: 991.98px) { + #userNameRow, + #firstNameRow { + margin-bottom: 20px; + } + + #passwordButton { + margin-bottom: 50px; + } +} + +.card-hover { + background-color: #f8f9fa!important; +} + +@media (prefers-color-scheme: dark) { + body { + background-color: #111 !important; + color: #eee; + } + + .jumbotron { + background-color: #333 !important; + } + + .modal-content { + background-color: #111 !important; + color: #eee; + } + + .modal-header { + border-bottom: 1px solid #555 !important; + } + + .modal-header .close { + color: #eee !important; + text-shadow: 0 1px 0 #555 !important; + } + + .modal-footer { + border-top: 1px solid #555 !important; + } + + .bg-light { + background-color: #333 !important; + } + + .bg-white { + background-color: #000 !important; + } + + .bg-black { + background-color: #eee !important; + } + + .form-control { + display: block; + width: 100%; + height: calc(1.5em + 0.75rem + 2px); + padding: 0.375rem 0.75rem; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #dee2e6; + background-color: #000; + background-clip: padding-box; + border: 1px solid #6c757d; + border-radius: 0.25rem; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + } + + .card { + background-color: #000; + border: 1px solid #6c757d; + } + + .card-hover { + background-color: #343a40!important; + color: white !important; + } + + @media (prefers-reduced-motion: reduce) { + .form-control { + transition: none; + } + } + + .form-control::-ms-expand { + background-color: transparent; + border: 0; + } + + .form-control:-moz-focusring { + color: transparent; + text-shadow: 0 0 0 #dee2e6; + } + + .form-control:focus { + color: #dee2e6; + background-color: #191d21; + border-color: #b3d7ff; + outline: 0; + box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); + } + + .form-control::-webkit-input-placeholder { + color: #6c757d; + opacity: 1; + } + + .form-control::-moz-placeholder { + color: #6c757d; + opacity: 1; + } + + .form-control::-ms-input-placeholder { + color: #6c757d; + opacity: 1; + } + + .form-control::placeholder { + color: #6c757d; + opacity: 1; + } + + .form-control:disabled, + .form-control[readonly] { + background-color: #343a40; + opacity: 1; + } +} diff --git a/templates/card.j2 b/templates/card.j2 new file mode 100644 index 0000000..8c831fc --- /dev/null +++ b/templates/card.j2 @@ -0,0 +1,9 @@ +
+
+
+
{{ app['name'] }}
+

{{ app['description'] }}

+ {{ app['link'] }} +
+
+
\ No newline at end of file diff --git a/templates/index.j2 b/templates/index.j2 new file mode 100644 index 0000000..b5627fe --- /dev/null +++ b/templates/index.j2 @@ -0,0 +1,54 @@ +{% extends "bootstrap/base.html" %} +{% block title %}Technical Incompetence - Home{% endblock %} + +{% block styles %} +{{super()}} + +{% endblock %} + +{% block navbar %} + +{% endblock %} + +{% block content %} +
+ {% if search['active'] == True %} +
+ +
+

+ {% endif %} +
+ {% for app in apps %} + {% include "card.j2" %} + {% endfor %} +
+
+{% endblock %} + +{% block scripts %} +{{ super () }} + +{% endblock %} \ No newline at end of file