CnJaFlashC-1 / templates /index.html
OzoneAsai's picture
Create templates/index.html
737784d verified
raw
history blame
1.37 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flashcards</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<div class="flashcard" id="flashcard">
<div class="content">
<h2>Set: {{ set_name }}</h2>
<p><strong>English:</strong> {{ english }}</p>
<p><strong>Japanese:</strong> {{ japanese }}</p>
</div>
<div class="navigation">
<button id="prevBtn">Previous</button>
<button id="nextBtn">Next</button>
</div>
</div>
<script>
document.getElementById('prevBtn').addEventListener('click', function() {
navigate('{{ url_for("prev", set=set_name, index=index) }}');
});
document.getElementById('nextBtn').addEventListener('click', function() {
navigate('{{ url_for("next", set=set_name, index=index) }}');
});
function navigate(url) {
const flashcard = document.getElementById('flashcard');
flashcard.classList.add('fade-out');
setTimeout(function() {
window.location.href = url;
}, 500); // Match this duration with the CSS animation duration
}
</script>
</body>
</html>