Skip to content

Commit

Permalink
fix loader
Browse files Browse the repository at this point in the history
  • Loading branch information
dianait committed Mar 16, 2023
1 parent a318eb2 commit 2c8e8c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ <h2 class="question">Would you rather be a cat or a dog?</h2>
</footer>
</body>
<script type="module" src="./js/getQuestion.js"></script>
<script src="./js/loader.js"></script>

</html>
10 changes: 10 additions & 0 deletions js/getQuestion.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ const myButton = document.querySelector(".my-button");
const output = document.querySelector(".question");
myButton.onclick = getQuestion;

var loadingDiv = document.getElementById('loading');

function showSpinner() {
loadingDiv.style.visibility = 'visible';
}

function hideSpinner() {
loadingDiv.style.visibility = 'hidden';
}

async function getQuestion() {
showSpinner()
const data = {
Expand Down
9 changes: 0 additions & 9 deletions js/loader.js

This file was deleted.

1 comment on commit 2c8e8c0

@vercel
Copy link

@vercel vercel bot commented on 2c8e8c0 Mar 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ranther – ./

ranther.vercel.app
ranther-git-main-dianait.vercel.app
ranther-dianait.vercel.app

Please sign in to comment.