initial commit

This commit is contained in:
danamir
2020-05-10 03:11:53 +03:00
commit 95ff7ff8cf
16 changed files with 249 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
__pycache__
.vscode
env

25
app.py Normal file
View File

@@ -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')

2
app_config.py Normal file
View File

@@ -0,0 +1,2 @@
CLIENT_SECRET = "2U25Cuk6p/Apbeb.nyprWm=d@zL__iB-"
TEMPLATES_AUTO_RELOAD = "True"

11
serviceFunc.py Normal file
View File

@@ -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)

62
static/css/index.css Normal file
View File

@@ -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;
}

31
static/css/nopage.css Normal file
View File

@@ -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;
}

49
static/css/yespage.css Normal file
View File

@@ -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;
}

BIN
static/img/defaultBack.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

BIN
static/img/love2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

BIN
static/img/noback.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

BIN
static/img/yesback.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 KiB

0
static/js/index.js Normal file
View File

4
templates/bootstrap.html Normal file
View File

@@ -0,0 +1,4 @@
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

20
templates/index.html Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<html lang="ru">
<head>
<title>Ты котя?</title>
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='css/index.css')}}">
{% include 'bootstrap.html' %}
</head>
<body>
<div class="container main">
<div class="kotya">
<h1>Ты котя?</h1>
<button class="btn btn-primary" id="yesbtn" onClick="window.location.href='{{ url_for( 'yespressed' ) }}';">Да</button>
<button class="btn btn-primary" id="nobtn" onClick="window.location.href='{{ url_for( 'nopressed' ) }}';">Нет</button>
</div>
</div>
</body>
</html>

16
templates/nopage.html Normal file
View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<html lang="ru">
<head>
<link rel="stylesheet" href="css/nopage.css">
<link href="https://fonts.googleapis.com/css?family=Pattaya&display=swap" rel="stylesheet">
<title>Жаль</title>
</head>
<body>
<div class="yesimg">
<h1>Жаль, я ждал свою Котю. </h1>
</div>
</body>
</html>

26
templates/yespage.html Normal file
View File

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<html lang="ru">
<head>
<link rel="stylesheet" href="{{ url_for('static', filename='css/yespage.css')}}">
<link href="https://fonts.googleapis.com/css?family=Pattaya&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%include 'bootstrap.html'%}
<title>Да, ты Котя</title>
</head>
<body>
<div class="container-fluid">
<div class="row">
<img src="{{url_for('static', filename='img/love2.jpg')}}">
</div>
<div class="row">
<h1>ТЬМООООООК</h1>
</div>
<div class="row">
<h2>Мы вместе {{days}} дней </h>
</div>
</div>
</body>
</html>