1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 16:48:58 +00:00

Compare commits

...

3 commits

5 changed files with 114 additions and 9 deletions

View file

@ -3,6 +3,8 @@ body {
margin: 2.5%; margin: 2.5%;
background-color: #282c37; background-color: #282c37;
color: white; color: white;
}
* {
box-sizing: border-box; box-sizing: border-box;
} }
@ -10,7 +12,7 @@ body {
background-color: #444a5c; background-color: #444a5c;
padding:10px; padding:10px;
} }
.container.light { .light {
background-color: #4d5366; background-color: #4d5366;
} }
.column { .column {
@ -21,6 +23,9 @@ body {
.large { .large {
font-size: 1.2em; font-size: 1.2em;
} }
.small {
font-size: 0.8em;
}
.centred { .centred {
text-align: center; text-align: center;
} }
@ -37,6 +42,27 @@ body {
width: 100%; width: 100%;
} }
.bot-icon {
width: 100px;
height: 100px;
background: center/contain url("https://lynnesbian.space/img/bune.png");
}
.bot-icon, .bot-text, .bot-actions {
display: inline-block;
align-self: center;
}
.bot-text {
flex-grow: 1;
margin: 0 10px;
}
.bot-name {
font-size: 1.8em;
margin: 10px 0;
}
.bot-actions {
margin-right: 10px;
}
.button { .button {
color: white; color: white;
line-height:1.2em; line-height:1.2em;
@ -52,6 +78,7 @@ body {
} }
input.button { input.button {
font-size: 1em; font-size: 1em;
cursor: pointer;
} }
.btn-primary { .btn-primary {
@ -74,6 +101,13 @@ input.button {
font-size: 1.6em; font-size: 1.6em;
} }
.btn-dangerous {
background-color: #e22;
}
.btn-dangerous:hover {
background-color: #c22;
}
a { a {
color: mediumpurple; color: mediumpurple;
text-decoration: none; text-decoration: none;
@ -101,3 +135,14 @@ label.important {
font-weight: 300; font-weight: 300;
display:block; display:block;
} }
input {
width: 100%;
font-size: 1.2em;
line-height:1.4em;
border: 3px grey solid;
border-radius: none;
padding: 3px;
}
input:focus {
border: 3px mediumpurple solid;
}

View file

@ -19,7 +19,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="column"> <div class="column">
<h2>Easy <i class="fas fa-check"></i></h2> <h2>Simple <i class="fas fa-check"></i></h2>
<p>FediBooks is easy to use. Everything from the profile picture to the accounts learned from is customisable with an intuitive web UI.</p> <p>FediBooks is easy to use. Everything from the profile picture to the accounts learned from is customisable with an intuitive web UI.</p>
</div> </div>
<div class="column"> <div class="column">

41
templates/home.html Normal file
View file

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>FediBooks</title>
{% include 'imports.html' %}
</head>
<body>
<div class="container light">
<h1 class='thin centred'>Home</h1>
<p class="centred large">Hi there! You have 1 bots, all of which are currently active.</p>
<p class="centred" style="margin: 50px 0;">
<a class="button btn-primary btn-large" href="/bot/new" role="button"><i class="fas fa-robot"></i> New bot</a>
<a class="button btn-secondary btn-large" href="/settings" role="button"><i class="fas fa-cog"></i> Account settings</a>
<a class="button btn-secondary btn-large" href="/do/signout" role="button"><i class="fas fa-sign-out-alt"></i> Sign out</a>
</p>
</div>
<div class="container" style="min-height: 300px;">
<div class="row light">
<div class="bot-icon"></div>
<div class="bot-text">
<div class="bot-name">My bot!!</div>
<div class="bot-status">Online, learning from 3 accounts, 12345 posts in database</div>
</div>
<div class="bot-actions">
<a class="button btn-dangerous" href="/bot/toggle/insert id here" title="Turn on/off"><i class="fas fa-power-off"></i></a><a class="button btn-secondary" href="/bot/edit/insert id here" title="Edit"><i class="fas fa-pencil-alt"></i></a>
</div>
</div>
</div>
<div class="container">
<h2>Support the author <i class="fas fa-heart"></i></h2>
<p>FediBooks is a passion project I develop and maintain in my free time. If you'd like to contribute, you can do so here.</p>
<a class="button btn-primary" href="https://patreon.com/Lynnesbian" role="button"><i class="fab fa-patreon"></i> Patreon</a>
<a class="button btn-primary" href="https://paypal.me/Lynnesbian" role="button"><i class="fab fa-paypal"></i> PayPal</a>
<a class="button btn-primary" href="https://ko-fi.com/Lynnesbian" role="button"><i class="fas fa-coffee"></i> Ko-fi</a>
</div>
{% include 'footer.html' %}
</body>
</html>

View file

@ -8,19 +8,29 @@
<body> <body>
<div class="container"> <div class="container">
<h1 class="thin centred">Log in</h1> <h1 class="thin centred">{% if signup %}Sign up{% else %}Log in{% endif %}</h1>
</div> </div>
<div class="container centred"> <div class="container centred">
<form action="/do/login" method="POST"> <form action="/do/{% if signup %}signup{% else %}login{% endif %}" method="POST">
<p> <p>
<label for="email" class="important">Email</label> <label for="email" class="important">Email</label>
<input type="email" name="email" placeholder="you@example.com"> <input type="email" name="email" placeholder="you@example.com">
{% if signup %}
<p class="small">
FediBooks requires your email address in order to send you alerts when your bot stops working, and for password resets.
</p>
{% endif %}
<br> <br>
<label for="password" class="important">Password</label> <label for="password" class="important">Password</label>
<input type="password" name="password" placeholder="password"> <input type="password" name="password">
{% if signup %}
<p class="small">
Passwords must be at least eight characters long.
</p> </p>
<input type="submit" value="Log in" class="button btn-primary full-width"> {% endif %}
</p>
<input type="submit" value="{% if signup %}Create my account{% else %}Log in{% endif %}" class="button btn-primary full-width">
</form> </form>
</div> </div>

View file

@ -1,9 +1,14 @@
from flask import Flask, render_template from flask import Flask, render_template, session
app = Flask(__name__) app = Flask(__name__)
app.secret_key = "debug key"
@app.route("/") @app.route("/")
def hello(): def hello():
session['userid'] = 1
if 'userid' in session:
return render_template("home.html")
else:
return render_template("front_page.html") return render_template("front_page.html")
@app.route("/welcome") @app.route("/welcome")
@ -12,4 +17,8 @@ def welcome():
@app.route("/login") @app.route("/login")
def show_login_page(): def show_login_page():
return render_template("login.html") return render_template("login.html", signup = False)
@app.route("/signup")
def show_signup_page():
return render_template("login.html", signup = True)