Skip to content

Commit 1fc5bd8

Browse files
committed
add : html templates and css files added.
1 parent fbe166c commit 1fc5bd8

File tree

4 files changed

+77
-2
lines changed

4 files changed

+77
-2
lines changed

mafia.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
from flask import Flask
1+
from flask import Flask, render_template, url_for
22

33
app = Flask(__name__)
44

55
@app.route('/')
66
def index():
7-
return "Hello World!"
7+
return render_template("index.html",
8+
image_name="Don",
9+
role_name="Don",
10+
is_farsi=True)
811

912
if __name__ == "__main__":
1013
app.run(host="0.0.0.0", \

static/css/style.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
h1 {
2+
font-size: 30px;
3+
padding: 0 0 0 0;
4+
margin: 0 0 0 0;
5+
}
6+
h2 {
7+
font-size: 25px;
8+
color: rgb(172, 161, 147);
9+
padding: 0 0 0 0;
10+
margin: 0 0 0 0;
11+
}
12+
p {
13+
font-size: 10px;
14+
color: rgb(163, 157, 150);
15+
padding: 0 0 0 0;
16+
margin: 0 0 0 0;
17+
}
18+
table, td, th {
19+
width: 100%;
20+
text-align: center;
21+
}
22+
23+
th, td {
24+
padding-top: 5px;
25+
}
26+
27+
.avatar {
28+
width: 200px;
29+
height: 200px;
30+
}

templates/base.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<head>
3+
<title>{% block title %}{% endblock %}</title>
4+
<link rel = "icon" href="static/images/roles/{{ image_name }}.png" type = "image/x-icon">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
7+
</head>
8+
<table>
9+
<tr>
10+
<td>{% block avatar %}{% endblock %}</td>
11+
</tr>
12+
<tr>
13+
<td class="role">{% block role_eng %}{% endblock %}</td>
14+
</tr>
15+
<tr>
16+
<td class="description">{% block desc_eng %}{% endblock %}</td>
17+
</tr>
18+
</table>

templates/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% extends 'base.html' %}
2+
3+
{% block title %}
4+
FekroBot::mafia::{{ role_name }}
5+
{% endblock %}
6+
7+
{% block avatar %}
8+
<img class="avatar" src="static/images/roles/{{ image_name }}.png">
9+
{% endblock %}
10+
11+
{% block role_eng %}
12+
<h1>{{ role_name }}
13+
{% if is_farsi == True %}
14+
<h2 id="fa">دن</h2>
15+
{% endif %}
16+
</h1>
17+
{% endblock %}
18+
19+
{% block desc_eng %}
20+
<p>The head Of Mafia Team.</p>
21+
{% if is_farsi == True %}
22+
<p id="fa">رییس مافیا</p>
23+
{% endif %}
24+
{% endblock %}

0 commit comments

Comments
 (0)