Migration

This commit is contained in:
thematdev 2020-11-06 17:51:15 +03:00
parent e87874ecde
commit 65255a2fd3
4 changed files with 115 additions and 19 deletions

37
main.py
View File

@ -1,23 +1,42 @@
import flask import flask
import os
import numpy.random as gaussian_rnd
app = flask.Flask(__name__, subdomain_matching=True) app = flask.Flask(__name__, subdomain_matching=True)
app.config['SERVER_NAME'] = 'test.sex:666' app.config['SERVER_NAME'] = 'thematdev.local:22837'
def generate_iq():
return round(gaussian_rnd.normal(loc=100.0, scale=15.0, size=None))
@app.context_processor
def override_url_for():
return dict(url_for=dated_url_for)
def dated_url_for(endpoint, **values):
if endpoint == 'static':
filename = values.get('filename', None)
if filename:
file_path = os.path.join(app.root_path, endpoint, filename)
values['q'] = int(os.stat(file_path).st_mtime)
return flask.url_for(endpoint, **values)
@app.route('/') @app.route('/')
def index(): def index():
return flask.render_template('index.html') return flask.render_template('index.html', random_number=generate_iq())
@app.route('/', subdomain='gay') @app.route('/', subdomain='tex')
def testindex(): def texindex():
print('It works!') return "Fuck you, leatherman!"
return flask.render_template('testindex.html')
def main(): def main():
app.run('test.sex', 666) app.run('thematdev.local', 22837)
# flask.url_for('static', filename='style.css')
# flask.url_for('static', filename='fonts.css')
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -2,18 +2,71 @@
box-sizing: border-box; box-sizing: border-box;
} }
body {
margin: 0;
}
.pagehead { .pagehead {
width: 100%; width: 100%;
height: 100%; height: 100vh;
position: fixed; position: relative;
top: 0;
left: 0;
background: #111; background: #111;
display: flex;
/*align-items: center;
justify-content: center;*/
flex-direction: column;
margin: 0;
}
.pagehead-inner {
position: inherit;
margin: 0;
width: 456px;
height: 600px;
top: 50%;
left: 50%;
margin-left: -228px;
margin-top: -300px;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.pagehead-inner > p {
color: white;
font-family: "Overpass Mono", monospace;
font-weight: 300;
margin: 0;
}
.btn-container {
display: flex;
position: inherit;
flex-direction: row;
}
.btn-container button {
width: 69px;
height: 69px;
margin: 10px;
background: #222;
color: white;
border-radius: 15px;
}
.btn-container button:hover {
transform: scale(1.2);
-webkit-transition: transform 0.5s ease-in-out;
background: white;
color: green;
} }
.mainh { .mainh {
color: white; color: white;
font: "Overpass Mono", monospace; font-family: "Overpass Mono", monospace;
font-weight: 600; font-weight: 700;
text-align: center; margin: 0;
} }
.

View File

@ -1,13 +1,29 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ru"> <html lang="ru">
<head> <head>
<link rel="stylesheet" href="static/assets/css/fonts.css"> <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/fonts.css') }}">
<link rel="stylesheet" href="static/assets/css/style.css"> <link rel="stylesheet" href="{{ url_for('static', filename='assets/css/style.css') }}">
<title>thematdev</title> <title>thematdev</title>
</head> </head>
<body> <body>
<div class="pagehead"> <div class="pagehead">
<div class="pagehead-inner">
<h1 class="mainh">thematdev</h1> <h1 class="mainh">thematdev</h1>
<p> Тут можно подпись какую-то сделать </p>
<p> Ваш IQ: {{ random_number }}</p>
<div class="btn-container">
<button onclick="location.href='http://tex.thematdev.local:22837'" type="button" class="btn-tex">
<p> TeX </p>
</button>
<button type="button">
Wiki
</button>
<button onclick="location.href='https://t.me/thematdev'" type="button">
TG
</button>
</div>
</div>
</div> </div>
</body> </body>
Идея про Гауссово распределение вместо обычного рандома: <a href="https://t.me/Prentor">Prentor</a> и <a href="https://t.me/pavel_the_best"> pavel_the_best </a>
</html> </html>

8
templates/texindex.html Normal file
View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>