initial commit
This commit is contained in:
commit
e279281330
52 changed files with 916 additions and 0 deletions
31
templates/base.html.tera
Normal file
31
templates/base.html.tera
Normal file
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>{{ title }}</title>
|
||||
|
||||
<link rel="stylesheet" href="/static/css/reset.min.css">
|
||||
<link rel="stylesheet" href="/static/css/card.min.css">
|
||||
<link rel="stylesheet" href="/static/css/button.min.css">
|
||||
<link rel="stylesheet" href="/static/css/styles.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
{% block nav %} {% endblock nav %}
|
||||
</header>
|
||||
<main>
|
||||
{% block content %}{% endblock content %}
|
||||
</main>
|
||||
<footer>
|
||||
{% block footer %} {% endblock footer %}
|
||||
</footer>
|
||||
|
||||
<script src="/static/js/howler.min.js"></script>
|
||||
<script src="/static/js/app.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
20
templates/index.html.tera
Normal file
20
templates/index.html.tera
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends "base" %} {% block content %}
|
||||
|
||||
<div class="ui cards">
|
||||
<div class="ui centered raised card">
|
||||
<div class="image">
|
||||
<img src="/static/image/card.jpg">
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="center aligned description">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
|
||||
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</div>
|
||||
</div>
|
||||
<a href="/random" class="ui green button">Start</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
47
templates/random.html.tera
Normal file
47
templates/random.html.tera
Normal file
|
@ -0,0 +1,47 @@
|
|||
{% extends "base" %} {% block content %}
|
||||
<div class="ui cards">
|
||||
<div class="ui centered raised card">
|
||||
<div class="image">
|
||||
<img src="/static/image/card.jpg">
|
||||
</div>
|
||||
<div class="center aligned content">
|
||||
<a class="header">{{ music_title }}</a>
|
||||
<div class="description">
|
||||
<h2 id="time">{{ interval }}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="extra content">
|
||||
<div class="ui two buttons">
|
||||
<a href="/" class="ui red button">Stop</a>
|
||||
<a href="/random" class="ui green button">Next</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.onload = function () {
|
||||
let timeElement = document.querySelector('#time');
|
||||
let sound = preload_audio('/static/sound/{{ music_file }}')
|
||||
startTimer({{ interval }}, timeElement, sound);
|
||||
}
|
||||
|
||||
function startTimer(seconds, element, sound) {
|
||||
var timer = seconds - 1
|
||||
let interval = setInterval(function () {
|
||||
|
||||
element.textContent = timer;
|
||||
|
||||
if (--timer < 0) {
|
||||
play_audio(sound, 8000, function () {
|
||||
location.reload()
|
||||
})
|
||||
|
||||
clearInterval(interval)
|
||||
element.textContent = '♬'
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock content %}
|
Loading…
Add table
Add a link
Reference in a new issue