commit 95ff7ff8cf4829ee620d735a7472e68ec16d1d9c Author: danamir Date: Sun May 10 03:11:53 2020 +0300 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bbe39d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +__pycache__ +.vscode +env diff --git a/app.py b/app.py new file mode 100644 index 0000000..da510b2 --- /dev/null +++ b/app.py @@ -0,0 +1,25 @@ +from flask import Flask, render_template +import app_config +from serviceFunc import getDays + +app = Flask(__name__) +app.config.from_object(app_config) + + +@app.route('/') +def index(): + return render_template('index.html') + + +@app.route('/yespage.html', methods=['GET', 'POST']) +def yespressed(): + return render_template('yespage.html', days=getDays()) + + +@app.route('/nopage.html', methods=['GET', 'POST']) +def nopressed(): + return render_template('nopage.html') + +if __name__ == '__main__': + app.jinja_env.auto_reload = True + app.run(debug=True, host='0.0.0.0') \ No newline at end of file diff --git a/app_config.py b/app_config.py new file mode 100644 index 0000000..f3dc891 --- /dev/null +++ b/app_config.py @@ -0,0 +1,2 @@ +CLIENT_SECRET = "2U25Cuk6p/Apbeb.nyprWm=d@zL__iB-" +TEMPLATES_AUTO_RELOAD = "True" \ No newline at end of file diff --git a/serviceFunc.py b/serviceFunc.py new file mode 100644 index 0000000..4ebb376 --- /dev/null +++ b/serviceFunc.py @@ -0,0 +1,11 @@ +from datetime import date +from datetime import datetime + + +def getDays(): + curdate = datetime.today() + f_date = date(2017, 10, 26) + l_date = date(curdate.year, curdate.month, curdate.day) + delta = l_date - f_date + print(delta.days) + return str(delta.days) \ No newline at end of file diff --git a/static/css/index.css b/static/css/index.css new file mode 100644 index 0000000..8c189a2 --- /dev/null +++ b/static/css/index.css @@ -0,0 +1,62 @@ +body{ + margin: 0; + padding: 0; + background: url(../img/defaultBack.jpg); + background-position: center; + background-repeat: no-repeat; + background-size: cover; + height: 100vh; + } +.container{ + padding-right: 0; + padding-left: 0; + margin-right: auto; + margin-left: auto; + text-align: center; + margin-top: 35vh; +} + + .kotya h1{ + font-family: 'Roboto Mono', monospace; + color:#0f2338; + font-size: 50pt; + +} + +.kotya #yesbtn{ + width: 100px; + height: 100px; + border: 30px; + background:#fe5f55; + border: 2px; + border-radius: 24px; + font-size: 25px; + color:#faf3dd; + cursor:pointer; + +} + +.kotya #nobtn{ + width: 100px; + height: 100px; + border: 30px; + background: #fe5f55; + border: 2px; + border-radius: 24px; + font-size: 25px; + color:#faf3dd; + cursor:pointer; + +} + +.kotya #yesbtn:hover{ + background:#90ddf0; + border: 2px solid #4ce0b3; + color:#2b3a67; +} + +.kotya #nobtn:hover{ + background:#90ddf0; + border: 2px solid #4ce0b3; + color:#2b3a67; +} diff --git a/static/css/nopage.css b/static/css/nopage.css new file mode 100644 index 0000000..e855212 --- /dev/null +++ b/static/css/nopage.css @@ -0,0 +1,31 @@ +.body, html{ + margin: 0; + padding: 0; + background: url(../img/noback.jpg); + background-position: center; + background-repeat: no-repeat; + background-size: cover; + height: 100%; + +} + +.yesimg{ + width: 500px; + padding: 40px; + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} + +.yesimg h1{ + padding: 0; + border: 0; + font-family: 'Pattaya', sans-serif; + color:#cc0000; + font-size: 50pt; + text-align: center; + border-radius: 100px; +} + diff --git a/static/css/yespage.css b/static/css/yespage.css new file mode 100644 index 0000000..9abb314 --- /dev/null +++ b/static/css/yespage.css @@ -0,0 +1,49 @@ +html{ + min-width: 488px; +} + +body{ + margin: 0; + padding: 0; + background: url(../img/yesback.jpg); + background-position: center; + background-repeat: no-repeat; + background-size: cover; + height: 100vh; + +} + +container-fluid{ + min-width: 500px; +} + +div.row{ + justify-content:center; +} + +div.row h1{ + padding: 0; + border: 0; + font-family: 'Pattaya', sans-serif; + color:#cc0000; + font-size: 50pt; + text-align: center; + border-radius: 100px; + margin-top: 5vh; +} + +div.row h2{ + padding: 0; + border: 0; + font-family: 'Pattaya', sans-serif; + color:#cc0000; + font-size: 25pt; + text-align: center; + border-radius: 100px; +} + +img{ + max-width: 400px; + height: auto; + margin-top: 10vh; +} \ No newline at end of file diff --git a/static/img/defaultBack.jpg b/static/img/defaultBack.jpg new file mode 100644 index 0000000..e6ab47e Binary files /dev/null and b/static/img/defaultBack.jpg differ diff --git a/static/img/love2.jpg b/static/img/love2.jpg new file mode 100644 index 0000000..f6403be Binary files /dev/null and b/static/img/love2.jpg differ diff --git a/static/img/noback.jpg b/static/img/noback.jpg new file mode 100644 index 0000000..cb7790c Binary files /dev/null and b/static/img/noback.jpg differ diff --git a/static/img/yesback.jpg b/static/img/yesback.jpg new file mode 100644 index 0000000..878930c Binary files /dev/null and b/static/img/yesback.jpg differ diff --git a/static/js/index.js b/static/js/index.js new file mode 100644 index 0000000..e69de29 diff --git a/templates/bootstrap.html b/templates/bootstrap.html new file mode 100644 index 0000000..61a33b8 --- /dev/null +++ b/templates/bootstrap.html @@ -0,0 +1,4 @@ + + + + diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..98ec7af --- /dev/null +++ b/templates/index.html @@ -0,0 +1,20 @@ + + + + + + Ты котя? + + + {% include 'bootstrap.html' %} + + +
+
+

Ты котя?

+ + +
+
+ + \ No newline at end of file diff --git a/templates/nopage.html b/templates/nopage.html new file mode 100644 index 0000000..50b0edc --- /dev/null +++ b/templates/nopage.html @@ -0,0 +1,16 @@ + + + + + + + Жаль + + + +
+

Жаль, я ждал свою Котю.

+
+ + + diff --git a/templates/yespage.html b/templates/yespage.html new file mode 100644 index 0000000..1a1c132 --- /dev/null +++ b/templates/yespage.html @@ -0,0 +1,26 @@ + + + + + + + + {%include 'bootstrap.html'%} + Да, ты Котя + + + +
+
+ +
+
+

ТЬМООООООК

+
+
+

Мы вместе {{days}} дней +

+
+ + +