Skip to content

Commit

Permalink
loading animation added.
Browse files Browse the repository at this point in the history
  • Loading branch information
PAVANA809 committed Mar 30, 2024
1 parent 6007534 commit b8a0dbf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ <h4>Title: {{obj.title}}</h4>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
</body>
<script>

var app = new Vue({
el: '#app',
data: {
Expand All @@ -32,14 +34,23 @@ <h4>Title: {{obj.title}}</h4>
},
methods: {
async search(){
Swal.fire({
title: 'Loading...',
allowOutsideClick: false,
allowEscapeKey: false,
showConfirmButton: false,
didOpen: () => {
Swal.showLoading();
}
})
try {
const response = await fetch("https://movie-torrent-api.onrender.com/search/"+this.searchItem, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
});

Swal.close()
if (response.ok) {
const data = await response.json();
this.data = data['data']
Expand Down

0 comments on commit b8a0dbf

Please sign in to comment.