-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
59 lines (53 loc) · 1.91 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css">
<script src="scripts.js"></script>
</head>
<body onload="initialize()">
<meta name="referrer" content="no-referrer">
<div class="container">
<div class="row justify-content-center">
<div class="col-sm-6 text-center">
<div class="flashcard-container">
<div class="flashcard">
<div id="flashcard-front">
Chinese Text
</div>
<div id="flashcard-back">
<div>
<h1 id="english" class="text-danger">English Text</h1>
<h4 id="pinyin" class="text-success">pinyin</h4>
</div>
</div>
</div>
</div>
<button class="btn btn-primary" onclick="next_card()">Next Card</button>
<button class="btn btn-danger" onclick="play_sound()">Play Sound</button>
<audio id="audio" src="" hidden></audio>
</div>
</div>
</div>
<script>
const flashcard = document.querySelector('.flashcard');
flashcard.addEventListener('click', function () {
this.classList.toggle('flipped');
});
flashcard.ontransitionend = () => {
console.log(next_c)
if (next_c) {
pick_random_card()
display_card()
next_c = false
}
};
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.7.0.min.js"
integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script>
</body>
</html>