diff --git a/web/app.py b/web/app.py index ce34518..fb2003f 100644 --- a/web/app.py +++ b/web/app.py @@ -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/') - 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) diff --git a/web/static/css/home.css b/web/static/css/home.css index 0bc4fd0..fa5164c 100644 --- a/web/static/css/home.css +++ b/web/static/css/home.css @@ -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; diff --git a/web/static/css/home.css.map b/web/static/css/home.css.map index 284008d..473d76e 100644 --- a/web/static/css/home.css.map +++ b/web/static/css/home.css.map @@ -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}"]} \ No newline at end of file +{"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"]} \ No newline at end of file diff --git a/web/static/css/home.sass b/web/static/css/home.sass index 9970ebc..386e0f8 100644 --- a/web/static/css/home.sass +++ b/web/static/css/home.sass @@ -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 diff --git a/web/templates/index.html b/web/templates/index.html index 4c87694..ff2239a 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -17,6 +17,40 @@
+

What users say

+
+
+ + + + @perl404 +

I love the credit system in this API.

+
+ +
+ + + + @itsnot.david +

Nova is good. I love it because [it's] free and easy.

+
+ +
+ + + + @mainkrit +

We can all agree that Nova AI is the best.

+
+ +
+ + + + @elephant_0000 +

You are so excellent [...]. Thank you for your contributions.

+
+
{% include 'parts/end.html' %} diff --git a/web/tos.py b/web/tos.py index 822e372..55dc0e3 100644 --- a/web/tos.py +++ b/web/tos.py @@ -43,3 +43,13 @@ def register(app): json.dump(data, open('data/tos.json', 'w', encoding='utf8')) return 'Removed.', 204 + + @app.route('/legal/') + 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)