Skip to content

Commit

Permalink
bootstrap and fontawesome
Browse files Browse the repository at this point in the history
  • Loading branch information
Jochem Berends committed Feb 11, 2018
1 parent 5b48903 commit a860116
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 deletions.
14 changes: 7 additions & 7 deletions pibird.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
@app.route('/')
def hello_world():
commands = [
dict(url='/commands/play', name='Play MP3'),
dict(url='/commands/testvumeter', name='Test VU meter'),
dict(url='/commands/volume/0', name='Set volume 0%'),
dict(url='/commands/volume/25', name='Set volume 25%'),
dict(url='/commands/volume/50', name='Set volume 50%'),
dict(url='/commands/volume/75', name='Set volume 75%'),
dict(url='/commands/volume/100', name='Set volume 100%'),
dict(url='/commands/play', name='Play MP3', icon='fa-file-audio-o'),
dict(url='/commands/testvumeter', name='Test VU meter', icon='fa-flask'),
dict(url='/commands/volume/0', name='Set volume 0%', icon='fa-volume-off'),
dict(url='/commands/volume/25', name='Set volume 25%', icon='fa-volume-down'),
dict(url='/commands/volume/50', name='Set volume 50%', icon='fa-volume-down'),
dict(url='/commands/volume/75', name='Set volume 75%', icon='fa-volume-down'),
dict(url='/commands/volume/100', name='Set volume 100%', icon='fa-volume-up'),
]

return render_template('index.t.html', commands=commands)
Expand Down
26 changes: 13 additions & 13 deletions templates/base.t.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>pibird</title>

<meta charset="UTF-8">
<title>pibird</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.5, shrink-to-fit=no">

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" 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">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
{% endblock %}
<body>
{% block body %}
<div class="container-fluid">
{% block main %}

<p>loading...</p>

{% endblock %}

</div>
{% block posterium %}
<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>

{% endblock %}
</body>
</html>
Expand Down
17 changes: 13 additions & 4 deletions templates/index.t.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{% extends 'base.t.html' %}
{% block body %}
{% block main %}

<h1>Welcome here</h1>
<h1>Welcome to pibird</h1>

<div class="alert alert-info">Pibird plays bird sounds on the raspberry pi with a Speaker pHAT</div>

<h3>Commands available</h3>

<ul>
<ul class="fa-ul">
{% for command in commands %}
<li><a href="{{ command.get('url') }}">{{ command.name }}</a></li>
<li>
<a href="{{ command.url }}">
{% if command.get('icon') %}
<i class="fa-li fa {{ command.icon }} fa-1g"></i>&nbsp;
{% endif %}
{{ command.name }}
</a>
</li>
{% endfor %}
</ul>

Expand Down

0 comments on commit a860116

Please sign in to comment.