Small improvements (I guess?)

This commit is contained in:
nsde 2023-08-29 21:02:50 +02:00
parent c9ca4d8873
commit 180b01185b
6 changed files with 154 additions and 19 deletions

View file

@ -15,9 +15,7 @@ log.disabled = True
def create_app() -> flask.Flask:
app = flask.Flask(__name__)
app.wsgi_app = ProxyFix(
app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1
)
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1)
import tos
tos.register(app)
@ -32,10 +30,6 @@ def create_app() -> flask.Flask:
def index():
return flask.render_template('index.html')
@app.route('/alt-design')
def alt_design():
return flask.render_template('alt-design.html')
@app.route('/go')
def go():
return flask.render_template('panel.html')
@ -52,19 +46,10 @@ def create_app() -> flask.Flask:
def favicon():
return flask.send_file('static/img/fav.ico', mimetype='image/vnd.microsoft.icon')
@app.route('/legal/<path:subpath>')
def legal_site(subpath):
emoji = None
if subpath == 'terms':
emoji = json.load(open('data/tos.json', encoding='utf8')).get(flask.request.args.get('verify'))
if emoji:
emoji = emoji.encode('utf8')
return flask.render_template(f'legal/{subpath}.html', verify=emoji)
return app
production = create_app()
if __name__ == '__main__':
create_app().run(debug=True, use_evalex=False, port=2323, host='0.0.0.0', threaded=True)
print('* Live on http://localhost:2211')
create_app().run(debug=True, use_reloader=True, use_evalex=False, port=2211, host='0.0.0.0', threaded=True)

View file

@ -1,3 +1,4 @@
@charset "UTF-8";
header {
max-width: 800px;
margin: 0 auto;
@ -7,6 +8,58 @@ header h1 {
line-height: 4rem;
}
div.user-quotes {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
grid-gap: 2rem;
}
div.user-quotes div.user-quote__field {
padding-inline: 2rem;
padding-block: 2rem;
background: rgba(247, 154, 182, 0.1411764706);
border: 1px solid rgba(244, 90, 136, 0.3803921569);
border-radius: 5px;
position: relative;
transition: all 200ms;
box-shadow: 0 0 30px transparent;
min-height: 200px;
}
div.user-quotes div.user-quote__field:hover {
scale: 1.05;
filter: brightness(1.1) saturate(1.1);
box-shadow: 0 0 30px rgba(244, 90, 136, 0.3803921569);
}
div.user-quotes div.user-quote__field::before {
font-family: "Times New Roman", Times, serif;
content: "“";
font-size: 150px;
color: rgba(247, 154, 182, 0.1411764706);
position: absolute;
bottom: -1rem;
left: 1rem;
transform: rotate(180deg);
}
div.user-quotes div.user-quote__field img {
cursor: pointer;
width: 100px;
height: 100px;
border-radius: 50%;
border: 3px solid rgba(244, 90, 136, 0.3803921569);
position: absolute;
top: 1rem;
right: 1rem;
}
div.user-quotes div.user-quote__field span.user-quote__username {
font-size: 1rem;
font-weight: 600;
color: #b53d61;
}
div.user-quotes div.user-quote__field p {
margin-block: 0;
font-size: 1.5rem;
padding-right: 7rem;
}
@media (max-width: 800px) {
header {
font-size: 26px;

View file

@ -1 +1 @@
{"version":3,"sources":["home.sass","_vars.sass","home.css"],"names":[],"mappings":"AAEA;EACI,gBCeS;EDdT,cAAA;EACA,eAAA;AEDJ;AFGI;EACI,iBAAA;AEDR;;AFGA;EACI;IACI,eAAA;EEAN;EFEM;IACI,iBAAA;EEAV;EFEM;IACI,eAAA;EEAV;AACF","file":"home.css","sourcesContent":["@import '_vars'\n\nheader\n max-width: $main-width\n margin: 0 auto\n font-size: 40px\n\n h1\n line-height: 4rem\n\n@media (max-width: 800px)\n header\n font-size: 26px\n \n h1\n line-height: 3rem\n\n h3\n font-size: 28px\n","$text: #f3f3f3\n$background: #03060d\n$secondary: #252a38\n$secondary-dark: #0e0e0e\n$border: #161d2bb0\n\n$primary: #b53d61\n$primary-light: #f45a88\n$primary-glow: #f45a8861\n$primary-soft: #f79ab624\n$accent: #28aaf0\n\n$error: #ef3628\n$warn: #f09928\n$success: #28ef6b\n\n$edge: 5px\n\n$main-width: 800px\n$more-width: 1000px\n","header {\n max-width: 800px;\n margin: 0 auto;\n font-size: 40px;\n}\nheader h1 {\n line-height: 4rem;\n}\n\n@media (max-width: 800px) {\n header {\n font-size: 26px;\n }\n header h1 {\n line-height: 3rem;\n }\n header h3 {\n font-size: 28px;\n }\n}"]}
{"version":3,"sources":["home.css","home.sass","_vars.sass"],"names":[],"mappings":"AAAA,gBAAgB;ACEhB;EACI,gBCeS;EDdT,cAAA;EACA,eAAA;ADAJ;ACEI;EACI,iBAAA;ADAR;;ACEA;EACI,aAAA;EACA,2DAAA;EACA,cAAA;ADCJ;ACCI;EACI,oBAAA;EACA,mBAAA;EACA,6CCTO;EDUP,kDAAA;EACA,kBCJD;EDKC,kBAAA;EACA,qBAAA;EACA,gCAAA;EACA,iBAAA;ADCR;ACCQ;EACI,WAAA;EACA,qCAAA;EACA,qDAAA;ADCZ;ACCQ;EACI,4CAAA;EACA,YAAA;EACA,gBAAA;EACA,wCC1BG;ED2BH,kBAAA;EACA,aAAA;EACA,UAAA;EAGA,yBAAA;ADDZ;ACGQ;EACI,eAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,kDAAA;EACA,kBAAA;EACA,SAAA;EACA,WAAA;ADDZ;ACGQ;EACI,eAAA;EACA,gBAAA;EACA,cClDF;AFiDV;ACGQ;EACI,eAAA;EACA,iBAAA;EACA,mBAAA;ADDZ;;ACGA;EACI;IACI,eAAA;EDAN;ECEM;IACI,iBAAA;EDAV;ECEM;IACI,eAAA;EDAV;AACF","file":"home.css","sourcesContent":["@charset \"UTF-8\";\nheader {\n max-width: 800px;\n margin: 0 auto;\n font-size: 40px;\n}\nheader h1 {\n line-height: 4rem;\n}\n\ndiv.user-quotes {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n grid-gap: 2rem;\n}\ndiv.user-quotes div.user-quote__field {\n padding-inline: 2rem;\n padding-block: 2rem;\n background: rgba(247, 154, 182, 0.1411764706);\n border: 1px solid rgba(244, 90, 136, 0.3803921569);\n border-radius: 5px;\n position: relative;\n transition: all 200ms;\n box-shadow: 0 0 30px transparent;\n min-height: 200px;\n}\ndiv.user-quotes div.user-quote__field:hover {\n scale: 1.05;\n filter: brightness(1.1) saturate(1.1);\n box-shadow: 0 0 30px rgba(244, 90, 136, 0.3803921569);\n}\ndiv.user-quotes div.user-quote__field::before {\n font-family: \"Times New Roman\", Times, serif;\n content: \"“\";\n font-size: 150px;\n color: rgba(247, 154, 182, 0.1411764706);\n position: absolute;\n bottom: -1rem;\n left: 1rem;\n transform: rotate(180deg);\n}\ndiv.user-quotes div.user-quote__field img {\n cursor: pointer;\n width: 100px;\n height: 100px;\n border-radius: 50%;\n border: 3px solid rgba(244, 90, 136, 0.3803921569);\n position: absolute;\n top: 1rem;\n right: 1rem;\n}\ndiv.user-quotes div.user-quote__field span.user-quote__username {\n font-size: 1rem;\n font-weight: 600;\n color: #b53d61;\n}\ndiv.user-quotes div.user-quote__field p {\n margin-block: 0;\n font-size: 1.5rem;\n padding-right: 7rem;\n}\n\n@media (max-width: 800px) {\n header {\n font-size: 26px;\n }\n header h1 {\n line-height: 3rem;\n }\n header h3 {\n font-size: 28px;\n }\n}","@import '_vars'\n\nheader\n max-width: $main-width\n margin: 0 auto\n font-size: 40px\n\n h1\n line-height: 4rem\n\ndiv.user-quotes\n display: grid\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))\n grid-gap: 2rem\n\n div.user-quote__field\n padding-inline: 2rem\n padding-block: 2rem\n background: $primary-soft\n border: 1px solid $primary-glow\n border-radius: $edge\n position: relative\n transition: all 200ms\n box-shadow: 0 0 30px transparent\n min-height: 200px\n\n &:hover\n scale: 1.05\n filter: brightness(1.1) saturate(1.1)\n box-shadow: 0 0 30px $primary-glow\n\n &::before\n font-family: 'Times New Roman', Times, serif\n content: '\\201c'\n font-size: 150px\n color: $primary-soft\n position: absolute\n bottom: -1rem\n left: 1rem\n \n // show at the bottom left\n transform: rotate(180deg)\n\n img\n cursor: pointer\n width: 100px\n height: 100px\n border-radius: 50%\n border: 3px solid $primary-glow\n position: absolute\n top: 1rem\n right: 1rem\n\n span.user-quote__username\n font-size: 1rem\n font-weight: 600\n color: $primary\n\n p\n margin-block: 0\n font-size: 1.5rem\n padding-right: 7rem\n\n@media (max-width: 800px)\n header\n font-size: 26px\n \n h1\n line-height: 3rem\n\n h3\n font-size: 28px\n","$text: #f3f3f3\n$background: #03060d\n$secondary: #252a38\n$secondary-dark: #0e0e0e\n$border: #161d2bb0\n\n$primary: #b53d61\n$primary-light: #f45a88\n$primary-glow: #f45a8861\n$primary-soft: #f79ab624\n$accent: #28aaf0\n\n$error: #ef3628\n$warn: #f09928\n$success: #28ef6b\n\n$edge: 5px\n\n$main-width: 800px\n$more-width: 1000px\n"]}

View file

@ -8,6 +8,59 @@ header
h1
line-height: 4rem
div.user-quotes
display: grid
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))
grid-gap: 2rem
div.user-quote__field
padding-inline: 2rem
padding-block: 2rem
background: $primary-soft
border: 1px solid $primary-glow
border-radius: $edge
position: relative
transition: all 200ms
box-shadow: 0 0 30px transparent
min-height: 200px
&:hover
scale: 1.05
filter: brightness(1.1) saturate(1.1)
box-shadow: 0 0 30px $primary-glow
&::before
font-family: 'Times New Roman', Times, serif
content: '\201c'
font-size: 150px
color: $primary-soft
position: absolute
bottom: -1rem
left: 1rem
// show at the bottom left
transform: rotate(180deg)
img
cursor: pointer
width: 100px
height: 100px
border-radius: 50%
border: 3px solid $primary-glow
position: absolute
top: 1rem
right: 1rem
span.user-quote__username
font-size: 1rem
font-weight: 600
color: $primary
p
margin-block: 0
font-size: 1.5rem
padding-right: 7rem
@media (max-width: 800px)
header
font-size: 26px

View file

@ -17,6 +17,40 @@
</a>
</header>
<main>
<h2>What users say</h2>
<div class="user-quotes">
<div class="user-quote__field">
<a href="https://discord.com/channels/1120037287300976640/1120037729644855427/1145324231236780092" target="_blank">
<img src="https://cdn.discordapp.com/avatars/319792874696867840/5c31623f67962c7c689898a0517c4813.png?size=128">
</a>
<span class="user-quote__username">@perl404</span>
<p>I love the credit system in this API.</p>
</div>
<div class="user-quote__field">
<a href="https://discord.com/channels/1120037287300976640/1120037729644855427/1145791262063075378" target="_blank">
<img src="https://cdn.discordapp.com/avatars/1126131609855332372/3ce8f67f02066ebf1307e5b82a9222cf.png?size=128">
</a>
<span class="user-quote__username">@itsnot.david</span>
<p>Nova is good. I love it because [it's] free and easy.</p>
</div>
<div class="user-quote__field">
<a href="https://discord.com/channels/1120037287300976640/1120037729644855427/1144279505981153302" target="_blank">
<img src="https://cdn.discordapp.com/avatars/756585981787897956/86b4f6da0e44bf8545be937d66017b71.png?size=128">
</a>
<span class="user-quote__username">@mainkrit</span>
<p>We can all agree that Nova AI is the best.</p>
</div>
<div class="user-quote__field">
<a href="https://discord.com/channels/1120037287300976640/1120037729644855427/1143784944888447037" target="_blank">
<img src="https://cdn.discordapp.com/avatars/1130410896896819211/b461ea5ea97a773d000300e4d978e24d.png?size=128">
</a>
<span class="user-quote__username">@elephant_0000</span>
<p>You are so excellent [...]. Thank you for your contributions.</p>
</div>
</div>
</main>
{% include 'parts/end.html' %}

View file

@ -43,3 +43,13 @@ def register(app):
json.dump(data, open('data/tos.json', 'w', encoding='utf8'))
return 'Removed.', 204
@app.route('/legal/<path:subpath>')
def legal_site(subpath):
emoji = None
if subpath == 'terms':
emoji = json.load(open('data/tos.json', encoding='utf8')).get(flask.request.args.get('verify'))
if emoji:
emoji = emoji.encode('utf8')
return flask.render_template(f'legal/{subpath}.html', verify=emoji)