-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
215 lines (198 loc) · 10.7 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="Description" content="Al-Qur'an Online Dengan Terjemahan Bahasa Indonesia">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css" rel="stylesheet">
<title>Al-Qur'an Online</title>
</head>
<body>
<div id="app">
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
<a class="navbar-brand" href="#">Al-Qur'an Online</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item active">
<a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span></a>
</li>
<!-- <li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li> -->
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="card my-5 border-0 shadow ">
<div class="card-header bg-success text-light">
Daftar Surah
</div>
<div class="card-body">
<div v-if="loading" class="d-flex justify-content-center">
<img
src="loading.svg"
height="87"
width="100"
alt="loading"
/>
</div>
<div v-else class="table-responsive">
<table class="display table" style="width:100%" id="list">
<thead>
<tr>
<th>No</th>
<th>Nama Surah</th>
<th>Arti</th>
<th>Jumlah Ayat</th>
</tr>
</thead>
<tbody>
<tr v-for="(data, index) in table" :key="index">
<td>{{index+1}}</td>
<td><a href="#" class="text-success" data-toggle="modal" data-target="#detailModal" v-on:click="getDetail(index)">{{data.asma}}<br>
{{data.nama}}
</a>
</td>
<td >{{data.arti}}</td>
<td >{{data.ayat}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="detailModal" tabindex="-1" aria-labelledby="detailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl ">
<div class="modal-content border border-success">
<div class="modal-header bg-success text-light">
<h5 class="modal-title" id="detailModalLabel">Surat {{detail.nama}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div v-if="loading2" class="d-flex justify-content-center">
<img
src="loading.svg"
height="87"
width="100"
alt="loading"
/>
</div>
<div v-else>
<div class="row p-1">
<div class="col-lg-6"><dl class="row">
<dt class="col-sm-3">Nama</dt>
<dd class="col-sm-9">
{{detail.asma}}<br>
{{detail.nama}}</dd>
<dt class="col-sm-3">Arti</dt>
<dd class="col-sm-9">
{{detail.arti}}
</dd>
<dt class="col-sm-3">Diturunkan di</dt>
<dd class="col-sm-9">{{detail.type}}</dd>
<dt class="col-sm-3">Audio</dt>
<dd class="col-sm-9">
<audio v-bind:src="detail.audio" controls>
</audio>
</dd>
<dt class="col-sm-3 text-truncate">Keterangan</dt>
<dd class="col-sm-9 border border-secondary" style="max-height: 250px;overflow-y: scroll;"><span v-html="detail.keterangan"></span></dd>
</dl></div>
<div class="col-lg-6">
<h3 class="h3 underline">Bacaan Surah {{detail.nama}}</h3>
<div class="border border-success p-3" style="max-height: 450px;overflow-y: scroll;">
<span v-for="(ayat,index) in ayats" ::key="index">
<p>
<span span class="badge badge-pill badge-success">{{detail.nomor}}:{{ayat.nomor}}</span>
<p class="text-right">{{ayat.ar}}</p>
</p>
<small v-html="ayat.tr" ></small><br>
<small class="text-left font-italic">{{ayat.id}}</small>
<hr>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary text-light" data-dismiss="modal">Close</button>
<!-- <button type="button" class="btn btn-primary text-light">Baca Surat</button> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="modified.jquery.dataTables.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<!-- development version, includes helpful console warnings -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script>
var app = new Vue({
el:'#app',
data:{
table:[],
detail:[],
ayats:[],
loading:false,
loading2:false
},
methods: {
getDetail(index){
this.loading2 = true
this.$http.get('https://api.npoint.io/99c279bb173a6e28359c/data/'+index+'/').then(response=>{
// console.log(response.body.nomor);
this.getSurah(response.body.nomor);
this.detail = response.body;
},response=>{
console.log('getDetail error '+response)
})
},
getSurah(nomor){
this.$http.get('https://api.npoint.io/99c279bb173a6e28359c/surat/'+nomor+'/').then(response=>{
console.log(response.body);
this.ayats = response.body;
this.loading2 = false
},response=>{
console.log('getAyat error '+response)
})
}
},
mounted() {
this.loading = true
this.$http.get('https://api.npoint.io/99c279bb173a6e28359c/data/').then(response=>{
// console.log(response.body[0]);
this.table = response.body;
this.loading = false
this.$nextTick(function() {
$('#list').DataTable({
responsive: true
});
})
},response=>{
console.log('error '+response)
})
},
})
</script>
</body>
</html>