-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetailMatch.html
99 lines (83 loc) · 2.81 KB
/
detailMatch.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Football Match</title>
<meta name="description" content="Football" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="css/materialize.min.css" />
<link rel="stylesheet" href="css/materialize.css">
<link rel="manifest" href="/manifest.json" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
<meta name="theme-color" content="#00897B" />
<style>
#body-content{
padding: 16px;
}
</style>
</head>
<body>
<!-- Navigasi -->
<nav class="black" role="navigation">
<div class="nav-wrapper container">
<a href="#" class="brand-logo" id="logo-container">
Football Match
</a>
<a href="./index.html" class="sidenav-trigger" data-target="nav-mobile">
<i class="material-icons">arrow_back</i>
</a>
<ul class="topnav right hide-on-med-and-down"></ul>
<ul class="sidenav" id="nav-mobile"></ul>
</div>
</nav>
<!-- Akhir Navigasi -->
<div class="container" id="body-content">
</div>
<div class="fixed-action-btn">
<a class="btn-floating btn-large red" id="save">
<i class="large material-icons">save</i>
</a>
</div>
<div class="fixed-action-btn">
<a class="btn-floating btn-large red" id="delete">
<i class="large material-icons">delete</i>
</a>
</div>
<script src="js/materialize.min.js"></script>
<script src="js/idb.js"></script>
<script src="js/db.js"></script>
<script src="js/api.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
var urlParams = new URLSearchParams(window.location.search);
var isFromSaved = urlParams.get("saved");
var idMatch = urlParams.get("id");
var save = document.getElementById("save");
var deleted = document.getElementById("delete");
if (isFromSaved) {
save.style.display = 'none';
deleted.style.display = 'block';
deleted.onclick = function () {
deleteMatchById(idMatch);
window.location.href = "/";
}
getSavedMatchById();
} else {
deleted.style.display = 'none';
save.style.display = 'block';
var item = getMatchDetailById();
save.onclick = function() {
console.log("Tombol FAB di klik.");
item.then(function(matches) {
saveMatch(matches);
save.style.display = 'none';
});
};
}
});
</script>
</body>
</html>