OzoneAsai commited on
Commit
737784d
1 Parent(s): 44a41a2

Create templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +38 -0
templates/index.html ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Flashcards</title>
7
+ <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
8
+ </head>
9
+ <body>
10
+ <div class="flashcard" id="flashcard">
11
+ <div class="content">
12
+ <h2>Set: {{ set_name }}</h2>
13
+ <p><strong>English:</strong> {{ english }}</p>
14
+ <p><strong>Japanese:</strong> {{ japanese }}</p>
15
+ </div>
16
+ <div class="navigation">
17
+ <button id="prevBtn">Previous</button>
18
+ <button id="nextBtn">Next</button>
19
+ </div>
20
+ </div>
21
+ <script>
22
+ document.getElementById('prevBtn').addEventListener('click', function() {
23
+ navigate('{{ url_for("prev", set=set_name, index=index) }}');
24
+ });
25
+ document.getElementById('nextBtn').addEventListener('click', function() {
26
+ navigate('{{ url_for("next", set=set_name, index=index) }}');
27
+ });
28
+
29
+ function navigate(url) {
30
+ const flashcard = document.getElementById('flashcard');
31
+ flashcard.classList.add('fade-out');
32
+ setTimeout(function() {
33
+ window.location.href = url;
34
+ }, 500); // Match this duration with the CSS animation duration
35
+ }
36
+ </script>
37
+ </body>
38
+ </html>